diff --git a/config/.gitignore b/config/.gitignore deleted file mode 100644 index 3836b185..00000000 --- a/config/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# ignore development params -development/params.toml \ No newline at end of file diff --git a/config/_default/markup.toml b/config/_default/markup.toml index d82aba30..503d43bc 100644 --- a/config/_default/markup.toml +++ b/config/_default/markup.toml @@ -26,6 +26,8 @@ table = true taskList = true typographer = true + # TODO passthrough refactor https://gohugo.io/getting-started/configuration-markup/#parserattributeblock + # TODO hugo 0.122.0 https://gohugo.io/content-management/mathematics/ [goldmark.parser] autoHeadingID = true autoHeadingIDType = "github" diff --git a/config/_default/menus.en.toml b/config/_default/menus.en.toml index 603d11db..5a072131 100644 --- a/config/_default/menus.en.toml +++ b/config/_default/menus.en.toml @@ -91,6 +91,7 @@ identifier = "components" parent = "about" name = "Components" + title = "Hugo FixIt Components" url = "components/" weight = 24 [main.params] @@ -111,6 +112,16 @@ weight = 26 [main.params] icon = "fa-solid fa-microchip" +[[main]] + identifier = "contributing" + parent = "about" + name = "Contributing" + title = "Contribute to the FixIt project" + url = "contributing/overview/" + weight = 27 + [main.params] + icon = "fa-solid fa-heart-circle-bolt text-danger fa-beat" + class = "fa-bounce" [[main]] identifier = "github" diff --git a/config/_default/menus.zh-cn.toml b/config/_default/menus.zh-cn.toml index 30bb896b..6a80cec5 100644 --- a/config/_default/menus.zh-cn.toml +++ b/config/_default/menus.zh-cn.toml @@ -81,10 +81,10 @@ icon = "fa-regular fa-comments" [[main]] identifier = "guides" + parent = "about" name = "相关教程" url = "guides/" weight = 23 - parent = "about" [main.params] icon = "fa-regular fa-compass" [[main]] @@ -97,20 +97,30 @@ icon = "fa-solid fa-puzzle-piece" [[main]] identifier = "showcase" + parent = "about" name = "案例展示" url = "showcase/" weight = 25 - parent = "about" [main.params] icon = "fa-solid fa-blog" [[main]] identifier = "references" - name = "参考" + parent = "about" + name = "API 参考" url = "references/overview/" weight = 26 - parent = "about" [main.params] icon = "fa-solid fa-microchip" +[[main]] + identifier = "contributing" + parent = "about" + name = "贡献指南" + title = "为 FixIt 项目做贡献" + url = "contributing/overview/" + weight = 27 + [main.params] + icon = "fa-solid fa-heart-circle-bolt text-danger fa-beat" + class = "fa-bounce" [[main]] identifier = "github" diff --git a/config/_default/params.toml b/config/_default/params.toml index a4ba2c3d..501fb670 100644 --- a/config/_default/params.toml +++ b/config/_default/params.toml @@ -1011,7 +1011,7 @@ disableThemeInject = false enable = true # Gravatar host, default: "www.gravatar.com" # Gravatar 主机,默认:“www.gravatar.com” - host = "gravatar.lruihao.cn" # ["cn.gravatar.com", "gravatar.loli.net", ...] + host = "cravatar.cn" # ["cravatar.cn", "gravatar.loli.net", ...] style = "mp" # ["", "mp", "identicon", "monsterid", "wavatar", "retro", "blank", "robohash"] # Back to top @@ -1064,14 +1064,15 @@ disableThemeInject = false # FixIt 0.2.15 | NEW Developer options # FixIt 0.2.15 | 新增 开发者选项 +# Select the scope named `public_repo` to generate personal access token, +# Configure with environment variable `HUGO_PARAMS_GHTOKEN=xxx`, see https://gohugo.io/functions/os/getenv/#examples +# 选择命名为 "public_repo" 的范围以生成个人访问令牌, +# 配置环境变量 HUGO_PARAMS_GHTOKEN=xxx,详见 https://gohugo.io/functions/os/getenv/#examples [dev] enable = false # Check for updates # 检查更新 c4u = false - # For using the GitHub API, please do not expose to public! - # 用于使用 GitHub API,请勿公开展示! - githubToken = "" # Mobile Devtools config # 移动端开发者工具配置 [dev.mDevtools] diff --git a/config/development/params.toml b/config/development/params.toml new file mode 100644 index 00000000..81f322ca --- /dev/null +++ b/config/development/params.toml @@ -0,0 +1,16 @@ +# ------------------------------------------------------------------------------------- +# Theme Core Configuration +# See: https://fixit.lruihao.cn/theme-documentation-basics/#site-configuration +# ------------------------------------------------------------------------------------- + +# FixIt 0.2.15 | NEW Developer options +# Configure with environment variable HUGO_PARAMS_GHTOKEN=xxx, see https://gohugo.io/functions/os/getenv/#examples +[dev] + enable = false + # Check for updates + c4u = true + # Mobile Devtools confi + [dev.mDevtools] + enable = false + # "vConsole", "eruda" supported + type = "vConsole" diff --git a/content/en/contributing/_index.md b/content/en/contributing/_index.md new file mode 100644 index 00000000..681324b1 --- /dev/null +++ b/content/en/contributing/_index.md @@ -0,0 +1,9 @@ +--- +title: Contributing +date: 2024-04-25T20:17:52+08:00 +description: Hugo FixIt is eager for enthusiasm and participation from the open-source community. We need your support. +keywords: + - hugo-fixit + - FixIt + - Contribution +--- \ No newline at end of file diff --git a/content/en/contributing/components/index.md b/content/en/contributing/components/index.md new file mode 100644 index 00000000..531a5dae --- /dev/null +++ b/content/en/contributing/components/index.md @@ -0,0 +1,26 @@ +--- +title: Develop theme components (TODO) +date: 2024-04-25T20:30:45+08:00 +type: posts +collections: + - Contributing +draft: true +hiddenFromHomePage: true +reward: true +related: + enable: false +--- + +If you’ve built a Hugo theme components and want to contribute back to the Hugo FixIt Community, please share it with us. + + + +Visit [this page][components] to browse a collection of themes components created by the Hugo FixIt community. + +## References + +Head to the [References][references] page for more information. + + +[components]: {{< relref "/components/" >}} +[references]: {{< relref "/references/" >}} diff --git a/content/en/contributing/development/index.md b/content/en/contributing/development/index.md new file mode 100644 index 00000000..51b02385 --- /dev/null +++ b/content/en/contributing/development/index.md @@ -0,0 +1,49 @@ +--- +title: Develop FixIt theme +date: 2024-04-25T20:30:43+08:00 +type: posts +collections: + - Contributing +hiddenFromHomePage: true +reward: true +related: + enable: false +--- + +Contribute to the development of FixIt. + + + +## Introduction + +You can contribute to the FixIt theme project by: + +- Answering questions on the [discussions][discussions] page +- Squashing [bugs][bugs] +- Developing [new features][features] + +For a complete guide to contributing to FixIt, see the [Contribution Guide][contribution-guide]. + +## Prerequisites + +To contribute to the development of the FixIt theme, you need to: + +- Install [Hugo][hugo] with the extended version +- Install [Go][go] +- Install [Git][git] +- Install [Node.js][node] above version 18.0.0 + +## References + +Head to the [References][references] page for more information. + + +[discussions]: https://github.com/orgs/hugo-fixit/discussions +[bugs]: https://github.com/hugo-fixit/FixIt/issues?q=is%3Aopen+is%3Aissue+label%3Abug +[features]: https://github.com/hugo-fixit/FixIt/issues?q=is%3Aopen+is%3Aissue+label%3Aenhancement +[contribution-guide]: https://github.com/hugo-fixit/FixIt/blob/master/CONTRIBUTING.md +[hugo]: https://gohugo.io/installation/ +[go]: https://go.dev/doc/install +[git]: https://git-scm.com/book/en/v2/Getting-Started-Installing-Git +[node]: https://nodejs.org/en/download/ +[references]: {{< relref "/references/" >}} diff --git a/content/en/contributing/documentation/index.md b/content/en/contributing/documentation/index.md new file mode 100644 index 00000000..8a7cf626 --- /dev/null +++ b/content/en/contributing/documentation/index.md @@ -0,0 +1,83 @@ +--- +title: Improve documentation +date: 2024-04-25T20:30:44+08:00 +type: posts +collections: + - Contributing +hiddenFromHomePage: true +reward: true +related: + enable: false +--- + +Help us to improve the documentation by identifying issues and suggesting changes. + + + +## Introduction + +We welcome corrections and improvements to the documentation. Please note that the documentation resides in its own repository, separate from the project repository. + +For corrections and improvements to the current documentation, please submit issues and pull requests to the [documentation repository][docs]. + +You can also: + +- Submit [showcase][showcase] by editing the `data/friends.yml` file +- Submit [theme components][components] by editing the `data/projects.lang.yml` file + +## Prerequisites + +To contribute to the documentation, you need to: + +- Install [Hugo][hugo] with the extended version +- Install [Go][go] +- Install [Git][git] +- Install [Node.js][node] above version 18.0.0 + +## Guidelines + +First, fork this repository by clicking the fork button. + +Next, clone your forked repo. + +```bash +git clone https://github.com/hugo-fixit/docs.git fixit-docs && cd fixit-docs +``` + +Then, install the dev dependencies. + +```bash +npm install +``` + +And now you are ready to go! + +Here are some useful commands. + +```bash +# run a local debugging server with watch +npm run server +# run a local debugging server with watch in production environment +npm run server:production +# see Edit the theme section +npm run server:development +``` + +## Edit the theme + +If you want to do docs-related theme changes, the simplest way is to have both `fixit-docs` and `FixIt` cloned as sibling directories, and then run: + +```bash +HUGO_MODULE_WORKSPACE=hugo.work hugo server --ignoreVendorPaths "**" +``` + +Finally, create a new pull request at to submit your contribution 🎉 + + +[docs]: https://github.com/hugo-fixit/docs +[hugo]: https://gohugo.io/installation/ +[go]: https://go.dev/doc/install +[git]: https://git-scm.com/book/en/v2/Getting-Started-Installing-Git +[node]: https://nodejs.org/en/download/ +[showcase]: {{< relref path="/showcase" >}} +[components]: {{< relref "/components" >}} diff --git a/content/en/contributing/overview/cover.webp b/content/en/contributing/overview/cover.webp new file mode 100644 index 00000000..dbefa8bd Binary files /dev/null and b/content/en/contributing/overview/cover.webp differ diff --git a/content/en/contributing/overview/index.md b/content/en/contributing/overview/index.md new file mode 100644 index 00000000..861a1b82 --- /dev/null +++ b/content/en/contributing/overview/index.md @@ -0,0 +1,34 @@ +--- +title: Contribute to the FixIt project +linkTitle: Overview of contributing +date: 2024-04-25T20:30:42+08:00 +collections: + - Contributing +resources: + - name: featured-image + src: cover.webp +type: posts +pageStyle: wide +reward: true +related: + enable: false +description: Hugo FixIt is eager for enthusiasm and participation from the open-source community. We need your support! +keywords: + - hugo-fixit + - FixIt + - Contribution +--- + +Hugo FixIt is eager for enthusiasm and participation from the open-source community. We need your support! + + + +{{< link "../development" "🔧 Develop FixIt theme" "Contribute to the development of FixIt." true >}} + +--- + +{{< link "../documentation" "📝 Improve documentation" "Help us to improve the documentation by identifying issues and suggesting changes." true >}} + +--- + +{{< link "../components" "🧩 Develop theme components" "Contribute to the development of Hugo FixIt components." true >}} diff --git a/content/en/documentation/content-management/encryption/index.md b/content/en/documentation/content-management/encryption/index.md index 8899b760..2542ddb6 100644 --- a/content/en/documentation/content-management/encryption/index.md +++ b/content/en/documentation/content-management/encryption/index.md @@ -32,14 +32,14 @@ Find out how to encrypt content in FixIt theme. ## Page Encryption -### Frontmatter +### Front matter -The FixIt theme provides two frontmatters for page encryption. +The FixIt theme provides two front matters for page encryption. - **password**: _[required]_ password of encrypted page content - **message**: _[optional]_ encryption prompt -For example, the frontmatters in this article are as follows: +For example, the front matters in this article are as follows: ```yaml --- diff --git a/content/en/documentation/content-management/introduction/index.md b/content/en/documentation/content-management/introduction/index.md index dfb46e0e..59b64ff5 100644 --- a/content/en/documentation/content-management/introduction/index.md +++ b/content/en/documentation/content-management/introduction/index.md @@ -1,4 +1,5 @@ --- +weight: 2 title: Content Management Overview date: 2024-04-06T12:57:26+08:00 type: posts diff --git a/content/en/documentation/content-management/markdown-syntax/extended/index.md b/content/en/documentation/content-management/markdown-syntax/extended/index.md index 420d81a3..e5e4848c 100644 --- a/content/en/documentation/content-management/markdown-syntax/extended/index.md +++ b/content/en/documentation/content-management/markdown-syntax/extended/index.md @@ -19,7 +19,7 @@ categories: reward: true math: true --- - + **FixIt** theme has some extended syntax elements for you to write articles. @@ -307,10 +307,42 @@ The rendered output looks like this: > The premise is that you set `goldmark.parser.attribute.block` to `true`. -Enable custom attribute support for titles and blocks by adding attribute lists inside single curly brackets (`{.myclass class="class1 class2"}`) and placing it after the Markdown element it decorates, on the same line for titles and on a new line directly below for blocks. - Hugo supports adding attributes (e.g. CSS classes) to Markdown blocks, e.g. tables, lists, paragraphs etc. +## Syntax + +```md +some Markdown content +{#id .class1 .class2 key1="value1" key2="value2"} +``` + +In most cases, place the attribute list beneath the markup element. For headings and fenced code blocks, place the attribute list on the right. + +| Element | Position of attribute list | +| :---------------- | :------------------------- | +| blockquote | bottom | +| fenced code block | right | +| heading | right | +| horizontal rule | bottom | +| image | bottom | +| list | bottom | +| paragraph | bottom | +| table | bottom | + +## Examples + +A horizontal rule with a CSS class: + +```md +--- +{.awesome-hr} +``` + +The rendered output looks like this: + +--- +{.awesome-hr} + A blockquote with a CSS class: ```md @@ -325,6 +357,8 @@ The rendered output looks like this: > bar {.text-danger} +--- + There are some current limitations: For tables you can currently only apply it to the full table, and for lists the `ul`/`ol`-nodes only, e.g.: ```md @@ -353,6 +387,8 @@ The rendered output looks like this: {.text-warning} {.text-primary} +--- + Note that attributes in [code fences][code-fences] must come after the opening tag, with any other highlighting processing instruction, e.g.: ```md @@ -361,16 +397,11 @@ Note that attributes in [code fences][code-fences] must come after the opening t {?`}{?`}{?`} ``` -## Code Fences Extended - -### Code Block Attributes - -You can add attributes to a code block, for example: +Add `title` attributes to a code block, for example: ````markdown ```js {title="test.js"} console.log('hello FixIt!'); -``` ```` The rendered output looks like this: @@ -379,14 +410,13 @@ The rendered output looks like this: console.log('hello FixIt!'); ``` -Currently supported attributes include: - -- `title`: The title of the code block. +## Code Fences Extended ### Diagrams Support This part is shown in the [diagrams support page][diagrams-support]. + [emoji-support]: {{< relref path="/guides/emoji-support" >}} [katex]: https://katex.org/ [theme-config]: {{< relref path="/documentation/getting-started/configuration#theme-configuration" >}} diff --git a/content/en/documentation/content-management/shortcodes/extended/introduction/index.md b/content/en/documentation/content-management/shortcodes/extended/introduction/index.md index 6b9556b7..fdba32d0 100644 --- a/content/en/documentation/content-management/shortcodes/extended/introduction/index.md +++ b/content/en/documentation/content-management/shortcodes/extended/introduction/index.md @@ -23,7 +23,7 @@ lightgallery: true math: true reward: true --- - + **FixIt** theme provides multiple shortcodes on top of built-in ones in Hugo. @@ -78,7 +78,7 @@ The `link` shortcode has the following named parameters: Content of the link, default value is the value of **href** parameter. - *Markdown or HTML format is supported.* + _Markdown or HTML format is supported._ - **title** _[optional]_ (**third** positional parameter) @@ -88,15 +88,19 @@ The `link` shortcode has the following named parameters: Whether to display as a card link, whose default value is `false`. +- **card-icon** _[optional]_ (**fifth** positional parameter) {{< version 0.3.5 >}} + + Icon of the card link, support Font Awesome class name or image URL. default value is the favicon of the link. + - **download** _[optional]_ {{< version 0.2.12 >}} `optional` attribute of the HTML `a` tag. -- **class** *[optional]* +- **class** _[optional]_ `class` attribute of the HTML `a` tag. -- **rel** *[optional]* +- **rel** _[optional]_ Additional `rel` attributes of the HTML `a` tag. @@ -146,26 +150,26 @@ Example `link` input for card type: ```go-html-template {{}} -Or -{{}} +{{}} +{{}} ``` The rendered output looks like this: {{< link "https://github.com/hugo-fixit/FixIt" "FixIt Theme" "source of FixIt Theme" true >}} +{{< link "https://lruihao.cn" "Lruihao Blog" "Lruihao Blog" true "https://lruihao.cn/images/avatar.jpg" >}} +{{< link "https://lruihao.cn" "Lruihao Blog" "Lruihao Blog" true "fa-solid fa-blog" >}} Example `link` input with download attribute: ```go-html-template {{}} - {{}} ``` The rendered output looks like this: {{< link href="/music/Wavelength.mp3" content="Wavelength.mp3" title="Download Wavelength.mp3" download="Wavelength.mp3" >}} - {{< link href="/music/Wavelength.mp3" content="Wavelength.mp3" title="Download Wavelength.mp3" download="Wavelength.mp3" card=true >}} ## image {#image} @@ -186,43 +190,43 @@ The `image` shortcode has the following named parameters: Alternate text for the image if the image cannot be displayed, default value is the value of **src** parameter. - *Markdown or HTML format is supported.* + _Markdown or HTML format is supported._ - **caption** _[optional]_ (**third** positional parameter) Image caption. - *Markdown or HTML format is supported.* + _Markdown or HTML format is supported._ -- **title** *[optional]* +- **title** _[optional]_ Image title that will be shown when hovering on the image. -- **class** *[optional]* +- **class** _[optional]_ `class` attribute of the HTML `figure` tag. -- **src_s** *[optional]* +- **src_s** _[optional]_ URL of the image thumbnail, used for lightgallery, default value is the value of **src** parameter. -- **src_l** *[optional]* +- **src_l** _[optional]_ URL of the HD image, used for lightgallery, default value is the value of **src** parameter. -- **height** *[optional]* +- **height** _[optional]_ `height` attribute of the image. -- **width** *[optional]* +- **width** _[optional]_ `width` attribute of the image. -- **linked** *[optional]* +- **linked** _[optional]_ Whether the image needs to be hyperlinked, default value is `true`. -- **rel** *[optional]* +- **rel** _[optional]_ Additional `rel` attributes of the HTML `a` tag, if **linked** parameter is set to `true`. @@ -244,7 +248,7 @@ The rendered output looks like this: The `admonition` shortcode supports **12** types of banners to help you put notice in your page. -*Markdown or HTML format in the content is supported.* +_Markdown or HTML format in the content is supported._ {{< admonition >}} A **note** banner @@ -413,7 +417,7 @@ Or The rendered output looks like this: {{< details "**Copyright** 2022." >}} -*All pages and graphics on this web site are the property of FixIt.* +_All pages and graphics on this web site are the property of FixIt._ {{< /details >}} ## center-quote diff --git a/content/en/documentation/getting-started/configuration/index.md b/content/en/documentation/getting-started/configuration/index.md index 9398ac81..3044431d 100644 --- a/content/en/documentation/getting-started/configuration/index.md +++ b/content/en/documentation/getting-started/configuration/index.md @@ -989,7 +989,7 @@ enable Depends on the author's email, if the author's email is not set, the local avatar will be used. host -: `string` Gravatar host. e.g. `www.gravatar.com`, `cn.gravatar.com` etc. Default is `www.gravatar.com`. +: `string` Gravatar host. e.g. `www.gravatar.com`, `cravatar.cn` etc. Default is `www.gravatar.com`. style : `string` Gravatar style. The configuration value for `style` can be one of `mp`, `identicon`, `monsterid`, `wavatar`, `retro`, `blank`, `robohash`. Default is `""`. @@ -1095,12 +1095,13 @@ theme `map` Developer options. +Select the scope named `public_repo` to generate personal access token, Configure with environment variable `HUGO_PARAMS_GHTOKEN=xxx`, see . + ```toml [params] [params.dev] enable = false c4u = false - githubToken = "" [params.dev.mDevtools] enable = false type = "vConsole" @@ -1112,9 +1113,6 @@ enable c4u : `bool` Whether to check for updates. Default is `false`. -githubToken -: `string` GitHub token. Please do not expose to public! - mDevtools : `map` Mobile Devtools Configuration. diff --git a/content/zh-cn/collections/contributing/_index.md b/content/zh-cn/collections/contributing/_index.md new file mode 100644 index 00000000..79fe4b2e --- /dev/null +++ b/content/zh-cn/collections/contributing/_index.md @@ -0,0 +1,3 @@ +--- +title: 贡献指南 +--- diff --git a/content/zh-cn/contributing/_index.md b/content/zh-cn/contributing/_index.md new file mode 100644 index 00000000..2054ffb4 --- /dev/null +++ b/content/zh-cn/contributing/_index.md @@ -0,0 +1,9 @@ +--- +title: 贡献指南 +date: 2024-04-25T20:17:52+08:00 +description: Hugo FixIt 非常渴望来自于开源社区的热情和参与。我们需要你们的支持。 +keywords: + - hugo-fixit + - FixIt + - 贡献指南 +--- \ No newline at end of file diff --git a/content/zh-cn/contributing/components/index.md b/content/zh-cn/contributing/components/index.md new file mode 100644 index 00000000..1b678177 --- /dev/null +++ b/content/zh-cn/contributing/components/index.md @@ -0,0 +1,26 @@ +--- +title: 开发组件 (TODO) +date: 2024-04-25T20:30:45+08:00 +collections: + - Contributing +type: posts +draft: true +hiddenFromHomePage: true +reward: true +related: + enable: false +--- + +如果你已经构建了一个 Hugo 主题组件,并希望贡献给 Hugo FixIt 社区,请与我们分享。 + + + +访问 [此页面][components] 浏览由 Hugo FixIt 社区创建的主题组件合集。 + +## API 参考 + +前往 [API 参考][references] 页面获取更多信息。 + + +[components]: {{< relref "/components/" >}} +[references]: {{< relref "/references/" >}} diff --git a/content/zh-cn/contributing/development/index.md b/content/zh-cn/contributing/development/index.md new file mode 100644 index 00000000..a0c50b9c --- /dev/null +++ b/content/zh-cn/contributing/development/index.md @@ -0,0 +1,49 @@ +--- +title: 开发 FixIt 主题 +date: 2024-04-25T20:30:43+08:00 +collections: + - Contributing +type: posts +hiddenFromHomePage: true +reward: true +related: + enable: false +--- + +为 FixIt 的开发做贡献。 + + + +## 介绍 + +你可以通过以下方式为 FixIt 主题项目做出贡献: + +- 在 [讨论][discussions] 页面上回答问题 +- 消灭 [bugs][bugs] +- 开发 [新功能][features] + +有关如何为 FixIt 做出贡献的完整指南,请参阅 [贡献指南][contribution-guide]。 + +## 先决条件 + +给 FixIt 主题的开发做出贡献,你需要: + +- 安装 [Hugo][hugo] 的扩展版本 +- 安装 [Go][go] +- 安装 [Git][git] +- 安装 [Node.js][node] 版本大于 18.0.0 + +## API 参考 + +前往 [API 参考][references] 页面获取更多信息。 + + +[discussions]: https://github.com/orgs/hugo-fixit/discussions +[bugs]: https://github.com/hugo-fixit/FixIt/issues?q=is%3Aopen+is%3Aissue+label%3Abug +[features]: https://github.com/hugo-fixit/FixIt/issues?q=is%3Aopen+is%3Aissue+label%3Aenhancement +[contribution-guide]: https://github.com/hugo-fixit/FixIt/blob/master/CONTRIBUTING.md +[hugo]: https://gohugo.io/installation/ +[go]: https://go.dev/doc/install +[git]: https://git-scm.com/book/en/v2/Getting-Started-Installing-Git +[node]: https://nodejs.org/en/download/ +[references]: {{< relref "/references/" >}} diff --git a/content/zh-cn/contributing/documentation/index.md b/content/zh-cn/contributing/documentation/index.md new file mode 100644 index 00000000..669a176e --- /dev/null +++ b/content/zh-cn/contributing/documentation/index.md @@ -0,0 +1,83 @@ +--- +title: 完善文档 +date: 2024-04-25T20:30:44+08:00 +collections: + - Contributing +type: posts +hiddenFromHomePage: true +reward: true +related: + enable: false +--- + +通过发现问题并提出更改来帮助我们改进文档。 + + + +## 简介 + +我们欢迎对文档的更正和改进。请注意,文档存储在单独的存储库中,与项目存储库分开。 + +对于当前文档的更正和改进,请提交问题和拉取请求到 [文档存储库][docs]。 + +你也可以: + +- 通过编辑 `data/friends.yml` 文件提交 [案例展示][showcase] +- 通过编辑 `data/projects.lang.yml` 文件提交 [主题组件][components] + +## 先决条件 + +给文档做贡献,你需要: + +- 安装 [Hugo][hugo] 扩展版本 +- 安装 [Go][go] +- 安装 [Git][git] +- 安装 [Node.js][node] 版本大于 18.0.0 + +## 指南 + +首先,点击 fork 按钮 fork 本仓库。 + +然后,克隆你 fork 的仓库。 + +```bash +git clone https://github.com/hugo-fixit/docs.git fixit-docs && cd fixit-docs +``` + +接着,安装开发依赖。 + +```bash +npm install +``` + +最后,你就可以开始了! + +这里有一些有用的命令。 + +```bash +# 运行带有监听文件变化的本地调试服务器 +npm run server +# 运行带有监听文件变化的本地调试服务器(生产环境) +npm run server:production +# 查看编辑主题部分 +npm run server:development +``` + +## 编辑主题 + +如果你想做与文档相关的主题更改,最简单的方法是将 `fixit-docs` 和 `FixIt` 克隆为兄弟目录,然后运行: + +```bash +HUGO_MODULE_WORKSPACE=hugo.work hugo server --ignoreVendorPaths "**" +``` + +最后,在 创建一个新的 pull request 来提交你的贡献 🎉 + + +[docs]: https://github.com/hugo-fixit/docs +[hugo]: https://gohugo.io/installation/ +[go]: https://go.dev/doc/install +[git]: https://git-scm.com/book/en/v2/Getting-Started-Installing-Git +[node]: https://nodejs.org/en/download/ +[showcase]: {{< relref path="/showcase" >}} +[components]: {{< relref "/components" >}} diff --git a/content/zh-cn/contributing/overview/index.md b/content/zh-cn/contributing/overview/index.md new file mode 100644 index 00000000..a63c153a --- /dev/null +++ b/content/zh-cn/contributing/overview/index.md @@ -0,0 +1,33 @@ +--- +title: 为 FixIt 项目做贡献 +date: 2024-04-25T20:30:42+08:00 +collections: + - Contributing +resources: + - name: featured-image + src: cover.webp +type: posts +pageStyle: wide +reward: true +related: + enable: false +description: Hugo FixIt 非常渴望来自于开源社区的热情和参与。我们需要你们的支持! +keywords: + - hugo-fixit + - FixIt + - 贡献指南 +--- + +Hugo FixIt 非常渴望来自于开源社区的热情和参与。我们需要你们的支持! + + + +{{< link "../development" "🔧 开发 FixIt 主题" "为 FixIt 的开发做贡献。" true >}} + +--- + +{{< link "../documentation" "📝 完善文档" "通过发现问题并提出更改来帮助我们改进文档。" true >}} + +--- + +{{< link "../components" "🧩 开发组件" "为 Hugo FixIt 主题组件的开发做贡献。" true >}} diff --git a/content/zh-cn/documentation/content-management/encryption/index.md b/content/zh-cn/documentation/content-management/encryption/index.md index 07540e56..ba5f9416 100644 --- a/content/zh-cn/documentation/content-management/encryption/index.md +++ b/content/zh-cn/documentation/content-management/encryption/index.md @@ -32,14 +32,14 @@ reward: true ## 全文加密 -### 前置参数 +### Front matter -FixIt 主题提供了两个前置参数用于全文加密。 +FixIt 主题提供了两个 front matter 用于全文加密。 - **password**: _[必需]_ 加密页面内容的密码 - **message**: _[可选]_ 加密提示信息 -例如,本文的前置参数如下: +例如,本文的 front matter 如下: ```yaml title: 主题文档 - 内容加密 diff --git a/content/zh-cn/documentation/content-management/introduction/index.md b/content/zh-cn/documentation/content-management/introduction/index.md index 0af31a0c..62e66be9 100644 --- a/content/zh-cn/documentation/content-management/introduction/index.md +++ b/content/zh-cn/documentation/content-management/introduction/index.md @@ -1,4 +1,5 @@ --- +weight: 2 title: 内容管理概述 date: 2024-04-06T12:57:26+08:00 type: posts diff --git a/content/zh-cn/documentation/content-management/markdown-syntax/extended/index.md b/content/zh-cn/documentation/content-management/markdown-syntax/extended/index.md index fa894767..a3c0a52d 100644 --- a/content/zh-cn/documentation/content-management/markdown-syntax/extended/index.md +++ b/content/zh-cn/documentation/content-management/markdown-syntax/extended/index.md @@ -19,7 +19,7 @@ categories: reward: true math: true --- - + **FixIt** 主题提供了一些扩展的语法便于你撰写文章。 @@ -306,10 +306,42 @@ $$ \ce{Hg^2+ ->[I-] HgI2 ->[I-] [Hg^{II}I4]^2-} $$ > 前提是你设置了 `goldmark.parser.attribute.block` 为 `true`。 -通过在一对花括号 (`{.myclass class="class1 class2"}`) 内添加属性列表并将其放在它装饰的 Markdown 元素之后,标题元素,在同一行其后添加即可,对于块语法,在其后新一行添加。 - Hugo 支持向 Markdown 块添加属性(例如 CSS 类),例如 表格、列表、段落等。 +### 语法 + +```md +some Markdown content +{#id .class1 .class2 key1="value1" key2="value2"} +``` + +在大多数情况下,将属性列表放置在标记元素下方。对于标题和围栏代码块,将属性列表放在右侧。 + +| Element | Position of attribute list | +| :---------------- | :------------------------- | +| blockquote | bottom | +| fenced code block | right | +| heading | right | +| horizontal rule | bottom | +| image | bottom | +| list | bottom | +| paragraph | bottom | +| table | bottom | + +### 例子 + +带有 CSS 类的分割线: + +```md +--- +{.awesome-hr} +``` + +呈现的输出如下所示: + +--- +{.awesome-hr} + 带有 CSS 类的块引用: ```md @@ -324,6 +356,8 @@ Hugo 支持向 Markdown 块添加属性(例如 CSS 类),例如 表格、 > bar {#test-id .text-danger} +--- + 目前有一些限制:对于表格,你目前只能将其应用于完整表格,而对于列表,仅适用于 `ul`/`ol` 节点,例如: ```md @@ -352,7 +386,9 @@ Hugo 支持向 Markdown 块添加属性(例如 CSS 类),例如 表格、 {.text-warning} {.text-primary} -请注意,[code fences][code-fences] 中的属性必须位于开始标记之后,以及任何其他突出显示处理指令,例如: +--- + +请注意,[code fences][code-fences] 中的属性和其他高亮处理指令必须位于开始标记之,例如: ```md {?`}{?`}{?`}go {.myclass linenos=table,hl_lines=[8,"15-17"],linenostart=199} @@ -360,16 +396,11 @@ Hugo 支持向 Markdown 块添加属性(例如 CSS 类),例如 表格、 {?`}{?`}{?`} ``` -## 代码块扩展语法 - -### 代码块属性 - -可以在代码块后面添加属性,例如: +给代码块添加 `title` 属性,例如: ````markdown ```js {title="test.js"} console.log('hello FixIt!'); -``` ```` 呈现的输出效果如下: @@ -378,14 +409,13 @@ console.log('hello FixIt!'); console.log('hello FixIt!'); ``` -目前支持的属性有: - -- `title`:代码块的标题 +## 代码块扩展语法 ### 图表支持 这部分内容在 [图表支持页面][diagrams-support] 中介绍。 + [emoji-support]: {{< relref path="/guides/emoji-support" >}} [katex]: https://katex.org/ [theme-config]: {{< relref path="/documentation/getting-started/configuration#theme-configuration" >}} diff --git a/content/zh-cn/documentation/content-management/shortcodes/extended/introduction/index.md b/content/zh-cn/documentation/content-management/shortcodes/extended/introduction/index.md index 59e4d9a2..5c6eb8b5 100644 --- a/content/zh-cn/documentation/content-management/shortcodes/extended/introduction/index.md +++ b/content/zh-cn/documentation/content-management/shortcodes/extended/introduction/index.md @@ -23,7 +23,7 @@ lightgallery: true math: true reward: true --- - + **FixIt** 主题在 Hugo 内置的 shortcode 的基础上提供多个扩展的 shortcode。 @@ -78,7 +78,7 @@ This is a **right-aligned** paragraph. 链接的内容,默认值是 **href** 参数的值。 - *支持 Markdown 或者 HTML 格式。* + _支持 Markdown 或者 HTML 格式。_ - **title** _[可选]_(**第三个**位置参数) @@ -88,15 +88,19 @@ This is a **right-aligned** paragraph. 是否显示为卡片式链接,默认值 `false`。 +- **card-icon** _[可选]_ (**第五个**位置参数) {{< version 0.3.5 >}} + + 卡片式链接的图标,支持图片链接和 Font Awesome 图标,默认值是链接的 favicon。 + - **download** _[可选]_ {{< version 0.2.12 >}} HTML `a` 标签 的 `download` 属性。 -- **class** *[可选]* +- **class** _[可选]_ HTML `a` 标签 的 `class` 属性。 -- **rel** *[可选]* +- **rel** _[可选]_ HTML `a` 标签 的 `rel` 补充属性。 @@ -146,26 +150,26 @@ This is a **right-aligned** paragraph. ```go-html-template {{}} -或者 -{{}} +{{}} +{{}} ``` 呈现的输出效果如下: {{< link "https://github.com/hugo-fixit/FixIt" "FixIt Theme" "source of FixIt Theme" true >}} +{{< link "https://lruihao.cn" "Lruihao Blog" "Lruihao Blog" true "https://lruihao.cn/images/avatar.jpg" >}} +{{< link "https://lruihao.cn" "Lruihao Blog" "Lruihao Blog" true "fa-solid fa-blog" >}} 一个可下载的 `link` 示例: ```go-html-template -{{}} - +{{}} {{}} ``` 呈现的输出效果如下: {{< link href="/music/Wavelength.mp3" content="Wavelength.mp3" title="Download Wavelength.mp3" download="Wavelength.mp3" >}} - {{< link href="/music/Wavelength.mp3" content="Wavelength.mp3" title="Download Wavelength.mp3" download="Wavelength.mp3" card=true >}} ## image {#image} @@ -186,43 +190,43 @@ This is a **right-aligned** paragraph. 图片无法显示时的替代文本,默认值是 **src** 参数的值。 - *支持 Markdown 或者 HTML 格式。* + _支持 Markdown 或者 HTML 格式。_ - **caption** _[可选]_(**第三个**位置参数) 图片标题。 - *支持 Markdown 或者 HTML 格式。* + _支持 Markdown 或者 HTML 格式。_ -- **title** *[可选]* +- **title** _[可选]_ 当悬停在图片上会显示的提示。 -- **class** *[可选]* +- **class** _[可选]_ HTML `figure` 标签的 `class` 属性。 -- **src_s** *[可选]* +- **src_s** _[可选]_ 图片缩略图的 URL, 用在画廊模式中,默认值是 **src** 参数的值。 -- **src_l** *[可选]* +- **src_l** _[可选]_ 高清图片的 URL, 用在画廊模式中,默认值是 **src** 参数的值。 -- **height** *[可选]* +- **height** _[可选]_ 图片的 `height` 属性。 -- **width** *[可选]* +- **width** _[可选]_ 图片的 `width` 属性。 -- **linked** *[可选]* +- **linked** _[可选]_ 图片是否需要被链接,默认值是 `true`。 -- **rel** *[可选]* +- **rel** _[可选]_ HTML `a` 标签 的 `rel` 补充属性,仅在 **linked** 属性设置成 `true` 时有效。 @@ -244,7 +248,7 @@ This is a **right-aligned** paragraph. `admonition` shortcode 支持 **12** 种 帮助你在页面中插入提示的横幅。 -*支持 Markdown 或者 HTML 格式。* +_支持 Markdown 或者 HTML 格式。_ {{< admonition >}} 一个 **注意** 横幅 @@ -414,7 +418,7 @@ console.log('Hello FixIt!'); 呈现的输出效果如下: {{< details "**Copyright** 2022." >}} -*All pages and graphics on this web site are the property of FixIt.* +_All pages and graphics on this web site are the property of FixIt._ {{< /details >}} ## center-quote diff --git a/content/zh-cn/documentation/getting-started/configuration/index.md b/content/zh-cn/documentation/getting-started/configuration/index.md index 3b314fc7..7683e29c 100644 --- a/content/zh-cn/documentation/getting-started/configuration/index.md +++ b/content/zh-cn/documentation/getting-started/configuration/index.md @@ -982,7 +982,7 @@ enable : `bool` 是否启用 Gravatar,默认:`false`。 host -: `string` Gravatar 主机,例如:`www.gravatar.com`、`cn.gravatar.com` 等,默认:`www.gravatar.com`。 +: `string` Gravatar 主机,例如:`www.gravatar.com`、`cravatar.cn` 等,默认:`www.gravatar.com`。 style : `string` Gravatar 样式,例如:`mp`、`identicon`、`monsterid`、`wavatar`、`retro`、`robohash`、`blank` 等,默认:`""`。 @@ -1088,12 +1088,13 @@ theme `map` 开发者选项。 +选择命名为 `public_repo` 的范围以生成个人访问令牌,配置环境变量 `HUGO_PARAMS_GHTOKEN=xxx`,详见 。 + ```toml [params] [params.dev] enable = false c4u = false - githubToken = "" [params.dev.mDevtools] enable = false type = "vConsole" @@ -1105,9 +1106,6 @@ enable c4u : `bool` 是否启用检查功能,默认:`false`。 -githubToken -: `string` GitHub Token. - mDevtools : `map` 移动端开发者工具。 diff --git a/content/zh-cn/tests/markdown/index.md b/content/zh-cn/tests/markdown/index.md index 12fd7d5f..a8b08fe5 100644 --- a/content/zh-cn/tests/markdown/index.md +++ b/content/zh-cn/tests/markdown/index.md @@ -12,6 +12,7 @@ categories: lightgallery: true cacheRemoteImages: enable: true + replace: false menu: main: title: Test for Markdown rendering @@ -19,6 +20,7 @@ menu: params: icon: fa-solid fa-vial text-success --- + ## 二级标题 @@ -74,7 +76,7 @@ Ut reiciendis sit optio autem fugit porro tempora maiores debitis aliquam! Perfe ~~deleted line~~ -:truck: Feat: *migrate ~~`ibruce.siteTime`~~ to `footer.siteTime`* +:truck: Feat: _migrate ~~`ibruce.siteTime`~~ to `footer.siteTime`_ ## long text @@ -131,6 +133,11 @@ Eum a esse delectus, sit odio enim culpa! Aperiam atque tempora, quibusdam ea bl Ut eaque tenetur animi ea cumque architecto minima commodi nisi dolores sapiente. In quia hic voluptates sint porro inventore mollitia itaque nemo placeat necessitatibus! Repudiandae provident doloremque nesciunt sed! Culpa? Adipisci ipsam quae odit impedit vitae, nemo facere magnam voluptates! Praesentium laborum optio, quasi libero amet cum voluptates quod a dolores maiores nesciunt perspiciatis facilis voluptate accusantium mollitia ut autem. +## link + +{{< link "https://lruihao.cn" "Lruihao Blog" "Lruihao Blog" true "https://lruihao.cn/images/avatar.jpg" >}} +{{< link "https://lruihao.cn" "Lruihao Blog" "Lruihao Blog" true "fa-solid fa-blog" >}} + ## images ![Hugo Theme FixIt](/images/apple-devices-preview.webp) @@ -140,7 +147,7 @@ Adipisci ipsam quae odit impedit vitae, nemo facere magnam voluptates! Praesenti get remote images test: ![Lruihao](https://lruihao.cn/images/avatar.jpg?from=FixIt) -![logo](https://lruihao.cn/logo.png) +![logo](https://lruihao.cn/logo.webp) {{< image src="/images/lighthouse.jpg" caption="Lighthouse (`image`)" src_s="/images/lighthouse-small.jpg" src_l="/images/lighthouse-large.jpg" >}} diff --git a/go.mod b/go.mod index 7b4e8f29..63c560a5 100644 --- a/go.mod +++ b/go.mod @@ -4,6 +4,6 @@ go 1.20 require ( github.com/Lruihao/hugo-shortcode-sponsor-log v1.0.0 // indirect - github.com/hugo-fixit/FixIt v0.3.4 // indirect + github.com/hugo-fixit/FixIt v0.3.5-0.20240430050100-c2d168c6d166 // indirect github.com/hugo-fixit/component-projects v1.0.0 // indirect ) diff --git a/go.sum b/go.sum index 53088797..e5452925 100644 --- a/go.sum +++ b/go.sum @@ -1,6 +1,6 @@ github.com/Lruihao/hugo-shortcode-sponsor-log v1.0.0 h1:HN1tKv3xYVZRSz+xt2Wr3hLbqxi5yK6OZRecYj22yyU= github.com/Lruihao/hugo-shortcode-sponsor-log v1.0.0/go.mod h1:B0v1x6BWWp5g6w82hBfZkJNPTyTw8Cvt6ccZ7BllA20= -github.com/hugo-fixit/FixIt v0.3.4 h1:T5WBPv7D98z4eDm8rD4bRuFEdjTqerCh+XM7l8LRlQ0= -github.com/hugo-fixit/FixIt v0.3.4/go.mod h1:3XIRedrqakO7/a4ZnhE46haMRF8HgsT0N0B5j5D2iRU= +github.com/hugo-fixit/FixIt v0.3.5-0.20240430050100-c2d168c6d166 h1:iWy87CxlE08V1f1JuRXVWso/jbGEhh2unQJrLefhlic= +github.com/hugo-fixit/FixIt v0.3.5-0.20240430050100-c2d168c6d166/go.mod h1:3XIRedrqakO7/a4ZnhE46haMRF8HgsT0N0B5j5D2iRU= github.com/hugo-fixit/component-projects v1.0.0 h1:7DIf78w9AbIjagahgov3Yr3/A7LzgY+eQoCh4rXdyN0= github.com/hugo-fixit/component-projects v1.0.0/go.mod h1:nXW0R37REwpfwUD1I4RtB5QW71vw66nRyB9uEpYxr+c= diff --git a/layouts/partials/custom/profile.html b/layouts/partials/custom/profile.html index 15fa675a..62e9f00b 100644 --- a/layouts/partials/custom/profile.html +++ b/layouts/partials/custom/profile.html @@ -12,3 +12,4 @@ FixIt Demo +{{- /* EOF */ -}} diff --git a/package.json b/package.json index ba24b44f..a69cf04e 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "lint:md": "autocorrect content --lint && markdownlint-cli2 \"content/**/*.md\"", "prepare": "husky install", "build": "hugo -v --gc --minify", - "server": "hugo server -D --disableFastRender --navigateToChanged --ignoreCache --bind 0.0.0.0", + "server": "hugo server -D --disableFastRender --navigateToChanged --ignoreCache", "server:production": "npm run server -- -e production", "server:development": "cross-env HUGO_MODULE_WORKSPACE=hugo.work npm run server -- --ignoreVendorPaths \"**\"", "update:theme": "hugo mod get -u github.com/hugo-fixit/FixIt@dev && hugo mod tidy"