From 7e023448fc158e55cd3f48617096ba3656af0849 Mon Sep 17 00:00:00 2001 From: Ryan Wang Date: Mon, 14 Feb 2022 15:34:33 +0800 Subject: [PATCH] chore: use markdownlint and add pre commit hook (#41) Signed-off-by: Ryan Wang --- .husky/pre-commit | 4 + .markdownlint.json | 8 + .vscode/extensions.json | 3 + .vscode/settings.json | 5 + docs/about.md | 2 +- docs/contribution/issue.md | 6 +- docs/developer-guide/core/prepare.md | 2 +- docs/developer-guide/core/structure.md | 9 +- docs/developer-guide/theme/config-files.md | 2 +- docs/developer-guide/theme/global-variable.md | 60 +- docs/developer-guide/theme/page-variable.md | 904 ++++++------ docs/developer-guide/theme/prepare.md | 4 +- .../theme/public-template-tag.md | 16 +- docs/developer-guide/theme/template-tag.md | 1293 ++++++++--------- docs/getting-started/config.md | 8 + docs/getting-started/downloads.md | 2 +- docs/getting-started/install/docker.md | 15 +- docs/getting-started/install/linux.md | 26 +- .../install/other/docker-mysql.md | 4 +- .../install/other/oneinstack.md | 16 +- .../install/other/tencent-cloudbase.md | 7 +- docs/getting-started/install/third-party.md | 2 +- docs/getting-started/install/windows.md | 23 +- docs/getting-started/prepare.md | 6 +- docs/getting-started/upgrade.md | 8 +- docs/user-guide/config.md | 7 +- docs/user-guide/markdown.md | 40 +- package.json | 9 +- pnpm-lock.yaml | 128 +- versioned_docs/version-1.4.17/about.md | 2 +- .../version-1.4.17/contribution/issue.md | 6 +- .../developer-guide/core/code-style.md | 2 +- .../developer-guide/core/prepare.md | 2 +- .../developer-guide/core/structure.md | 9 +- .../developer-guide/theme/config-files.md | 2 +- .../developer-guide/theme/global-variable.md | 60 +- .../developer-guide/theme/page-variable.md | 904 ++++++------ .../developer-guide/theme/prepare.md | 4 +- .../theme/public-template-tag.md | 16 +- .../developer-guide/theme/template-tag.md | 1293 ++++++++--------- .../version-1.4.17/getting-started/config.md | 8 + .../getting-started/downloads.md | 2 +- .../getting-started/install/docker.md | 15 +- .../getting-started/install/linux.md | 26 +- .../install/other/docker-mysql.md | 4 +- .../install/other/oneinstack.md | 16 +- .../install/other/tencent-cloudbase.md | 7 +- .../getting-started/install/third-party.md | 2 +- .../getting-started/install/windows.md | 23 +- .../version-1.4.17/getting-started/prepare.md | 6 +- .../version-1.4.17/getting-started/upgrade.md | 8 +- versioned_docs/version-1.4.17/intro.md | 2 +- .../version-1.4.17/user-guide/config.md | 7 +- .../version-1.4.17/user-guide/markdown.md | 40 +- 54 files changed, 2630 insertions(+), 2455 deletions(-) create mode 100755 .husky/pre-commit create mode 100644 .markdownlint.json create mode 100644 .vscode/extensions.json create mode 100644 .vscode/settings.json diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 0000000..2c3af06 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,4 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +pnpm lint diff --git a/.markdownlint.json b/.markdownlint.json new file mode 100644 index 0000000..7ed9605 --- /dev/null +++ b/.markdownlint.json @@ -0,0 +1,8 @@ +{ + "MD033": false, + "MD024": false, + "MD029": false, + "MD010": { "code_blocks": true, "spaces_per_tab": 4 }, + "MD046": { "style": "fenced" }, + "line-length": false +} diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..f75b997 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,3 @@ +{ + "recommendations": ["davidanson.vscode-markdownlint"] +} diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..e261552 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "[markdown]": { + "editor.defaultFormatter": "DavidAnson.vscode-markdownlint" + } +} diff --git a/docs/about.md b/docs/about.md index 724ece6..d0eb731 100644 --- a/docs/about.md +++ b/docs/about.md @@ -13,4 +13,4 @@ description: 关于本文档站点的一些说明 如果你发现文档中有不正确或者需要添加的内容,非常欢迎参与到文档编辑当中。 ::: -当前文档的仓库地址为 [halo-dev/docs](https://github.com/halo-dev/docs) ,所以你可以 fork 此仓库,修改之后提交 `Pull request` 等待我们合并即可。 \ No newline at end of file +当前文档的仓库地址为 [halo-dev/docs](https://github.com/halo-dev/docs) ,所以你可以 fork 此仓库,修改之后提交 `Pull request` 等待我们合并即可。 diff --git a/docs/contribution/issue.md b/docs/contribution/issue.md index 83a9d3a..6ab45dd 100644 --- a/docs/contribution/issue.md +++ b/docs/contribution/issue.md @@ -9,7 +9,7 @@ description: 问题反馈渠道及指南 ## GitHub Issues -链接:https://github.com/halo-dev/halo/issues +链接: 如果你在使用过程中,遇到了一些 bug 或者需要添加某些新特性,请尽量在 GitHub Issues 进行反馈,这非常有助于我们跟踪解决此问题,您也可以很方便的接收到处理状态。 @@ -23,6 +23,6 @@ description: 问题反馈渠道及指南 ## Halo 官方社区 -链接:https://bbs.halo.run +链接: -此平台主要目的用于与其他 Halo 用户进行交流。但如果您对 GitHub 不是很熟悉或者没有账号,您也可以在此平台进行反馈。 \ No newline at end of file +此平台主要目的用于与其他 Halo 用户进行交流。但如果您对 GitHub 不是很熟悉或者没有账号,您也可以在此平台进行反馈。 diff --git a/docs/developer-guide/core/prepare.md b/docs/developer-guide/core/prepare.md index efa091b..7c07c48 100644 --- a/docs/developer-guide/core/prepare.md +++ b/docs/developer-guide/core/prepare.md @@ -9,7 +9,7 @@ description: 开发环境的一些说明 2. 工具:[Gradle](https://gradle.org/),[Lombok](https://projectlombok.org/) 插件 3. JDK:`11+` -> 推荐 IntelliJ IDEA 社区版(开源免费)https://github.com/JetBrains/intellij-community +> 推荐 IntelliJ IDEA 社区版(开源免费) `Halo` 项目使用了 `Lombok`,运行 `Halo` 之前请检查 `IDE` 是否已经安装好了 `Lombok` 插件。 diff --git a/docs/developer-guide/core/structure.md b/docs/developer-guide/core/structure.md index 6dbb1c5..a080fdc 100644 --- a/docs/developer-guide/core/structure.md +++ b/docs/developer-guide/core/structure.md @@ -31,11 +31,6 @@ description: Halo 项目的构成 在开发的时候,希望大家能够在 `~/halo-dev/application.yml` 中进行添加自定义配置。当然后面也会讲到如何用`运行参数` 和 `VM options` 进行控制配置,届时可根据具体情况进行选择。 - -
-
- +:::warning 开发的时候,我们不建议直接更改`项目源码`中的所包含的`配置文件`,包括 `application.yml`、`application-dev.yml`、`application-test.yml` 和 `application-user.yml`。 - -
-
\ No newline at end of file +::: diff --git a/docs/developer-guide/theme/config-files.md b/docs/developer-guide/theme/config-files.md index b812f1d..18f8ee4 100644 --- a/docs/developer-guide/theme/config-files.md +++ b/docs/developer-guide/theme/config-files.md @@ -258,4 +258,4 @@ general: ``` -更多实例可参考:。 \ No newline at end of file +更多实例可参考:。 diff --git a/docs/developer-guide/theme/global-variable.md b/docs/developer-guide/theme/global-variable.md index 82ba72e..7ff661e 100644 --- a/docs/developer-guide/theme/global-variable.md +++ b/docs/developer-guide/theme/global-variable.md @@ -5,16 +5,15 @@ description: 系统提供的一些全局变量 ## 博客地址 -``` +```html ${blog_url!} ``` 此变量与后台博客设置中的 `博客地址` 相对应。 - ## 网站根路径 -``` +```html ${context!} ``` @@ -24,12 +23,12 @@ ${context!} 假设,我设置的 `博客地址` 为 `https://halo.run`,那么: -- 全局绝对路径为开启的状态下:https://halo.run/ +- 全局绝对路径为开启的状态下: - 全局绝对路径为关闭的状态下:/ ## 主题资源根路径 -``` +```html ${theme_base!} ``` @@ -37,7 +36,7 @@ ${theme_base!} 举个例子,你当前开发的主题为 `anatole`,当你要获取主题下 `css/style.css` 这个文件的路径,那么: -``` +```html ${theme_base!}/css/style.css ``` @@ -45,25 +44,25 @@ ${theme_base!}/css/style.css 主题名称: -``` +```html ${theme.name!} ``` 主题 git 仓库地址: -``` +```html ${theme.repo!} ``` 主题版本号: -``` +```html ${theme.version!} ``` ## 博客标题 -``` +```html ${blog_title!} ``` @@ -71,7 +70,7 @@ ${blog_title!} ## 博客 Logo -``` +```html ${blog_logo!} ``` @@ -79,7 +78,7 @@ ${blog_logo!} ## Halo 版本 -``` +```html ${version!} ``` @@ -89,37 +88,37 @@ ${version!} 昵称: -``` +```html ${user.nickname!} ``` 邮箱地址: -``` +```html ${user.email!} ``` 描述: -``` +```html ${user.description!} ``` 头像地址: -``` +```html ${user.avatar!} ``` 上次登录时间: -``` +```html ${user.expireTime!} ``` ## SEO 关键词 -``` +```html ${meta_keywords!} ``` @@ -132,16 +131,15 @@ ${meta_keywords!} ## SEO 描述 -``` +```html ${meta_description!} ``` 需要注意的是,虽然这个变量在任何页面都可以使用,但是其值可能在不同的页面是不一样的。会根据用户的设置,生成对应的值。 - ## RSS 2.0 订阅地址 -``` +```html ${rss_url!} ``` @@ -149,7 +147,7 @@ ${rss_url!} ## Atom 格式的订阅地址 -``` +```html ${atom_url!} ``` @@ -157,7 +155,7 @@ ${atom_url!} ## Xml 格式的网站地图地址 -``` +```html ${sitemap_xml_url!} ``` @@ -165,7 +163,7 @@ ${sitemap_xml_url!} ## HTML 格式的网站地图地址 -``` +```html ${sitemap_html_url!} ``` @@ -173,7 +171,7 @@ ${sitemap_html_url!} ## 友情链接页面地址 -``` +```html ${links_url!} ``` @@ -184,7 +182,7 @@ ${links_url!} ## 图库页面地址 -``` +```html ${photos_url!} ``` @@ -195,7 +193,7 @@ ${photos_url!} ## 日志页面地址 -``` +```html ${journals_url!} ``` @@ -206,7 +204,7 @@ ${journals_url!} ## 文章归档页面地址 -``` +```html ${archives_url!} ``` @@ -217,7 +215,7 @@ ${archives_url!} ## 分类列表页面地址 -``` +```html ${categories_url!} ``` @@ -228,7 +226,7 @@ ${categories_url!} ## 标签列表页面地址 -``` +```html ${tags_url!} ``` @@ -258,6 +256,6 @@ ${tags_url!} ```html <#if is_index??> - 当前页面是首页 + 当前页面是首页 ``` diff --git a/docs/developer-guide/theme/page-variable.md b/docs/developer-guide/theme/page-variable.md index a2d8320..555be22 100644 --- a/docs/developer-guide/theme/page-variable.md +++ b/docs/developer-guide/theme/page-variable.md @@ -21,69 +21,69 @@ description: 每个页面所返回的变量 ```json [{ - "content": [{ - "categories": [{ - "createTime": "2020-10-13T13:23:39.143Z", - "description": "string", - "fullPath": "string", - "id": 0, - "name": "string", - "parentId": 0, - "slug": "string", - "thumbnail": "string" - }], - "commentCount": 0, - "createTime": "2020-10-13T13:23:39.143Z", - "disallowComment": true, - "editTime": "2020-10-13T13:23:39.143Z", - "editorType": "MARKDOWN", - "fullPath": "string", - "id": 0, - "likes": 0, - "metaDescription": "string", - "metaKeywords": "string", - "metas": {}, - "password": "string", - "slug": "string", - "status": "PUBLISHED", - "summary": "string", - "tags": [{ - "createTime": "2020-10-13T13:23:39.143Z", - "fullPath": "string", - "id": 0, - "name": "string", - "slug": "string", - "thumbnail": "string" - }], - "template": "string", - "thumbnail": "string", - "title": "string", - "topPriority": 0, - "topped": true, - "updateTime": "2020-10-13T13:23:39.143Z", - "visits": 0, - "wordCount": 0 - }], - "empty": true, - "first": true, - "last": true, - "number": 0, - "numberOfElements": 0, - "pageable": { - "page": 0, - "size": 0, - "sort": [ - "string" - ] - }, - "size": 0, - "sort": { - "sort": [ - "string" - ] - }, - "totalElements": 0, - "totalPages": 0 + "content": [{ + "categories": [{ + "createTime": "2020-10-13T13:23:39.143Z", + "description": "string", + "fullPath": "string", + "id": 0, + "name": "string", + "parentId": 0, + "slug": "string", + "thumbnail": "string" + }], + "commentCount": 0, + "createTime": "2020-10-13T13:23:39.143Z", + "disallowComment": true, + "editTime": "2020-10-13T13:23:39.143Z", + "editorType": "MARKDOWN", + "fullPath": "string", + "id": 0, + "likes": 0, + "metaDescription": "string", + "metaKeywords": "string", + "metas": {}, + "password": "string", + "slug": "string", + "status": "PUBLISHED", + "summary": "string", + "tags": [{ + "createTime": "2020-10-13T13:23:39.143Z", + "fullPath": "string", + "id": 0, + "name": "string", + "slug": "string", + "thumbnail": "string" + }], + "template": "string", + "thumbnail": "string", + "title": "string", + "topPriority": 0, + "topped": true, + "updateTime": "2020-10-13T13:23:39.143Z", + "visits": 0, + "wordCount": 0 + }], + "empty": true, + "first": true, + "last": true, + "number": 0, + "numberOfElements": 0, + "pageable": { + "page": 0, + "size": 0, + "sort": [ + "string" + ] + }, + "size": 0, + "sort": { + "sort": [ + "string" + ] + }, + "totalElements": 0, + "totalPages": 0 }] ``` @@ -93,7 +93,7 @@ description: 每个页面所返回的变量 ```html <#list posts.content as post> - ${post.title!} + ${post.title!} ``` @@ -299,7 +299,7 @@ ${prevPost.attribute} ```html <#if prevPost??> - 上一篇:${prevPost.title!} + 上一篇:${prevPost.title!} ``` @@ -397,7 +397,7 @@ ${nextPost.attribute} ```html <#if nextPost??> - 下一篇:${nextPost.title!} + 下一篇:${nextPost.title!} ``` @@ -421,15 +421,15 @@ ${nextPost.attribute} ```json [{ - "createTime": "2021-02-25T13:32:11.189Z", - "description": "string", - "fullPath": "string", - "id": 0, - "name": "string", - "parentId": 0, - "password": "string", - "slug": "string", - "thumbnail": "string" + "createTime": "2021-02-25T13:32:11.189Z", + "description": "string", + "fullPath": "string", + "id": 0, + "name": "string", + "parentId": 0, + "password": "string", + "slug": "string", + "thumbnail": "string" }] ``` @@ -439,7 +439,7 @@ ${nextPost.attribute} ```html <#list categories as category> - ${category.name!} + ${category.name!} ``` @@ -464,12 +464,12 @@ ${nextPost.attribute} ```json [{ - "createTime": "2021-02-25T13:34:48.779Z", - "fullPath": "string", - "id": 0, - "name": "string", - "slug": "string", - "thumbnail": "string" + "createTime": "2021-02-25T13:34:48.779Z", + "fullPath": "string", + "id": 0, + "name": "string", + "slug": "string", + "thumbnail": "string" }] ``` @@ -479,7 +479,7 @@ ${nextPost.attribute} ```html <#list tags as tag> - ${tag.name!} + ${tag.name!} ``` @@ -635,69 +635,69 @@ ${metas.key} ```json [{ - "content": [{ - "categories": [{ - "createTime": "2020-10-13T13:23:39.143Z", - "description": "string", - "fullPath": "string", - "id": 0, - "name": "string", - "parentId": 0, - "slug": "string", - "thumbnail": "string" - }], - "commentCount": 0, - "createTime": "2020-10-13T13:23:39.143Z", - "disallowComment": true, - "editTime": "2020-10-13T13:23:39.143Z", - "editorType": "MARKDOWN", - "fullPath": "string", - "id": 0, - "likes": 0, - "metaDescription": "string", - "metaKeywords": "string", - "metas": {}, - "password": "string", - "slug": "string", - "status": "PUBLISHED", - "summary": "string", - "tags": [{ - "createTime": "2020-10-13T13:23:39.143Z", - "fullPath": "string", - "id": 0, - "name": "string", - "slug": "string", - "thumbnail": "string" - }], - "template": "string", - "thumbnail": "string", - "title": "string", - "topPriority": 0, - "topped": true, - "updateTime": "2020-10-13T13:23:39.143Z", - "visits": 0, - "wordCount": 0 - }], - "empty": true, - "first": true, - "last": true, - "number": 0, - "numberOfElements": 0, - "pageable": { - "page": 0, - "size": 0, - "sort": [ - "string" - ] - }, - "size": 0, - "sort": { - "sort": [ - "string" - ] - }, - "totalElements": 0, - "totalPages": 0 + "content": [{ + "categories": [{ + "createTime": "2020-10-13T13:23:39.143Z", + "description": "string", + "fullPath": "string", + "id": 0, + "name": "string", + "parentId": 0, + "slug": "string", + "thumbnail": "string" + }], + "commentCount": 0, + "createTime": "2020-10-13T13:23:39.143Z", + "disallowComment": true, + "editTime": "2020-10-13T13:23:39.143Z", + "editorType": "MARKDOWN", + "fullPath": "string", + "id": 0, + "likes": 0, + "metaDescription": "string", + "metaKeywords": "string", + "metas": {}, + "password": "string", + "slug": "string", + "status": "PUBLISHED", + "summary": "string", + "tags": [{ + "createTime": "2020-10-13T13:23:39.143Z", + "fullPath": "string", + "id": 0, + "name": "string", + "slug": "string", + "thumbnail": "string" + }], + "template": "string", + "thumbnail": "string", + "title": "string", + "topPriority": 0, + "topped": true, + "updateTime": "2020-10-13T13:23:39.143Z", + "visits": 0, + "wordCount": 0 + }], + "empty": true, + "first": true, + "last": true, + "number": 0, + "numberOfElements": 0, + "pageable": { + "page": 0, + "size": 0, + "sort": [ + "string" + ] + }, + "size": 0, + "sort": { + "sort": [ + "string" + ] + }, + "totalElements": 0, + "totalPages": 0 }] ``` @@ -707,7 +707,7 @@ ${metas.key} ```html <#list posts.content as post> - ${post.title!} + ${post.title!} ``` @@ -733,62 +733,62 @@ ${metas.key} ```json { - "content": [{ - "posts": [{ - "categories": [{ - "createTime": "2021-03-07T05:45:06.271Z", - "description": "string", - "fullPath": "string", - "id": 0, - "name": "string", - "parentId": 0, - "password": "string", - "slug": "string", - "thumbnail": "string" - }], - "commentCount": 0, - "createTime": "2021-03-07T05:45:06.271Z", - "disallowComment": true, - "editTime": "2021-03-07T05:45:06.271Z", - "editorType": "MARKDOWN", - "fullPath": "string", - "id": 0, - "likes": 0, - "metaDescription": "string", - "metaKeywords": "string", - "metas": {}, - "password": "string", - "slug": "string", - "status": "DRAFT", - "summary": "string", - "tags": [{ - "createTime": "2021-03-07T05:45:06.271Z", - "fullPath": "string", - "id": 0, - "name": "string", - "slug": "string", - "thumbnail": "string" - }], - "template": "string", - "thumbnail": "string", - "title": "string", - "topPriority": 0, - "topped": true, - "updateTime": "2021-03-07T05:45:06.271Z", - "visits": 0, - "wordCount": 0 - }], - "year": 0 - }], - "hasContent": true, - "hasNext": true, - "hasPrevious": true, - "isEmpty": true, - "isFirst": true, - "page": 0, - "pages": 0, - "rpp": 0, - "total": 0 + "content": [{ + "posts": [{ + "categories": [{ + "createTime": "2021-03-07T05:45:06.271Z", + "description": "string", + "fullPath": "string", + "id": 0, + "name": "string", + "parentId": 0, + "password": "string", + "slug": "string", + "thumbnail": "string" + }], + "commentCount": 0, + "createTime": "2021-03-07T05:45:06.271Z", + "disallowComment": true, + "editTime": "2021-03-07T05:45:06.271Z", + "editorType": "MARKDOWN", + "fullPath": "string", + "id": 0, + "likes": 0, + "metaDescription": "string", + "metaKeywords": "string", + "metas": {}, + "password": "string", + "slug": "string", + "status": "DRAFT", + "summary": "string", + "tags": [{ + "createTime": "2021-03-07T05:45:06.271Z", + "fullPath": "string", + "id": 0, + "name": "string", + "slug": "string", + "thumbnail": "string" + }], + "template": "string", + "thumbnail": "string", + "title": "string", + "topPriority": 0, + "topped": true, + "updateTime": "2021-03-07T05:45:06.271Z", + "visits": 0, + "wordCount": 0 + }], + "year": 0 + }], + "hasContent": true, + "hasNext": true, + "hasPrevious": true, + "isEmpty": true, + "isFirst": true, + "page": 0, + "pages": 0, + "rpp": 0, + "total": 0 } ``` @@ -800,7 +800,7 @@ ${metas.key} <#list archives.content as archive>

${archive.year?c}

<#list archive.posts as post> - ${post.title!} + ${post.title!} ``` @@ -842,69 +842,69 @@ ${metas.key} ```json [{ - "content": [{ - "categories": [{ - "createTime": "2020-10-13T13:23:39.143Z", - "description": "string", - "fullPath": "string", - "id": 0, - "name": "string", - "parentId": 0, - "slug": "string", - "thumbnail": "string" - }], - "commentCount": 0, - "createTime": "2020-10-13T13:23:39.143Z", - "disallowComment": true, - "editTime": "2020-10-13T13:23:39.143Z", - "editorType": "MARKDOWN", - "fullPath": "string", - "id": 0, - "likes": 0, - "metaDescription": "string", - "metaKeywords": "string", - "metas": {}, - "password": "string", - "slug": "string", - "status": "PUBLISHED", - "summary": "string", - "tags": [{ - "createTime": "2020-10-13T13:23:39.143Z", - "fullPath": "string", - "id": 0, - "name": "string", - "slug": "string", - "thumbnail": "string" - }], - "template": "string", - "thumbnail": "string", - "title": "string", - "topPriority": 0, - "topped": true, - "updateTime": "2020-10-13T13:23:39.143Z", - "visits": 0, - "wordCount": 0 - }], - "empty": true, - "first": true, - "last": true, - "number": 0, - "numberOfElements": 0, - "pageable": { - "page": 0, - "size": 0, - "sort": [ - "string" - ] - }, - "size": 0, - "sort": { - "sort": [ - "string" - ] - }, - "totalElements": 0, - "totalPages": 0 + "content": [{ + "categories": [{ + "createTime": "2020-10-13T13:23:39.143Z", + "description": "string", + "fullPath": "string", + "id": 0, + "name": "string", + "parentId": 0, + "slug": "string", + "thumbnail": "string" + }], + "commentCount": 0, + "createTime": "2020-10-13T13:23:39.143Z", + "disallowComment": true, + "editTime": "2020-10-13T13:23:39.143Z", + "editorType": "MARKDOWN", + "fullPath": "string", + "id": 0, + "likes": 0, + "metaDescription": "string", + "metaKeywords": "string", + "metas": {}, + "password": "string", + "slug": "string", + "status": "PUBLISHED", + "summary": "string", + "tags": [{ + "createTime": "2020-10-13T13:23:39.143Z", + "fullPath": "string", + "id": 0, + "name": "string", + "slug": "string", + "thumbnail": "string" + }], + "template": "string", + "thumbnail": "string", + "title": "string", + "topPriority": 0, + "topped": true, + "updateTime": "2020-10-13T13:23:39.143Z", + "visits": 0, + "wordCount": 0 + }], + "empty": true, + "first": true, + "last": true, + "number": 0, + "numberOfElements": 0, + "pageable": { + "page": 0, + "size": 0, + "sort": [ + "string" + ] + }, + "size": 0, + "sort": { + "sort": [ + "string" + ] + }, + "totalElements": 0, + "totalPages": 0 }] ``` @@ -914,7 +914,7 @@ ${metas.key} ```html <#list posts.content as post> - ${post.title!} + ${post.title!} ``` @@ -940,15 +940,15 @@ ${category.attribute} ```json { - "createTime": "2020-10-11T05:59:40.622Z", - "description": "string", - "fullPath": "string", - "id": 0, - "name": "string", - "parentId": 0, - "slug": "string", - "thumbnail": "string", - "postCount": 0 + "createTime": "2020-10-11T05:59:40.622Z", + "description": "string", + "fullPath": "string", + "id": 0, + "name": "string", + "parentId": 0, + "slug": "string", + "thumbnail": "string", + "postCount": 0 } ``` @@ -988,69 +988,69 @@ ${category.attribute} ```json [{ - "content": [{ - "categories": [{ - "createTime": "2020-10-13T13:23:39.143Z", - "description": "string", - "fullPath": "string", - "id": 0, - "name": "string", - "parentId": 0, - "slug": "string", - "thumbnail": "string" - }], - "commentCount": 0, - "createTime": "2020-10-13T13:23:39.143Z", - "disallowComment": true, - "editTime": "2020-10-13T13:23:39.143Z", - "editorType": "MARKDOWN", - "fullPath": "string", - "id": 0, - "likes": 0, - "metaDescription": "string", - "metaKeywords": "string", - "metas": {}, - "password": "string", - "slug": "string", - "status": "PUBLISHED", - "summary": "string", - "tags": [{ - "createTime": "2020-10-13T13:23:39.143Z", - "fullPath": "string", - "id": 0, - "name": "string", - "slug": "string", - "thumbnail": "string" - }], - "template": "string", - "thumbnail": "string", - "title": "string", - "topPriority": 0, - "topped": true, - "updateTime": "2020-10-13T13:23:39.143Z", - "visits": 0, - "wordCount": 0 - }], - "empty": true, - "first": true, - "last": true, - "number": 0, - "numberOfElements": 0, - "pageable": { - "page": 0, - "size": 0, - "sort": [ - "string" - ] - }, - "size": 0, - "sort": { - "sort": [ - "string" - ] - }, - "totalElements": 0, - "totalPages": 0 + "content": [{ + "categories": [{ + "createTime": "2020-10-13T13:23:39.143Z", + "description": "string", + "fullPath": "string", + "id": 0, + "name": "string", + "parentId": 0, + "slug": "string", + "thumbnail": "string" + }], + "commentCount": 0, + "createTime": "2020-10-13T13:23:39.143Z", + "disallowComment": true, + "editTime": "2020-10-13T13:23:39.143Z", + "editorType": "MARKDOWN", + "fullPath": "string", + "id": 0, + "likes": 0, + "metaDescription": "string", + "metaKeywords": "string", + "metas": {}, + "password": "string", + "slug": "string", + "status": "PUBLISHED", + "summary": "string", + "tags": [{ + "createTime": "2020-10-13T13:23:39.143Z", + "fullPath": "string", + "id": 0, + "name": "string", + "slug": "string", + "thumbnail": "string" + }], + "template": "string", + "thumbnail": "string", + "title": "string", + "topPriority": 0, + "topped": true, + "updateTime": "2020-10-13T13:23:39.143Z", + "visits": 0, + "wordCount": 0 + }], + "empty": true, + "first": true, + "last": true, + "number": 0, + "numberOfElements": 0, + "pageable": { + "page": 0, + "size": 0, + "sort": [ + "string" + ] + }, + "size": 0, + "sort": { + "sort": [ + "string" + ] + }, + "totalElements": 0, + "totalPages": 0 }] ``` @@ -1060,7 +1060,7 @@ ${category.attribute} ```html <#list posts.content as post> - ${post.title!} + ${post.title!} ``` @@ -1086,12 +1086,12 @@ ${tag.attribute} ```json { - "createTime": "2020-10-11T06:14:30.595Z", - "fullPath": "string", - "id": 0, - "name": "string", - "slug": "string", - "thumbnail": "string" + "createTime": "2020-10-11T06:14:30.595Z", + "fullPath": "string", + "id": 0, + "name": "string", + "slug": "string", + "thumbnail": "string" } ``` @@ -1143,69 +1143,69 @@ ${keyword!} ```json [{ - "content": [{ - "categories": [{ - "createTime": "2020-10-13T13:23:39.143Z", - "description": "string", - "fullPath": "string", - "id": 0, - "name": "string", - "parentId": 0, - "slug": "string", - "thumbnail": "string" - }], - "commentCount": 0, - "createTime": "2020-10-13T13:23:39.143Z", - "disallowComment": true, - "editTime": "2020-10-13T13:23:39.143Z", - "editorType": "MARKDOWN", - "fullPath": "string", - "id": 0, - "likes": 0, - "metaDescription": "string", - "metaKeywords": "string", - "metas": {}, - "password": "string", - "slug": "string", - "status": "PUBLISHED", - "summary": "string", - "tags": [{ - "createTime": "2020-10-13T13:23:39.143Z", - "fullPath": "string", - "id": 0, - "name": "string", - "slug": "string", - "thumbnail": "string" - }], - "template": "string", - "thumbnail": "string", - "title": "string", - "topPriority": 0, - "topped": true, - "updateTime": "2020-10-13T13:23:39.143Z", - "visits": 0, - "wordCount": 0 - }], - "empty": true, - "first": true, - "last": true, - "number": 0, - "numberOfElements": 0, - "pageable": { - "page": 0, - "size": 0, - "sort": [ - "string" - ] - }, - "size": 0, - "sort": { - "sort": [ - "string" - ] - }, - "totalElements": 0, - "totalPages": 0 + "content": [{ + "categories": [{ + "createTime": "2020-10-13T13:23:39.143Z", + "description": "string", + "fullPath": "string", + "id": 0, + "name": "string", + "parentId": 0, + "slug": "string", + "thumbnail": "string" + }], + "commentCount": 0, + "createTime": "2020-10-13T13:23:39.143Z", + "disallowComment": true, + "editTime": "2020-10-13T13:23:39.143Z", + "editorType": "MARKDOWN", + "fullPath": "string", + "id": 0, + "likes": 0, + "metaDescription": "string", + "metaKeywords": "string", + "metas": {}, + "password": "string", + "slug": "string", + "status": "PUBLISHED", + "summary": "string", + "tags": [{ + "createTime": "2020-10-13T13:23:39.143Z", + "fullPath": "string", + "id": 0, + "name": "string", + "slug": "string", + "thumbnail": "string" + }], + "template": "string", + "thumbnail": "string", + "title": "string", + "topPriority": 0, + "topped": true, + "updateTime": "2020-10-13T13:23:39.143Z", + "visits": 0, + "wordCount": 0 + }], + "empty": true, + "first": true, + "last": true, + "number": 0, + "numberOfElements": 0, + "pageable": { + "page": 0, + "size": 0, + "sort": [ + "string" + ] + }, + "size": 0, + "sort": { + "sort": [ + "string" + ] + }, + "totalElements": 0, + "totalPages": 0 }] ``` @@ -1215,7 +1215,7 @@ ${keyword!} ```html <#list posts.content as post> - ${post.title!} + ${post.title!} ``` @@ -1251,25 +1251,25 @@ ${keyword!} ```json { - "content": [{ - "description": "string", - "id": 0, - "location": "string", - "name": "string", - "takeTime": "2021-03-07T05:28:12.352Z", - "team": "string", - "thumbnail": "string", - "url": "string" - }], - "hasContent": true, - "hasNext": true, - "hasPrevious": true, - "isEmpty": true, - "isFirst": true, - "page": 0, - "pages": 0, - "rpp": 0, - "total": 0 + "content": [{ + "description": "string", + "id": 0, + "location": "string", + "name": "string", + "takeTime": "2021-03-07T05:28:12.352Z", + "team": "string", + "thumbnail": "string", + "url": "string" + }], + "hasContent": true, + "hasNext": true, + "hasPrevious": true, + "isEmpty": true, + "isFirst": true, + "page": 0, + "pages": 0, + "rpp": 0, + "total": 0 } ``` @@ -1277,7 +1277,7 @@ ${keyword!} ```html <#list photos.content as photo> - ${photo.description!} + ${photo.description!} ``` @@ -1307,24 +1307,24 @@ ${keyword!} ```json { - "content": [{ - "commentCount": 0, - "content": "string", - "createTime": "2021-03-07T05:32:06.365Z", - "id": 0, - "likes": 0, - "sourceContent": "string", - "type": "INTIMATE" - }], - "hasContent": true, - "hasNext": true, - "hasPrevious": true, - "isEmpty": true, - "isFirst": true, - "page": 0, - "pages": 0, - "rpp": 0, - "total": 0 + "content": [{ + "commentCount": 0, + "content": "string", + "createTime": "2021-03-07T05:32:06.365Z", + "id": 0, + "likes": 0, + "sourceContent": "string", + "type": "INTIMATE" + }], + "hasContent": true, + "hasNext": true, + "hasPrevious": true, + "isEmpty": true, + "isFirst": true, + "page": 0, + "pages": 0, + "rpp": 0, + "total": 0 } ``` @@ -1334,7 +1334,7 @@ ${keyword!}
    <#list journals.content as journal>
  • - ${journal.createTime?string('yyyy年MM月dd日')}:${journal.content!} + ${journal.createTime?string('yyyy年MM月dd日')}:${journal.content!}
@@ -1345,10 +1345,10 @@ ${keyword!} ```html
  • - 2021年3月7日:内容1 + 2021年3月7日:内容1
  • - 2021年3月7日:内容2 + 2021年3月7日:内容2
``` diff --git a/docs/developer-guide/theme/prepare.md b/docs/developer-guide/theme/prepare.md index 9941028..a7e3b19 100644 --- a/docs/developer-guide/theme/prepare.md +++ b/docs/developer-guide/theme/prepare.md @@ -44,7 +44,7 @@ Halo 的运行可参考上述 [系统开发](/developer-guide/core/prepare), > 为了让开发更加规范,我们推荐使用以下的目录结构。 -``` +```txt ├── module // 公共模板目录 │   ├── comment.ftl // 比如:评论模板 │   ├── layout.ftl // 比如:布局模板 @@ -73,4 +73,4 @@ Halo 的运行可参考上述 [系统开发](/developer-guide/core/prepare), ├── screenshot.png // 主题预览图 ├── settings.yaml // 主题选项配置文件 └── theme.yaml // 主题描述文件 -``` \ No newline at end of file +``` diff --git a/docs/developer-guide/theme/public-template-tag.md b/docs/developer-guide/theme/public-template-tag.md index 98be161..515a72a 100644 --- a/docs/developer-guide/theme/public-template-tag.md +++ b/docs/developer-guide/theme/public-template-tag.md @@ -7,7 +7,7 @@ description: 系统提供的一些宏模板 ## 公共 head 模板 -> 需要注意的是,为了保证系统功能的完整性,我们强制要求在每个页面的 `` 标签下必须包含此模板。 +> 需要注意的是,为了保证系统功能的完整性,我们强制要求在每个页面的 `` 标签下必须包含此模板。 ```html <@global.head /> @@ -27,14 +27,12 @@ description: 系统提供的一些宏模板 ## 公共底部 -> 需要注意的是,为了保证系统功能的完整性,我们强制要求在每个页面的尾部必须包含此模板。 - +> 需要注意的是,为了保证系统功能的完整性,我们强制要求在每个页面的尾部必须包含此模板。 ```html <@global.footer /> ``` - 等同于: ```html @@ -51,7 +49,6 @@ description: 系统提供的一些宏模板 x 年前/x 个月前/x 天前/昨天/x 小时前/x 分钟前/x 秒前/刚刚 ``` - ## 评论模块 ```html @@ -73,23 +70,22 @@ x 年前/x 个月前/x 天前/昨天/x 小时前/x 分钟前/x 秒前/刚刚 - target:post / sheet / journal 对象 - type:评论类型,可为:post / sheet / journal - 例子: 在文章页面(post.ftl or post_xxx.ftl): -``` +```html <@global.comment target=post type="post" /> ``` 在自定义页面(sheet.ftl or post_sheet.ftl): -``` +```html <@global.comment target=sheet type="sheet" /> ``` 在日志页面(journals.ftl): -``` +```html <@global.comment target=journal type="journal" /> -``` \ No newline at end of file +``` diff --git a/docs/developer-guide/theme/template-tag.md b/docs/developer-guide/theme/template-tag.md index d798a2e..123e988 100644 --- a/docs/developer-guide/theme/template-tag.md +++ b/docs/developer-guide/theme/template-tag.md @@ -30,47 +30,47 @@ posts: ```json [{ - "categories": [{ - "createTime": "2020-10-11T05:22:08.264Z", - "description": "string", - "fullPath": "string", - "id": 0, - "name": "string", - "parentId": 0, - "slug": "string", - "thumbnail": "string" - }], - "commentCount": 0, - "createTime": "2020-10-11T05:22:08.264Z", - "disallowComment": true, - "editTime": "2020-10-11T05:22:08.264Z", - "editorType": "MARKDOWN", - "fullPath": "string", - "id": 0, - "likes": 0, - "metaDescription": "string", - "metaKeywords": "string", - "metas": {}, - "password": "string", - "slug": "string", - "status": "PUBLISHED", - "summary": "string", - "tags": [{ - "createTime": "2020-10-11T05:22:08.264Z", - "fullPath": "string", - "id": 0, - "name": "string", - "slug": "string", - "thumbnail": "string" - }], - "template": "string", - "thumbnail": "string", - "title": "string", - "topPriority": 0, - "topped": true, - "updateTime": "2020-10-11T05:22:08.264Z", - "visits": 0, - "wordCount": 0 + "categories": [{ + "createTime": "2020-10-11T05:22:08.264Z", + "description": "string", + "fullPath": "string", + "id": 0, + "name": "string", + "parentId": 0, + "slug": "string", + "thumbnail": "string" + }], + "commentCount": 0, + "createTime": "2020-10-11T05:22:08.264Z", + "disallowComment": true, + "editTime": "2020-10-11T05:22:08.264Z", + "editorType": "MARKDOWN", + "fullPath": "string", + "id": 0, + "likes": 0, + "metaDescription": "string", + "metaKeywords": "string", + "metas": {}, + "password": "string", + "slug": "string", + "status": "PUBLISHED", + "summary": "string", + "tags": [{ + "createTime": "2020-10-11T05:22:08.264Z", + "fullPath": "string", + "id": 0, + "name": "string", + "slug": "string", + "thumbnail": "string" + }], + "template": "string", + "thumbnail": "string", + "title": "string", + "topPriority": 0, + "topped": true, + "updateTime": "2020-10-11T05:22:08.264Z", + "visits": 0, + "wordCount": 0 }] ``` @@ -146,50 +146,50 @@ archives: ```json [{ - "posts": [{ - "categories": [{ - "createTime": "2020-10-11T05:30:45.245Z", - "description": "string", - "fullPath": "string", - "id": 0, - "name": "string", - "parentId": 0, - "slug": "string", - "thumbnail": "string" - }], - "commentCount": 0, - "createTime": "2020-10-11T05:30:45.245Z", - "disallowComment": true, - "editTime": "2020-10-11T05:30:45.245Z", - "editorType": "MARKDOWN", - "fullPath": "string", - "id": 0, - "likes": 0, - "metaDescription": "string", - "metaKeywords": "string", - "metas": {}, - "password": "string", - "slug": "string", - "status": "PUBLISHED", - "summary": "string", - "tags": [{ - "createTime": "2020-10-11T05:30:45.245Z", - "fullPath": "string", - "id": 0, - "name": "string", - "slug": "string", - "thumbnail": "string" - }], - "template": "string", - "thumbnail": "string", - "title": "string", - "topPriority": 0, - "topped": true, - "updateTime": "2020-10-11T05:30:45.245Z", - "visits": 0, - "wordCount": 0 - }], - "year": 0 + "posts": [{ + "categories": [{ + "createTime": "2020-10-11T05:30:45.245Z", + "description": "string", + "fullPath": "string", + "id": 0, + "name": "string", + "parentId": 0, + "slug": "string", + "thumbnail": "string" + }], + "commentCount": 0, + "createTime": "2020-10-11T05:30:45.245Z", + "disallowComment": true, + "editTime": "2020-10-11T05:30:45.245Z", + "editorType": "MARKDOWN", + "fullPath": "string", + "id": 0, + "likes": 0, + "metaDescription": "string", + "metaKeywords": "string", + "metas": {}, + "password": "string", + "slug": "string", + "status": "PUBLISHED", + "summary": "string", + "tags": [{ + "createTime": "2020-10-11T05:30:45.245Z", + "fullPath": "string", + "id": 0, + "name": "string", + "slug": "string", + "thumbnail": "string" + }], + "template": "string", + "thumbnail": "string", + "title": "string", + "topPriority": 0, + "topped": true, + "updateTime": "2020-10-11T05:30:45.245Z", + "visits": 0, + "wordCount": 0 + }], + "year": 0 }] ``` @@ -253,51 +253,51 @@ archives: ```json [{ - "month": 0, - "posts": [{ - "categories": [{ - "createTime": "2020-10-11T05:35:01.835Z", - "description": "string", - "fullPath": "string", - "id": 0, - "name": "string", - "parentId": 0, - "slug": "string", - "thumbnail": "string" - }], - "commentCount": 0, - "createTime": "2020-10-11T05:35:01.835Z", - "disallowComment": true, - "editTime": "2020-10-11T05:35:01.835Z", - "editorType": "MARKDOWN", - "fullPath": "string", - "id": 0, - "likes": 0, - "metaDescription": "string", - "metaKeywords": "string", - "metas": {}, - "password": "string", - "slug": "string", - "status": "PUBLISHED", - "summary": "string", - "tags": [{ - "createTime": "2020-10-11T05:35:01.835Z", - "fullPath": "string", - "id": 0, - "name": "string", - "slug": "string", - "thumbnail": "string" - }], - "template": "string", - "thumbnail": "string", - "title": "string", - "topPriority": 0, - "topped": true, - "updateTime": "2020-10-11T05:35:01.835Z", - "visits": 0, - "wordCount": 0 - }], - "year": 0 + "month": 0, + "posts": [{ + "categories": [{ + "createTime": "2020-10-11T05:35:01.835Z", + "description": "string", + "fullPath": "string", + "id": 0, + "name": "string", + "parentId": 0, + "slug": "string", + "thumbnail": "string" + }], + "commentCount": 0, + "createTime": "2020-10-11T05:35:01.835Z", + "disallowComment": true, + "editTime": "2020-10-11T05:35:01.835Z", + "editorType": "MARKDOWN", + "fullPath": "string", + "id": 0, + "likes": 0, + "metaDescription": "string", + "metaKeywords": "string", + "metas": {}, + "password": "string", + "slug": "string", + "status": "PUBLISHED", + "summary": "string", + "tags": [{ + "createTime": "2020-10-11T05:35:01.835Z", + "fullPath": "string", + "id": 0, + "name": "string", + "slug": "string", + "thumbnail": "string" + }], + "template": "string", + "thumbnail": "string", + "title": "string", + "topPriority": 0, + "topped": true, + "updateTime": "2020-10-11T05:35:01.835Z", + "visits": 0, + "wordCount": 0 + }], + "year": 0 }] ``` @@ -362,103 +362,102 @@ archives(year): ```json [{ - "posts": [{ - "categories": [{ - "createTime": "2020-10-11T05:30:45.245Z", - "description": "string", - "fullPath": "string", - "id": 0, - "name": "string", - "parentId": 0, - "slug": "string", - "thumbnail": "string" - }], - "commentCount": 0, - "createTime": "2020-10-11T05:30:45.245Z", - "disallowComment": true, - "editTime": "2020-10-11T05:30:45.245Z", - "editorType": "MARKDOWN", - "fullPath": "string", - "id": 0, - "likes": 0, - "metaDescription": "string", - "metaKeywords": "string", - "metas": {}, - "password": "string", - "slug": "string", - "status": "PUBLISHED", - "summary": "string", - "tags": [{ - "createTime": "2020-10-11T05:30:45.245Z", - "fullPath": "string", - "id": 0, - "name": "string", - "slug": "string", - "thumbnail": "string" - }], - "template": "string", - "thumbnail": "string", - "title": "string", - "topPriority": 0, - "topped": true, - "updateTime": "2020-10-11T05:30:45.245Z", - "visits": 0, - "wordCount": 0 - }], - "year": 0 + "posts": [{ + "categories": [{ + "createTime": "2020-10-11T05:30:45.245Z", + "description": "string", + "fullPath": "string", + "id": 0, + "name": "string", + "parentId": 0, + "slug": "string", + "thumbnail": "string" + }], + "commentCount": 0, + "createTime": "2020-10-11T05:30:45.245Z", + "disallowComment": true, + "editTime": "2020-10-11T05:30:45.245Z", + "editorType": "MARKDOWN", + "fullPath": "string", + "id": 0, + "likes": 0, + "metaDescription": "string", + "metaKeywords": "string", + "metas": {}, + "password": "string", + "slug": "string", + "status": "PUBLISHED", + "summary": "string", + "tags": [{ + "createTime": "2020-10-11T05:30:45.245Z", + "fullPath": "string", + "id": 0, + "name": "string", + "slug": "string", + "thumbnail": "string" + }], + "template": "string", + "thumbnail": "string", + "title": "string", + "topPriority": 0, + "topped": true, + "updateTime": "2020-10-11T05:30:45.245Z", + "visits": 0, + "wordCount": 0 + }], + "year": 0 }] ``` archives(month): - ```json [{ - "month": 0, - "posts": [{ - "categories": [{ - "createTime": "2020-10-11T05:35:01.835Z", - "description": "string", - "fullPath": "string", - "id": 0, - "name": "string", - "parentId": 0, - "slug": "string", - "thumbnail": "string" - }], - "commentCount": 0, - "createTime": "2020-10-11T05:35:01.835Z", - "disallowComment": true, - "editTime": "2020-10-11T05:35:01.835Z", - "editorType": "MARKDOWN", - "fullPath": "string", - "id": 0, - "likes": 0, - "metaDescription": "string", - "metaKeywords": "string", - "metas": {}, - "password": "string", - "slug": "string", - "status": "PUBLISHED", - "summary": "string", - "tags": [{ - "createTime": "2020-10-11T05:35:01.835Z", - "fullPath": "string", - "id": 0, - "name": "string", - "slug": "string", - "thumbnail": "string" - }], - "template": "string", - "thumbnail": "string", - "title": "string", - "topPriority": 0, - "topped": true, - "updateTime": "2020-10-11T05:35:01.835Z", - "visits": 0, - "wordCount": 0 - }], - "year": 0 + "month": 0, + "posts": [{ + "categories": [{ + "createTime": "2020-10-11T05:35:01.835Z", + "description": "string", + "fullPath": "string", + "id": 0, + "name": "string", + "parentId": 0, + "slug": "string", + "thumbnail": "string" + }], + "commentCount": 0, + "createTime": "2020-10-11T05:35:01.835Z", + "disallowComment": true, + "editTime": "2020-10-11T05:35:01.835Z", + "editorType": "MARKDOWN", + "fullPath": "string", + "id": 0, + "likes": 0, + "metaDescription": "string", + "metaKeywords": "string", + "metas": {}, + "password": "string", + "slug": "string", + "status": "PUBLISHED", + "summary": "string", + "tags": [{ + "createTime": "2020-10-11T05:35:01.835Z", + "fullPath": "string", + "id": 0, + "name": "string", + "slug": "string", + "thumbnail": "string" + }], + "template": "string", + "thumbnail": "string", + "title": "string", + "topPriority": 0, + "topped": true, + "updateTime": "2020-10-11T05:35:01.835Z", + "visits": 0, + "wordCount": 0 + }], + "year": 0 }] ``` @@ -523,47 +522,47 @@ posts: ```json [{ - "categories": [{ - "createTime": "2020-10-11T05:35:01.811Z", - "description": "string", - "fullPath": "string", - "id": 0, - "name": "string", - "parentId": 0, - "slug": "string", - "thumbnail": "string" - }], - "commentCount": 0, - "createTime": "2020-10-11T05:35:01.811Z", - "disallowComment": true, - "editTime": "2020-10-11T05:35:01.811Z", - "editorType": "MARKDOWN", - "fullPath": "string", - "id": 0, - "likes": 0, - "metaDescription": "string", - "metaKeywords": "string", - "metas": {}, - "password": "string", - "slug": "string", - "status": "PUBLISHED", - "summary": "string", - "tags": [{ - "createTime": "2020-10-11T05:35:01.811Z", - "fullPath": "string", - "id": 0, - "name": "string", - "slug": "string", - "thumbnail": "string" - }], - "template": "string", - "thumbnail": "string", - "title": "string", - "topPriority": 0, - "topped": true, - "updateTime": "2020-10-11T05:35:01.811Z", - "visits": 0, - "wordCount": 0 + "categories": [{ + "createTime": "2020-10-11T05:35:01.811Z", + "description": "string", + "fullPath": "string", + "id": 0, + "name": "string", + "parentId": 0, + "slug": "string", + "thumbnail": "string" + }], + "commentCount": 0, + "createTime": "2020-10-11T05:35:01.811Z", + "disallowComment": true, + "editTime": "2020-10-11T05:35:01.811Z", + "editorType": "MARKDOWN", + "fullPath": "string", + "id": 0, + "likes": 0, + "metaDescription": "string", + "metaKeywords": "string", + "metas": {}, + "password": "string", + "slug": "string", + "status": "PUBLISHED", + "summary": "string", + "tags": [{ + "createTime": "2020-10-11T05:35:01.811Z", + "fullPath": "string", + "id": 0, + "name": "string", + "slug": "string", + "thumbnail": "string" + }], + "template": "string", + "thumbnail": "string", + "title": "string", + "topPriority": 0, + "topped": true, + "updateTime": "2020-10-11T05:35:01.811Z", + "visits": 0, + "wordCount": 0 }] ``` @@ -571,7 +570,7 @@ posts: ```html <@postTag method="listByCategoryId" top="${category.id?c}"> - 分类 ${category.name!} 下的文章: + 分类 ${category.name!} 下的文章: <#list posts as post> ${post.title!} @@ -607,47 +606,47 @@ posts: ```json [{ - "categories": [{ - "createTime": "2020-10-11T05:35:01.811Z", - "description": "string", - "fullPath": "string", - "id": 0, - "name": "string", - "parentId": 0, - "slug": "string", - "thumbnail": "string" - }], - "commentCount": 0, - "createTime": "2020-10-11T05:35:01.811Z", - "disallowComment": true, - "editTime": "2020-10-11T05:35:01.811Z", - "editorType": "MARKDOWN", - "fullPath": "string", - "id": 0, - "likes": 0, - "metaDescription": "string", - "metaKeywords": "string", - "metas": {}, - "password": "string", - "slug": "string", - "status": "PUBLISHED", - "summary": "string", - "tags": [{ - "createTime": "2020-10-11T05:35:01.811Z", - "fullPath": "string", - "id": 0, - "name": "string", - "slug": "string", - "thumbnail": "string" - }], - "template": "string", - "thumbnail": "string", - "title": "string", - "topPriority": 0, - "topped": true, - "updateTime": "2020-10-11T05:35:01.811Z", - "visits": 0, - "wordCount": 0 + "categories": [{ + "createTime": "2020-10-11T05:35:01.811Z", + "description": "string", + "fullPath": "string", + "id": 0, + "name": "string", + "parentId": 0, + "slug": "string", + "thumbnail": "string" + }], + "commentCount": 0, + "createTime": "2020-10-11T05:35:01.811Z", + "disallowComment": true, + "editTime": "2020-10-11T05:35:01.811Z", + "editorType": "MARKDOWN", + "fullPath": "string", + "id": 0, + "likes": 0, + "metaDescription": "string", + "metaKeywords": "string", + "metas": {}, + "password": "string", + "slug": "string", + "status": "PUBLISHED", + "summary": "string", + "tags": [{ + "createTime": "2020-10-11T05:35:01.811Z", + "fullPath": "string", + "id": 0, + "name": "string", + "slug": "string", + "thumbnail": "string" + }], + "template": "string", + "thumbnail": "string", + "title": "string", + "topPriority": 0, + "topped": true, + "updateTime": "2020-10-11T05:35:01.811Z", + "visits": 0, + "wordCount": 0 }] ``` @@ -655,7 +654,7 @@ posts: ```html <@postTag method="listByCategorySlug" categorySlug="${category.slug!}"> - 分类 ${category.name!} 下的文章: + 分类 ${category.name!} 下的文章: <#list posts as post> ${post.title!} @@ -691,47 +690,47 @@ posts: ```json [{ - "categories": [{ - "createTime": "2020-10-11T05:35:01.811Z", - "description": "string", - "fullPath": "string", - "id": 0, - "name": "string", - "parentId": 0, - "slug": "string", - "thumbnail": "string" - }], - "commentCount": 0, - "createTime": "2020-10-11T05:35:01.811Z", - "disallowComment": true, - "editTime": "2020-10-11T05:35:01.811Z", - "editorType": "MARKDOWN", - "fullPath": "string", - "id": 0, - "likes": 0, - "metaDescription": "string", - "metaKeywords": "string", - "metas": {}, - "password": "string", - "slug": "string", - "status": "PUBLISHED", - "summary": "string", - "tags": [{ - "createTime": "2020-10-11T05:35:01.811Z", - "fullPath": "string", - "id": 0, - "name": "string", - "slug": "string", - "thumbnail": "string" - }], - "template": "string", - "thumbnail": "string", - "title": "string", - "topPriority": 0, - "topped": true, - "updateTime": "2020-10-11T05:35:01.811Z", - "visits": 0, - "wordCount": 0 + "categories": [{ + "createTime": "2020-10-11T05:35:01.811Z", + "description": "string", + "fullPath": "string", + "id": 0, + "name": "string", + "parentId": 0, + "slug": "string", + "thumbnail": "string" + }], + "commentCount": 0, + "createTime": "2020-10-11T05:35:01.811Z", + "disallowComment": true, + "editTime": "2020-10-11T05:35:01.811Z", + "editorType": "MARKDOWN", + "fullPath": "string", + "id": 0, + "likes": 0, + "metaDescription": "string", + "metaKeywords": "string", + "metas": {}, + "password": "string", + "slug": "string", + "status": "PUBLISHED", + "summary": "string", + "tags": [{ + "createTime": "2020-10-11T05:35:01.811Z", + "fullPath": "string", + "id": 0, + "name": "string", + "slug": "string", + "thumbnail": "string" + }], + "template": "string", + "thumbnail": "string", + "title": "string", + "topPriority": 0, + "topped": true, + "updateTime": "2020-10-11T05:35:01.811Z", + "visits": 0, + "wordCount": 0 }] ``` @@ -739,7 +738,7 @@ posts: ```html <@postTag method="listByTagId" tagId="${tag.id?c}"> - 标签 ${tag.name!} 下的文章: + 标签 ${tag.name!} 下的文章: <#list posts as post> ${post.title!} @@ -775,47 +774,47 @@ posts: ```json [{ - "categories": [{ - "createTime": "2020-10-11T05:35:01.811Z", - "description": "string", - "fullPath": "string", - "id": 0, - "name": "string", - "parentId": 0, - "slug": "string", - "thumbnail": "string" - }], - "commentCount": 0, - "createTime": "2020-10-11T05:35:01.811Z", - "disallowComment": true, - "editTime": "2020-10-11T05:35:01.811Z", - "editorType": "MARKDOWN", - "fullPath": "string", - "id": 0, - "likes": 0, - "metaDescription": "string", - "metaKeywords": "string", - "metas": {}, - "password": "string", - "slug": "string", - "status": "PUBLISHED", - "summary": "string", - "tags": [{ - "createTime": "2020-10-11T05:35:01.811Z", - "fullPath": "string", - "id": 0, - "name": "string", - "slug": "string", - "thumbnail": "string" - }], - "template": "string", - "thumbnail": "string", - "title": "string", - "topPriority": 0, - "topped": true, - "updateTime": "2020-10-11T05:35:01.811Z", - "visits": 0, - "wordCount": 0 + "categories": [{ + "createTime": "2020-10-11T05:35:01.811Z", + "description": "string", + "fullPath": "string", + "id": 0, + "name": "string", + "parentId": 0, + "slug": "string", + "thumbnail": "string" + }], + "commentCount": 0, + "createTime": "2020-10-11T05:35:01.811Z", + "disallowComment": true, + "editTime": "2020-10-11T05:35:01.811Z", + "editorType": "MARKDOWN", + "fullPath": "string", + "id": 0, + "likes": 0, + "metaDescription": "string", + "metaKeywords": "string", + "metas": {}, + "password": "string", + "slug": "string", + "status": "PUBLISHED", + "summary": "string", + "tags": [{ + "createTime": "2020-10-11T05:35:01.811Z", + "fullPath": "string", + "id": 0, + "name": "string", + "slug": "string", + "thumbnail": "string" + }], + "template": "string", + "thumbnail": "string", + "title": "string", + "topPriority": 0, + "topped": true, + "updateTime": "2020-10-11T05:35:01.811Z", + "visits": 0, + "wordCount": 0 }] ``` @@ -823,7 +822,7 @@ posts: ```html <@postTag method="listByTagSlug" tagSlug="${tag.slug!}"> - 标签 ${tag.name!} 下的文章: + 标签 ${tag.name!} 下的文章: <#list posts as post> ${post.title!} @@ -861,32 +860,32 @@ comments: ```json [{ - "allowNotification": true, - "author": "string", - "authorUrl": "string", - "content": "string", - "createTime": "2020-10-13T12:35:54.974Z", - "email": "string", - "gravatarMd5": "string", - "id": 0, - "ipAddress": "string", - "isAdmin": true, - "parentId": 0, - "post": { - "createTime": "2020-10-13T12:35:54.974Z", - "editTime": "2020-10-13T12:35:54.974Z", - "editorType": "MARKDOWN", - "fullPath": "string", - "id": 0, - "metaDescription": "string", - "metaKeywords": "string", - "slug": "string", - "status": "PUBLISHED", - "title": "string", - "updateTime": "2020-10-13T12:35:54.974Z" - }, - "status": "PUBLISHED", - "userAgent": "string" + "allowNotification": true, + "author": "string", + "authorUrl": "string", + "content": "string", + "createTime": "2020-10-13T12:35:54.974Z", + "email": "string", + "gravatarMd5": "string", + "id": 0, + "ipAddress": "string", + "isAdmin": true, + "parentId": 0, + "post": { + "createTime": "2020-10-13T12:35:54.974Z", + "editTime": "2020-10-13T12:35:54.974Z", + "editorType": "MARKDOWN", + "fullPath": "string", + "id": 0, + "metaDescription": "string", + "metaKeywords": "string", + "slug": "string", + "status": "PUBLISHED", + "title": "string", + "updateTime": "2020-10-13T12:35:54.974Z" + }, + "status": "PUBLISHED", + "userAgent": "string" }] ``` @@ -967,15 +966,15 @@ categories: ```json [{ - "createTime": "2020-10-11T05:59:40.622Z", - "description": "string", - "fullPath": "string", - "id": 0, - "name": "string", - "parentId": 0, - "slug": "string", - "thumbnail": "string", - "postCount": 0 + "createTime": "2020-10-11T05:59:40.622Z", + "description": "string", + "fullPath": "string", + "id": 0, + "name": "string", + "parentId": 0, + "slug": "string", + "thumbnail": "string", + "postCount": 0 }] ``` @@ -1119,14 +1118,14 @@ categories: ```json [{ - "createTime": "2020-10-11T05:59:40.622Z", - "description": "string", - "fullPath": "string", - "id": 0, - "name": "string", - "parentId": 0, - "slug": "string", - "thumbnail": "string" + "createTime": "2020-10-11T05:59:40.622Z", + "description": "string", + "fullPath": "string", + "id": 0, + "name": "string", + "parentId": 0, + "slug": "string", + "thumbnail": "string" }] ``` @@ -1203,13 +1202,13 @@ tags: ```json [{ - "createTime": "2020-10-11T06:14:30.595Z", - "fullPath": "string", - "id": 0, - "name": "string", - "slug": "string", - "thumbnail": "string", - "postCount": 0 + "createTime": "2020-10-11T06:14:30.595Z", + "fullPath": "string", + "id": 0, + "name": "string", + "slug": "string", + "thumbnail": "string", + "postCount": 0 }] ``` @@ -1251,12 +1250,12 @@ tags: ```json [{ - "createTime": "2020-10-11T06:14:30.595Z", - "fullPath": "string", - "id": 0, - "name": "string", - "slug": "string", - "thumbnail": "string" + "createTime": "2020-10-11T06:14:30.595Z", + "fullPath": "string", + "id": 0, + "name": "string", + "slug": "string", + "thumbnail": "string" }] ``` @@ -1333,14 +1332,14 @@ menus: ```json [{ - "icon": "string", - "id": 0, - "name": "string", - "parentId": 0, - "priority": 0, - "target": "string", - "team": "string", - "url": "string" + "icon": "string", + "id": 0, + "name": "string", + "parentId": 0, + "priority": 0, + "target": "string", + "team": "string", + "url": "string" }] ``` @@ -1391,25 +1390,25 @@ menus: ```json [{ - "children": [{ - "children": [{}], - "icon": "string", - "id": 0, - "name": "string", - "parentId": 0, - "priority": 0, - "target": "string", - "team": "string", - "url": "string" - }], - "icon": "string", - "id": 0, - "name": "string", - "parentId": 0, - "priority": 0, - "target": "string", - "team": "string", - "url": "string" + "children": [{ + "children": [{}], + "icon": "string", + "id": 0, + "name": "string", + "parentId": 0, + "priority": 0, + "target": "string", + "team": "string", + "url": "string" + }], + "icon": "string", + "id": 0, + "name": "string", + "parentId": 0, + "priority": 0, + "target": "string", + "team": "string", + "url": "string" }] ``` @@ -1478,14 +1477,14 @@ menus: ```json [{ - "icon": "string", - "id": 0, - "name": "string", - "parentId": 0, - "priority": 0, - "target": "string", - "team": "string", - "url": "string" + "icon": "string", + "id": 0, + "name": "string", + "parentId": 0, + "priority": 0, + "target": "string", + "team": "string", + "url": "string" }] ``` @@ -1537,25 +1536,25 @@ menus: ```json [{ - "children": [{ - "children": [{}], - "icon": "string", - "id": 0, - "name": "string", - "parentId": 0, - "priority": 0, - "target": "string", - "team": "string", - "url": "string" - }], - "icon": "string", - "id": 0, - "name": "string", - "parentId": 0, - "priority": 0, - "target": "string", - "team": "string", - "url": "string" + "children": [{ + "children": [{}], + "icon": "string", + "id": 0, + "name": "string", + "parentId": 0, + "priority": 0, + "target": "string", + "team": "string", + "url": "string" + }], + "icon": "string", + "id": 0, + "name": "string", + "parentId": 0, + "priority": 0, + "target": "string", + "team": "string", + "url": "string" }] ``` @@ -1625,15 +1624,15 @@ links: ```json [{ - "id": 0, - "name": "string", - "url": "string", - "logo": "string", - "description": "string", - "team": "string", - "priority": 0, - "createTime": "2021-01-10 20:48:00", - "updateTime": "2021-01-10 20:48:00" + "id": 0, + "name": "string", + "url": "string", + "logo": "string", + "description": "string", + "team": "string", + "priority": 0, + "createTime": "2021-01-10 20:48:00", + "updateTime": "2021-01-10 20:48:00" }] ``` @@ -1688,15 +1687,15 @@ links: ```json [{ - "id": 0, - "name": "string", - "url": "string", - "logo": "string", - "description": "string", - "team": "string", - "priority": 0, - "createTime": "2021-01-10 20:48:00", - "updateTime": "2021-01-10 20:48:00" + "id": 0, + "name": "string", + "url": "string", + "logo": "string", + "description": "string", + "team": "string", + "priority": 0, + "createTime": "2021-01-10 20:48:00", + "updateTime": "2021-01-10 20:48:00" }] ``` @@ -1751,18 +1750,18 @@ links: teams: -``` +```json [{ - "team": "string", - "links": [{ - "id": 0, - "name": "string", - "url": "string", - "logo": "string", - "description": "string", - "team": "string", - "priority": 0 - }] + "team": "string", + "links": [{ + "id": 0, + "name": "string", + "url": "string", + "logo": "string", + "description": "string", + "team": "string", + "priority": 0 + }] }] ``` @@ -1771,7 +1770,7 @@ teams: ```html <@linkTag method="listTeams"> <#list teams as team> -

${team.team}

+

${team.team}

    <#list links as link>
  • @@ -1834,18 +1833,18 @@ teams: teams: -``` +```json [{ - "team": "string", - "links": [{ - "id": 0, - "name": "string", - "url": "string", - "logo": "string", - "description": "string", - "team": "string", - "priority": 0 - }] + "team": "string", + "links": [{ + "id": 0, + "name": "string", + "url": "string", + "logo": "string", + "description": "string", + "team": "string", + "priority": 0 + }] }] ``` @@ -1854,7 +1853,7 @@ teams: ```html <@linkTag method="listTeamsByRandom"> <#list teams as team> -

    ${team.team}

    +

    ${team.team}

      <#list links as link>
    • @@ -1955,16 +1954,16 @@ photos: ```json [{ - "id": 0, - "name": "string", - "description": "string", - "takeTime": "2021-01-10 20:48:00", - "location": "string", - "thumbnail": "string", - "url": "string", - "team": "string", - "createTime": "2021-01-10 20:48:00", - "updateTime": "2021-01-10 20:48:00" + "id": 0, + "name": "string", + "description": "string", + "takeTime": "2021-01-10 20:48:00", + "location": "string", + "thumbnail": "string", + "url": "string", + "team": "string", + "createTime": "2021-01-10 20:48:00", + "updateTime": "2021-01-10 20:48:00" }] ``` @@ -2006,17 +2005,17 @@ teams: ```json [{ - "team": "string", - "photos": [{ - "id": 0, - "name": "string", - "thumbnail": "string", - "takeTime": "2021-01-10 20:48:00", - "url": "string", - "team": "string", - "location": "string", - "description": "string" - }] + "team": "string", + "photos": [{ + "id": 0, + "name": "string", + "thumbnail": "string", + "takeTime": "2021-01-10 20:48:00", + "url": "string", + "team": "string", + "location": "string", + "description": "string" + }] }] ``` @@ -2024,12 +2023,12 @@ teams: ```html <@photoTag method="listTeams"> - <#list teams as team> -

      ${team.team}

      + <#list teams as team> +

      ${team.team}

      <#list team.photos as photo> ${photo.description} - + ``` @@ -2067,16 +2066,16 @@ photos: ```json [{ - "id": 0, - "name": "string", - "description": "string", - "takeTime": "2021-01-10 20:48:00", - "location": "string", - "thumbnail": "string", - "url": "string", - "team": "string", - "createTime": "2021-01-10 20:48:00", - "updateTime": "2021-01-10 20:48:00" + "id": 0, + "name": "string", + "description": "string", + "takeTime": "2021-01-10 20:48:00", + "location": "string", + "thumbnail": "string", + "url": "string", + "team": "string", + "createTime": "2021-01-10 20:48:00", + "updateTime": "2021-01-10 20:48:00" }] ``` @@ -2085,7 +2084,7 @@ photos: ```html <@photoTag method="listTeams" team="风景"> <#list team.photos as photo> - ${photo.description} + ${photo.description} ``` @@ -2149,7 +2148,7 @@ count: long 1. method:index 2. page:当前页,通过 `${posts.number}` 得到 3. total:总页数,通过 `${posts.totalPages}` 得到 -3. display:页码展示数量 +4. display:页码展示数量 #### 返回参数 @@ -2157,15 +2156,15 @@ pagination: ```json { - "nextPageFullPath": "string", - "prevPageFullPath": "string", - "hasPrev": true, - "hasNext": true, - "rainbowPages": [{ - "page": 0, - "fullPath": "string", - "isCurrent": true - }] + "nextPageFullPath": "string", + "prevPageFullPath": "string", + "hasPrev": true, + "hasNext": true, + "rainbowPages": [{ + "page": 0, + "fullPath": "string", + "isCurrent": true + }] } ``` @@ -2236,7 +2235,7 @@ pagination: 1. method:archives 2. page:当前页,通过 `${posts.number}` 得到 3. total:总页数,通过 `${posts.totalPages}` 得到 -3. display:页码展示数量 +4. display:页码展示数量 #### 返回参数 @@ -2244,15 +2243,15 @@ pagination: ```json { - "nextPageFullPath": "string", - "prevPageFullPath": "string", - "hasPrev": true, - "hasNext": true, - "rainbowPages": [{ - "page": 0, - "fullPath": "string", - "isCurrent": true - }] + "nextPageFullPath": "string", + "prevPageFullPath": "string", + "hasPrev": true, + "hasNext": true, + "rainbowPages": [{ + "page": 0, + "fullPath": "string", + "isCurrent": true + }] } ``` @@ -2332,15 +2331,15 @@ pagination: ```json { - "nextPageFullPath": "string", - "prevPageFullPath": "string", - "hasPrev": true, - "hasNext": true, - "rainbowPages": [{ - "page": 0, - "fullPath": "string", - "isCurrent": true - }] + "nextPageFullPath": "string", + "prevPageFullPath": "string", + "hasPrev": true, + "hasNext": true, + "rainbowPages": [{ + "page": 0, + "fullPath": "string", + "isCurrent": true + }] } ``` @@ -2411,8 +2410,8 @@ pagination: 1. method:tagPosts 2. page:当前页,通过 `${posts.number}` 得到 3. total:总页数,通过 `${posts.totalPages}` 得到 -3. display:页码展示数量 -4. slug:标签 slug +4. display:页码展示数量 +5. slug:标签 slug #### 返回参数 @@ -2420,15 +2419,15 @@ pagination: ```json { - "nextPageFullPath": "string", - "prevPageFullPath": "string", - "hasPrev": true, - "hasNext": true, - "rainbowPages": [{ - "page": 0, - "fullPath": "string", - "isCurrent": true - }] + "nextPageFullPath": "string", + "prevPageFullPath": "string", + "hasPrev": true, + "hasNext": true, + "rainbowPages": [{ + "page": 0, + "fullPath": "string", + "isCurrent": true + }] } ``` @@ -2499,8 +2498,8 @@ pagination: 1. method:categoryPosts 2. page:当前页,通过 `${posts.number}` 得到 3. total:总页数,通过 `${posts.totalPages}` 得到 -3. display:页码展示数量 -4. slug:标签 slug +4. display:页码展示数量 +5. slug:标签 slug #### 返回参数 @@ -2508,15 +2507,15 @@ pagination: ```json { - "nextPageFullPath": "string", - "prevPageFullPath": "string", - "hasPrev": true, - "hasNext": true, - "rainbowPages": [{ - "page": 0, - "fullPath": "string", - "isCurrent": true - }] + "nextPageFullPath": "string", + "prevPageFullPath": "string", + "hasPrev": true, + "hasNext": true, + "rainbowPages": [{ + "page": 0, + "fullPath": "string", + "isCurrent": true + }] } ``` @@ -2587,7 +2586,7 @@ pagination: 1. method:photos 2. page:当前页,通过 `${photos.number}` 得到 3. total:总页数,通过 `${photos.totalPages}` 得到 -3. display:页码展示数量 +4. display:页码展示数量 #### 返回参数 @@ -2595,15 +2594,15 @@ pagination: ```json { - "nextPageFullPath": "string", - "prevPageFullPath": "string", - "hasPrev": true, - "hasNext": true, - "rainbowPages": [{ - "page": 0, - "fullPath": "string", - "isCurrent": true - }] + "nextPageFullPath": "string", + "prevPageFullPath": "string", + "hasPrev": true, + "hasNext": true, + "rainbowPages": [{ + "page": 0, + "fullPath": "string", + "isCurrent": true + }] } ``` @@ -2674,7 +2673,7 @@ pagination: 1. method:journals 2. page:当前页,通过 `${journals.number}` 得到 3. total:总页数,通过 `${journals.totalPages}` 得到 -3. display:页码展示数量 +4. display:页码展示数量 #### 返回参数 @@ -2682,15 +2681,15 @@ pagination: ```json { - "nextPageFullPath": "string", - "prevPageFullPath": "string", - "hasPrev": true, - "hasNext": true, - "rainbowPages": [{ - "page": 0, - "fullPath": "string", - "isCurrent": true - }] + "nextPageFullPath": "string", + "prevPageFullPath": "string", + "hasPrev": true, + "hasNext": true, + "rainbowPages": [{ + "page": 0, + "fullPath": "string", + "isCurrent": true + }] } ``` @@ -2744,4 +2743,4 @@ pagination: 下一页
    -``` \ No newline at end of file +``` diff --git a/docs/getting-started/config.md b/docs/getting-started/config.md index c952308..9c0dbeb 100644 --- a/docs/getting-started/config.md +++ b/docs/getting-started/config.md @@ -12,9 +12,11 @@ Halo 的配置文件名为 `application.yaml`,其必须位于[工作目录](/g 如下将详细列出配置文件 `application.yaml` 中所有的配置项。 ## 基础配置 + 基础配置中的配置设置一般来说是**必要的**,且必须在 application.yaml 里进行定义。 ### 端口 + 用于指定 HTTP 服务器监听的端口,Halo 默认设置为 `8090`。 ```yaml @@ -25,6 +27,7 @@ server: 请注意,如果您选择设置端口为 `80`,则需要确保您的 80 端口未被占用,通常**不建议**直接设置为 80 端口。 ### 数据库 + Halo 目前支持 `H2` 及 `MySQL` 数据库。 :::tip @@ -88,9 +91,11 @@ create database halodb character set utf8mb4 collate utf8mb4_bin; - 默认时区为 `Asia/Shanghai`,如果与您所在时区不一致,则可以修改为您所在的时区。 ## 高级配置 + 高级配置中的配置设置是可选的,如果不需要,可以略过。 ### 后台路径 + Halo 支持自定义后台管理的**根路径**。 ```yaml @@ -102,6 +107,7 @@ halo: 注意:仅为改动后台管理的根路径,因此前后不带 `/`。 ### 缓存 + 某些情况下,需要用户根据需求来设置缓存数据的保存方式,例如将缓存数据持久化保存在本地。 ```yaml @@ -111,10 +117,12 @@ halo: ``` 目前支持两种策略: + - `memory` 将数据缓存至内存,重启服务缓存将清空。 - `level` 将数据缓存至本地,重启服务不会清空缓存。 ### 压缩 + 启用压缩对于减少带宽和加快页面加载非常有用,在**未使用** `Nginx` 或 `Caddy` 等反向代理服务器时(反向代理服务器通常是默认开启 Gzip 的),可以考虑开启系统自带的Gzip 功能。 ```yaml diff --git a/docs/getting-started/downloads.md b/docs/getting-started/downloads.md index 81884b0..591ab97 100644 --- a/docs/getting-started/downloads.md +++ b/docs/getting-started/downloads.md @@ -22,4 +22,4 @@ description: 目前所有与 Halo 相关的下载地址 - [https://halo.cary.tech](https://halo.cary.tech) -此镜像源由 [新逸Cary](https://blog.xinac.cn) 提供并维护。 \ No newline at end of file +此镜像源由 [新逸Cary](https://blog.xinac.cn) 提供并维护。 diff --git a/docs/getting-started/install/docker.md b/docs/getting-started/install/docker.md index 891d230..3c53a37 100644 --- a/docs/getting-started/install/docker.md +++ b/docs/getting-started/install/docker.md @@ -8,36 +8,43 @@ description: 使用 Docker 部署 ::: ## 使用 Docker 镜像 + Halo 在 Docker Hub 上发布的镜像为 [halohub/halo](https://hub.docker.com/r/halohub/halo) 1. 创建[工作目录](/getting-started/prepare#工作目录) + ```bash mkdir ~/.halo && cd ~/.halo ``` 2. 下载示例配置文件到[工作目录](/getting-started/prepare#工作目录) + ```bash wget https://dl.halo.run/config/application-template.yaml -O ./application.yaml ``` 3. 编辑配置文件,配置数据库或者端口等,如需配置请参考[参考配置](/getting-started/config) + ```bash vim application.yaml ``` 4. 拉取最新的 Halo 镜像 + ```bash docker pull halohub/halo:1.4.17 ``` :::info -查看最新版本镜像:https://hub.docker.com/r/halohub/halo ,我们推荐使用具体版本号的镜像,但也提供了 `latest` 标签的镜像,它始终是最新的。 +查看最新版本镜像: ,我们推荐使用具体版本号的镜像,但也提供了 `latest` 标签的镜像,它始终是最新的。 ::: 5. 创建容器 + ```bash docker run -it -d --name halo -p 8090:8090 -v ~/.halo:/root/.halo --restart=unless-stopped halohub/halo:1.4.17 ``` + - **-it:** 开启输入功能并连接伪终端 - **-d:** 后台运行容器 - **--name:** 为容器指定一个名称 @@ -78,7 +85,7 @@ server { ### Caddy 1.x -``` +```txt https://www.yourdomain.com { gzip tls your@email.com @@ -90,7 +97,7 @@ https://www.yourdomain.com { ### Caddy 2.x -``` +```txt www.yourdomain.com encode gzip @@ -98,4 +105,4 @@ encode gzip reverse_proxy 127.0.0.1:8090 ``` -以上配置都可以在 https://github.com/halo-dev/halo-common 找到。 \ No newline at end of file +以上配置都可以在 找到。 diff --git a/docs/getting-started/install/linux.md b/docs/getting-started/install/linux.md index ab2d030..a1c8c98 100644 --- a/docs/getting-started/install/linux.md +++ b/docs/getting-started/install/linux.md @@ -8,6 +8,7 @@ description: 在Linux上快速安装Halo ::: ## 依赖检查 + 目前运行 Halo 的最低依赖要求为 JRE 11,请务必确保在进行下面操作之前已经正确安装了 JRE。 目前介绍两种 Linux 发行版的安装方式,均为 OpenJRE,不推荐 Oracle 版本。 @@ -61,32 +62,37 @@ OpenJDK 64-Bit Server VM (build 11.0.10+9-Ubuntu-0ubuntu1.20.04, mixed mode) ::: 创建一个名为 halo 的用户(名字可以随意) + ```bash useradd -m halo ``` 给予 sudo 权限 + ```bash usermod -aG wheel halo ``` 为 halo 用户创建密码 + ```bash passwd halo ``` 登录到 halo 账户 + ```bash su - halo ``` 2. 创建存放 [运行包](/getting-started/prepare#运行包) 的目录,这里以 `~/app` 为例 -``` +```bash mkdir ~/app && cd ~/app ``` 3. 下载运行包 + ```bash wget https://dl.halo.run/release/halo-1.4.17.jar -O halo.jar ``` @@ -102,26 +108,31 @@ mkdir ~/.halo && cd ~/.halo ``` 5. 下载示例配置文件到 [工作目录](/getting-started/prepare#工作目录) + ```bash wget https://dl.halo.run/config/application-template.yaml -O ./application.yaml ``` 6. 编辑配置文件,配置数据库或者端口等,如需配置请参考 [参考配置](/getting-started/config) + ```bash vim application.yaml ``` 7. 测试运行 Halo + ```bash cd ~/app && java -jar halo.jar ``` 8. 如看到类似以下日志输出,则代表启动成功。 + ```bash run.halo.app.listener.StartedListener : Halo started at http://127.0.0.1:8090 run.halo.app.listener.StartedListener : Halo admin started at http://127.0.0.1:8090/admin run.halo.app.listener.StartedListener : Halo has started successfully! ``` + 打开 `http://ip: 端口号` 即可看到安装引导界面。 :::info @@ -143,16 +154,19 @@ exit ``` 2. 下载 Halo 官方的 halo.service 模板 + ```bash wget https://dl.halo.run/config/halo.service -O /etc/systemd/system/halo.service ``` 3. 修改 halo.service + ```bash vim /etc/systemd/system/halo.service ``` 4. 修改配置 + - **YOUR_JAR_PATH**:Halo 运行包的绝对路径,例如 `/home/halo/app/halo.jar`,注意:此路径不支持 `~` 符号。 - **USER**:运行 Halo 的系统用户,如果有按照上方教程创建新的用户来运行 Halo,修改为你创建的用户名称即可。反之请删除 `User=USER`。 @@ -182,21 +196,25 @@ WantedBy=multi-user.target ::: 5. 重新加载 systemd + ```bash systemctl daemon-reload ``` 6. 运行服务 + ```bash systemctl start halo ``` 7. 在系统启动时启动服务 + ```bash systemctl enable halo ``` 您可以查看服务日志检查启动状态 + ```bash journalctl -n 20 -u halo ``` @@ -230,7 +248,7 @@ server { ### Caddy 1.x -``` +```txt https://www.yourdomain.com { gzip tls your@email.com @@ -242,7 +260,7 @@ https://www.yourdomain.com { ### Caddy 2.x -``` +```txt www.yourdomain.com encode gzip @@ -250,4 +268,4 @@ encode gzip reverse_proxy 127.0.0.1:8090 ``` -以上配置都可以在 https://github.com/halo-dev/halo-common 找到。 +以上配置都可以在 找到。 diff --git a/docs/getting-started/install/other/docker-mysql.md b/docs/getting-started/install/other/docker-mysql.md index 224b28c..3f518b0 100644 --- a/docs/getting-started/install/other/docker-mysql.md +++ b/docs/getting-started/install/other/docker-mysql.md @@ -86,7 +86,7 @@ docker run --name some-mysql -v ~/.halo/mysql:/var/lib/mysql -e MYSQL_ROOT_PASSW 5. 创建 `Halo` 工作目录 -``` +```bash mkdir ~/.halo && cd ~/.halo ``` @@ -140,7 +140,7 @@ docker network connect halo-net some-mysql 3. 同之前一样创建 `Halo` 工作目录 -``` +```bash mkdir ~/.halo && cd ~/.halo ``` diff --git a/docs/getting-started/install/other/oneinstack.md b/docs/getting-started/install/other/oneinstack.md index c6bb386..353adfe 100644 --- a/docs/getting-started/install/other/oneinstack.md +++ b/docs/getting-started/install/other/oneinstack.md @@ -15,7 +15,7 @@ description: 使用 OneinStack 的 vhost 脚本创建 Halo 站点的 Nginx 配 点击下方链接进入 OneinStack 官网,仅选择 `安装 Nginx`,其他的都可以取消选择。 -https://oneinstack.com/auto + 最后点击 `复制安装命令` 到服务器执行即可。如果你仅安装 Nginx,你的链接应该是这样: @@ -55,12 +55,12 @@ sh vhost.sh 2. 按照提示选择或输入相关信息 -```bash +```bash What Are You Doing? - 1. Use HTTP Only - 2. Use your own SSL Certificate and Key - 3. Use Let's Encrypt to Create SSL Certificate and Key - q. Exit + 1. Use HTTP Only + 2. Use your own SSL Certificate and Key + 3. Use Let's Encrypt to Create SSL Certificate and Key + q. Exit Please input the correct option: ``` @@ -260,14 +260,14 @@ nginx -t 如果输出如下提示则代表配置有效: -``` +```bash nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful ``` 重载 Nginx 配置: -``` +```bash nginx -s reload ``` diff --git a/docs/getting-started/install/other/tencent-cloudbase.md b/docs/getting-started/install/other/tencent-cloudbase.md index 1c853a2..2353e0e 100644 --- a/docs/getting-started/install/other/tencent-cloudbase.md +++ b/docs/getting-started/install/other/tencent-cloudbase.md @@ -14,13 +14,13 @@ description: 使用腾讯云 CloudBase 一键部署 1. 系统使用内置的 H2 Database,暂不支持使用 MySQL。 1. 工作目录保存在腾讯云提供的 CFS 上,在使用此方式创建应用的时候会要求创建 CFS。 1. 目前使用该方式部署,不支持修改 [配置文件](/getting-started/config)。 -1. 费用相关请参考 https://cloud.tencent.com/document/product/876/18864 +1. 费用相关请参考 ## 进入云开发页面 点击下方按钮即可进入到腾讯云云开发 CloudBase 创建应用界面,此按钮可在云开发页面自动选择 Halo 的配置模板。 -[![](https://main.qcloudimg.com/raw/67f5a389f1ac6f3b4d04c7256438e44f.svg)](https://console.cloud.tencent.com/tcb/env/index?action=CreateAndDeployCloudBaseProject&appUrl=https%3A%2F%2Fgithub.com%2Fhalo-dev%2Ftencent-cloudbase-halo&branch=master) +[![CloudBase](https://main.qcloudimg.com/raw/67f5a389f1ac6f3b4d04c7256438e44f.svg)](https://console.cloud.tencent.com/tcb/env/index?action=CreateAndDeployCloudBaseProject&appUrl=https%3A%2F%2Fgithub.com%2Fhalo-dev%2Ftencent-cloudbase-halo&branch=master) ## 配置并部署 @@ -48,7 +48,7 @@ description: 使用腾讯云 CloudBase 一键部署 ![tencent-cloudbase-6.png](/img/tencent-cloudbase/tencent-cloudbase-6.png) -**Halo 初始化页面** +**Halo 初始化页面**: ![tencent-cloudbase-7.png](/img/tencent-cloudbase/tencent-cloudbase-7.png) @@ -77,4 +77,3 @@ description: 使用腾讯云 CloudBase 一键部署 - [Halo 配置文件仓库](https://github.com/halo-dev/tencent-cloudbase-halo) - [腾讯云 CloudBase](https://console.cloud.tencent.com/tcb/env/index) - [云开发使用指南](https://cloud.tencent.com/document/product/876) - diff --git a/docs/getting-started/install/third-party.md b/docs/getting-started/install/third-party.md index a79dff7..e8f075c 100644 --- a/docs/getting-started/install/third-party.md +++ b/docs/getting-started/install/third-party.md @@ -10,4 +10,4 @@ title: 三方指南 - [如何用服务器优雅地搭建一个博客—Hello,Halo!](https://www.bilibili.com/video/BV1JN411Q7Na/) - [Halo+云服务器+Nginx反向代理实现个人博客搭建](https://yusart.xyz/archives/halo%E4%B8%AA%E4%BA%BA%E5%8D%9A%E5%AE%A2%E6%90%AD%E5%BB%BA) - [如何在 Windows 下搭建 Halo](https://ykanade.cn/2021/08/11/HaloInWindows/) -- [Halo 博客建站记录](https://catchersun.cn/archives/halo%E5%8D%9A%E5%AE%A2%E5%BB%BA%E7%AB%99%E8%AE%B0%E5%BD%95) \ No newline at end of file +- [Halo 博客建站记录](https://catchersun.cn/archives/halo%E5%8D%9A%E5%AE%A2%E5%BB%BA%E7%AB%99%E8%AE%B0%E5%BD%95) diff --git a/docs/getting-started/install/windows.md b/docs/getting-started/install/windows.md index 374492f..72cab80 100644 --- a/docs/getting-started/install/windows.md +++ b/docs/getting-started/install/windows.md @@ -6,13 +6,15 @@ title: 在 Windows 服务器上部署 在继续操作之前,我们推荐您先阅读[《写在前面》](/getting-started/prepare),这可以快速帮助你了解 Halo。 ::: -# 系统要求 +## 系统要求 + 目前运行 Halo 的最低依赖要求为 JRE 11,而 Java9 之后将不再提供 32 位系统的环境,因此请确保您的服务器属于 64 位 CPU。 -# 依赖检查 +## 依赖检查 + 如下将介绍在 Windows 下安装 OpenJRE 11 的方式。如果您的服务器已经安装过 OpenJRE 11,则可以直接跳过本节。 -1. 使用浏览器前往 https://developers.redhat.com/content-gateway/file/java-11-openjdk-jre-11.0.10.9-1.windows.redhat.x86_64.msi 下载 OpenJRE 11 的可执行程序。 +1. 使用浏览器前往 下载 OpenJRE 11 的可执行程序。 2. 下载时会提示登录“红帽”,任意注册账号登录即可。登录完成之后会自动下载 JRE。 @@ -21,7 +23,8 @@ title: 在 Windows 服务器上部署 ![img2.png](/img/img2.png) 4. 安装完成之后, 使用 Win+R 打开运行窗口并输入 `CMD` 后,回车打开 CMD 窗口。之后键入 `java -version`。显示如下所示内容即代表安装成功。 -``` + +```bash openjdk version "11.0.10" 2021-01-19 LTS OpenJDK Runtime Environment 18.9 (build 11.0.10+9-LTS) OpenJDK 64-Bit Server VM 18.9 (build 11.0.10+9-LTS, mixed mode) @@ -29,10 +32,11 @@ OpenJDK 64-Bit Server VM 18.9 (build 11.0.10+9-LTS, mixed mode) ![1615618595.jpg](/img/1615618595.jpg) -# 安装 Halo +## 安装 Halo + 1. 下载运行包 -使用浏览器前往 https://dl.halo.run/release/halo-1.4.6.jar 下载最新版本 Halo 运行包,**并保存至桌面**。修改 Jar 包名称为 `halo.jar` +使用浏览器前往 下载最新版本 Halo 运行包,**并保存至桌面**。修改 Jar 包名称为 `halo.jar` :::info 如果下载速度不理想,可以[在这里](/getting-started/downloads)选择其他下载地址。 @@ -40,7 +44,7 @@ OpenJDK 64-Bit Server VM 18.9 (build 11.0.10+9-LTS, mixed mode) 2. 下载示例配置文件 -使用浏览器前往 https://dl.halo.run/config/application-template.yaml 下载示例配置文件,**并保存至桌面**。修改示例配置文件名字为 `application.yaml`。 +使用浏览器前往 下载示例配置文件,**并保存至桌面**。修改示例配置文件名字为 `application.yaml`。 :::tip IE 浏览器下,配置文件可能会以文本的形式直接打开,因此推荐使用其他浏览器或下载器下载。 @@ -51,16 +55,19 @@ IE 浏览器下,配置文件可能会以文本的形式直接打开,因此 4. 测试运行 Halo 使用 Win+R 打开运行窗口并输入 `CMD` 后,回车打开 CMD 窗口,并键入如下命令。 -``` + +```bash cd Desktop && java -jar halo.jar ``` 5. 如看到类似以下日志输出,则代表启动成功。 + ```bash run.halo.app.listener.StartedListener : Halo started at http://127.0.0.1:8090 run.halo.app.listener.StartedListener : Halo admin started at http://127.0.0.1:8090/admin run.halo.app.listener.StartedListener : Halo has started successfully! ``` + 浏览器打开 `http://ip:端口号` 即可看到安装引导界面。 :::info diff --git a/docs/getting-started/prepare.md b/docs/getting-started/prepare.md index 29dba99..96a3354 100644 --- a/docs/getting-started/prepare.md +++ b/docs/getting-started/prepare.md @@ -84,14 +84,16 @@ create database halodb character set utf8mb4 collate utf8mb4_bin; 代表当前系统下的 [用户目录](https://zh.wikipedia.org/wiki/%E5%AE%B6%E7%9B%AE%E5%BD%95)。 ### 运行包 + 指 Halo 构建所产生的 Jar 包,后缀为 `.jar`。可能与其他网站应用有所区别的是,Halo 仅仅只有这一个文件。而且所有数据统一保存在下面所说的 `工作目录`。 ### 工作目录 + 指 Halo 所依赖的工作目录,在 Halo 运行的时候会在系统当前用户目录下产生一个 `.halo` 的文件夹,绝对路径为 `~/.halo`。由于这个工作目录是固定的,所以上面所说的 `运行包`不限制所存放的位置,里面通常包含下列目录或文件: 1. `db`:存放 H2 Database 的物理文件,如果您使用 MySQL 数据库,那么不会存在这个目录。 2. `templates/themes`:里面包含用户所下载的主题。 3. `static`:相当于网站的根目录。 4. `logs`:运行日志目录。 -4. `upload`:附件目录。 -5. `application.yaml`:配置文件。 +5. `upload`:附件目录。 +6. `application.yaml`:配置文件。 diff --git a/docs/getting-started/upgrade.md b/docs/getting-started/upgrade.md index 6c1d412..8d2593e 100644 --- a/docs/getting-started/upgrade.md +++ b/docs/getting-started/upgrade.md @@ -57,11 +57,10 @@ java -jar halo.jar 5. 重启服务 -``` +```bash service halo start ``` - ## Docker > 我们假设您的容器是按照 [使用 Docker 部署 Halo](/getting-started/install/docker) 中的命令构建的。如有不同,请根据实际情况修改。 @@ -93,7 +92,7 @@ docker pull halohub/halo:1.4.17 ``` :::info -查看最新版本镜像:https://hub.docker.com/r/halohub/halo ,我们推荐使用具体版本号的镜像,但也提供了 `latest` 标签的镜像,它始终是最新的。 +查看最新版本镜像: ,我们推荐使用具体版本号的镜像,但也提供了 `latest` 标签的镜像,它始终是最新的。 ::: 4. 创建容器 @@ -101,9 +100,10 @@ docker pull halohub/halo:1.4.17 ```bash docker run -it -d --name halo -p 8090:8090 -v ~/.halo:/root/.halo --restart=unless-stopped halohub/halo:1.4.17 ``` + - **-it:** 开启输入功能并连接伪终端 - **-d:** 后台运行容器 - **--name:** 为容器指定一个名称 - **-p:** 端口映射,格式为 `主机(宿主)端口:容器端口` ,可在 `application.yaml` 配置。 - **-v:** 工作目录映射。形式为:-v 宿主机路径:/root/.halo,后者不能修改。 -- **--restart:** 建议设置为 `unless-stopped`,在 Docker 启动的时候自动启动 Halo 容器。 \ No newline at end of file +- **--restart:** 建议设置为 `unless-stopped`,在 Docker 启动的时候自动启动 Halo 容器。 diff --git a/docs/user-guide/config.md b/docs/user-guide/config.md index dfd9884..f348c04 100644 --- a/docs/user-guide/config.md +++ b/docs/user-guide/config.md @@ -29,7 +29,7 @@ description: 系统功能的相关配置说明 很多人反映评论中自己的头像不显示,其实评论部分调用的头像并不是在个人资料中设置的那个,而是 `Gravatar`。所以这一点怪我,从 Halo 发布至今我都没有说明这个事情。 -至于什么是 `Gravatar`,引用 `Gravatar` 官方的说明:`全球公认的头像`。这可不是在吹牛,因为只要接入了 Gravatar 的网站,你在网站上使用在 Gravatar 注册的邮箱之后,都会显示你设置的头像,而不需要额外设置。比较出名的网站有 `Github`,`Gitlab`,`V2ex` 等。所以点击 https://cn.gravatar.com/ 注册一个吧。 +至于什么是 `Gravatar`,引用 `Gravatar` 官方的说明:`全球公认的头像`。这可不是在吹牛,因为只要接入了 Gravatar 的网站,你在网站上使用在 Gravatar 注册的邮箱之后,都会显示你设置的头像,而不需要额外设置。比较出名的网站有 `Github`,`Gitlab`,`V2ex` 等。所以点击 注册一个吧。 ## 设置用户头像/Logo/Favicon @@ -158,8 +158,8 @@ A:诸如百度统计,CNZZ,Google Analytics。可以非常详细的统计 点击主题下方的设置按钮即可进入主题设置。另外主题设置还有一种预览模式,可以实时查看主题设置变更后的效果。当你设置当前激活主题的时候,在页面右下角有一个 `预览模式` 的按钮,点击即可进入预览模式。 ## 设置备案信息 -由于后台博客设置并没有提供设置备案信息的选项,所以有很多人不知道该怎么添加备案信息,这里简单说明一下。 +由于后台博客设置并没有提供设置备案信息的选项,所以有很多人不知道该怎么添加备案信息,这里简单说明一下。 第一步: @@ -167,7 +167,6 @@ A:诸如百度统计,CNZZ,Google Analytics。可以非常详细的统计 这时候你应该可以看到一个`页脚信息`的选项,而且有提示 `支持 HTML 格式的文本`。所以我们把备案信息放在这里即可。 - 第二步: -将整理好的备案信息填写到页脚信息即可,如果没记错的话,公安联网备案是有提供`网站公安机关备案号`和`备案编号HTML代码`的。 \ No newline at end of file +将整理好的备案信息填写到页脚信息即可,如果没记错的话,公安联网备案是有提供`网站公安机关备案号`和`备案编号HTML代码`的。 diff --git a/docs/user-guide/markdown.md b/docs/user-guide/markdown.md index 0b49a84..ac9ff8f 100644 --- a/docs/user-guide/markdown.md +++ b/docs/user-guide/markdown.md @@ -9,21 +9,27 @@ Halo 使用的 `Markdown` 解析器为 [flexmark-java](https://github.com/vsch/f ## 代码块 - ```language - 代码块 - ``` +````markdown +```language +代码块 +``` +```` 其中,language 为必填,如果不填写,很可能主题的代码高亮插件无法识别代码的语言,导致样式异常。举几个例子: - ```java - public static void main(String[] args){ -     System.out.println("Hello World!"); - } - ``` +````markdown +```java +public static void main(String[] args){ +    System.out.println("Hello World!"); +} +``` +```` - ```javascript - console.log("Hello World!") - ``` +````markdown +```javascript +console.log("Hello World!") +``` +```` ## TOC @@ -33,9 +39,9 @@ Halo 使用的 `Markdown` 解析器为 [flexmark-java](https://github.com/vsch/f 支持自动将一个链接解析为可点击的格式,如下: -````markdown +```markdown https://halo.run -```` +``` 将被解析为: @@ -177,21 +183,21 @@ Halo 内置一些短连接以更好地支持一些 HTML 语法,但是编辑器 ## 脚注 -#### 语法 +语法: ```markdown [^脚注名] [^脚注名]: 脚注内容 ``` -#### 示例 +示例: ```markdown 驿外[^1]断桥边,寂寞开无主。已是黄昏独自愁,更着风和雨 [^1]: 驿(yì)外:指荒僻、冷清之地。驿,驿站。 ``` -#### 解析结果 +解析结果: ```html

    驿外[1]断桥边,寂寞开无主。已是黄昏独自愁,更着风和雨

    @@ -202,4 +208,4 @@ Halo 内置一些短连接以更好地支持一些 HTML 语法,但是编辑器
  • -``` \ No newline at end of file +``` diff --git a/package.json b/package.json index cfb61a8..16ae176 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,7 @@ "version": "0.0.0", "private": true, "scripts": { + "prepare": "husky install", "docusaurus": "docusaurus", "start": "docusaurus start", "build": "docusaurus build", @@ -11,7 +12,8 @@ "clear": "docusaurus clear", "serve": "docusaurus serve", "write-translations": "docusaurus write-translations", - "write-heading-ids": "docusaurus write-heading-ids" + "write-heading-ids": "docusaurus write-heading-ids", + "lint": "markdownlint-cli2 './docs/**/*.md' './versioned_docs/version-1.4.17/**/*.md'" }, "dependencies": { "@docusaurus/core": "2.0.0-beta.14", @@ -37,5 +39,10 @@ "last 1 firefox version", "last 1 safari version" ] + }, + "devDependencies": { + "husky": "^7.0.4", + "markdownlint": "^0.25.1", + "markdownlint-cli2": "^0.4.0" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 36a7a93..d61d5c4 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -8,6 +8,9 @@ specifiers: '@svgr/webpack': ^5.5.0 clsx: ^1.1.1 file-loader: ^6.2.0 + husky: ^7.0.4 + markdownlint: ^0.25.1 + markdownlint-cli2: ^0.4.0 prism-react-renderer: ^1.2.1 react: ^17.0.2 react-dom: ^17.0.2 @@ -26,6 +29,11 @@ dependencies: react-dom: 17.0.2_react@17.0.2 url-loader: 4.1.1_file-loader@6.2.0 +devDependencies: + husky: 7.0.4 + markdownlint: 0.25.1 + markdownlint-cli2: 0.4.0 + packages: /@algolia/autocomplete-core/1.2.2: @@ -3599,12 +3607,10 @@ packages: dependencies: '@nodelib/fs.stat': 2.0.5 run-parallel: 1.2.0 - dev: false /@nodelib/fs.stat/2.0.5: resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==} engines: {node: '>= 8'} - dev: false /@nodelib/fs.walk/1.2.8: resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} @@ -3612,7 +3618,6 @@ packages: dependencies: '@nodelib/fs.scandir': 2.1.5 fastq: 1.13.0 - dev: false /@polka/url/1.0.0-next.21: resolution: {integrity: sha512-a5Sab1C4/icpTZVzZc5Ghpz88yQtGOyNqYXcZgOssB2uuAr+wF/MvN6bgtW32q7HHrvBki+BsZ0OuNv6EV3K9g==} @@ -4373,7 +4378,6 @@ packages: /argparse/2.0.1: resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} - dev: false /arr-diff/4.0.0: resolution: {integrity: sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=} @@ -4410,6 +4414,11 @@ packages: engines: {node: '>=8'} dev: false + /array-union/3.0.1: + resolution: {integrity: sha512-1OvF9IbWwaeiM9VhzYXVQacMibxpXOMYVNIvMtKRyX9SImBXpKcFr8XvFDeEslCyuH/t6KRt7HEO94AlP8Iatw==} + engines: {node: '>=12'} + dev: true + /array-uniq/1.0.3: resolution: {integrity: sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=} engines: {node: '>=0.10.0'} @@ -4720,7 +4729,6 @@ packages: engines: {node: '>=8'} dependencies: fill-range: 7.0.1 - dev: false /browserslist/4.14.2: resolution: {integrity: sha512-HI4lPveGKUR0x2StIz+2FXfDk9SfVMrxn6PLh1JeGUwcuoDkdKZebWiyLRJ68iIPDpMI4JLVDf7S7XzslgWOhw==} @@ -5762,7 +5770,6 @@ packages: engines: {node: '>=8'} dependencies: path-type: 4.0.0 - dev: false /dns-equal/1.0.0: resolution: {integrity: sha1-s55/HabrCnW6nBcySzR1PEfgZU0=} @@ -5926,6 +5933,10 @@ packages: resolution: {integrity: sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w==} dev: false + /entities/2.1.0: + resolution: {integrity: sha512-hCx1oky9PFrJ611mf0ifBLBRW8lUUVRlFolb5gWRfIELabBlbp9xZvrqZLZAs+NxFnbfQoeGd8wDkygjg7U85w==} + dev: true + /entities/2.2.0: resolution: {integrity: sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A==} dev: false @@ -6213,7 +6224,6 @@ packages: glob-parent: 5.1.2 merge2: 1.4.1 micromatch: 4.0.4 - dev: false /fast-json-stable-stringify/2.1.0: resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==} @@ -6229,7 +6239,6 @@ packages: resolution: {integrity: sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==} dependencies: reusify: 1.0.4 - dev: false /faye-websocket/0.11.4: resolution: {integrity: sha512-CzbClwlXAuiRQAlUyfqPgvPoNKTckTPGfwZV4ZdAhVcP2lh9KUxJg2b5GkE7XbjKQ3YJnQ9z6D9ntLAlB+tP8g==} @@ -6320,7 +6329,6 @@ packages: engines: {node: '>=8'} dependencies: to-regex-range: 5.0.1 - dev: false /finalhandler/1.1.2: resolution: {integrity: sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==} @@ -6589,7 +6597,6 @@ packages: engines: {node: '>= 6'} dependencies: is-glob: 4.0.3 - dev: false /glob-parent/6.0.2: resolution: {integrity: sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==} @@ -6660,11 +6667,23 @@ packages: array-union: 2.1.0 dir-glob: 3.0.1 fast-glob: 3.2.7 - ignore: 5.1.8 + ignore: 5.2.0 merge2: 1.4.1 slash: 3.0.0 dev: false + /globby/12.1.0: + resolution: {integrity: sha512-YULDaNwsoUZkRy9TWSY/M7Obh0abamTKoKzTfOI3uU+hfpX2FZqOq8LFDxsjYheF1RH7ITdArgbQnsNBFgcdBA==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + dependencies: + array-union: 3.0.1 + dir-glob: 3.0.1 + fast-glob: 3.2.7 + ignore: 5.2.0 + merge2: 1.4.1 + slash: 4.0.0 + dev: true + /globby/6.1.0: resolution: {integrity: sha1-9abXDoOV4hyFj7BInWTfAkJNUGw=} engines: {node: '>=0.10.0'} @@ -7082,6 +7101,12 @@ packages: engines: {node: '>=10.17.0'} dev: false + /husky/7.0.4: + resolution: {integrity: sha512-vbaCKN2QLtP/vD4yvs6iz6hBEo6wkSzs8HpRah1Z6aGmF2KW5PdYuAd7uX5a+OyBZHBhd+TFLqgjUgytQr4RvQ==} + engines: {node: '>=12'} + hasBin: true + dev: true + /iconv-lite/0.4.24: resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==} engines: {node: '>=0.10.0'} @@ -7103,6 +7128,10 @@ packages: engines: {node: '>= 4'} dev: false + /ignore/5.2.0: + resolution: {integrity: sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==} + engines: {node: '>= 4'} + /immer/8.0.1: resolution: {integrity: sha512-aqXhGP7//Gui2+UrEtvxZxSquQVXTpZ7KDxfCcKAF3Vysvw0CViVaW9RZ1j1xlIYqaaaipBoqdqeibkc18PNvA==} dev: false @@ -7378,7 +7407,6 @@ packages: /is-extglob/2.1.1: resolution: {integrity: sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=} engines: {node: '>=0.10.0'} - dev: false /is-fullwidth-code-point/2.0.0: resolution: {integrity: sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=} @@ -7402,7 +7430,6 @@ packages: engines: {node: '>=0.10.0'} dependencies: is-extglob: 2.1.1 - dev: false /is-hexadecimal/1.0.4: resolution: {integrity: sha512-gyPJuv83bHMpocVYoqof5VDiZveEoGoFL8m3BXNb2VW8Xs+rz9kqO8LOQ5DH6EsuvilT1ApazU0pyl+ytbPtlw==} @@ -7443,7 +7470,6 @@ packages: /is-number/7.0.0: resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} engines: {node: '>=0.12.0'} - dev: false /is-obj/1.0.1: resolution: {integrity: sha1-PkcprB9f3gJc19g6iW2rn09n2w8=} @@ -7779,6 +7805,12 @@ packages: resolution: {integrity: sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=} dev: false + /linkify-it/3.0.3: + resolution: {integrity: sha512-ynTsyrFSdE5oZ/O9GEf00kPngmOfVwazR5GKDq6EYfhlpFug3J2zybX56a2PRRpc9P+FuSoGNAwjlbDs9jJBPQ==} + dependencies: + uc.micro: 1.0.6 + dev: true + /loader-runner/4.2.0: resolution: {integrity: sha512-92+huvxMvYlMzMt0iIOukcwYBFpkYJdpl2xsZ7LrlayO7E8SOv+JJUEK17B/dJIHAOLMfh2dZZ/Y18WgmGtYNw==} engines: {node: '>=6.11.5'} @@ -7960,6 +7992,50 @@ packages: resolution: {integrity: sha512-8z4efJYk43E0upd0NbVXwgSTQs6cT3T06etieCMEg7dRbzCbxUCK/GHlX8mhHRDcp+OLlHkPKsvqQTCvsRl2cg==} dev: false + /markdown-it/12.3.2: + resolution: {integrity: sha512-TchMembfxfNVpHkbtriWltGWc+m3xszaRD0CZup7GFFhzIgQqxIfn3eGj1yZpfuflzPvfkt611B2Q/Bsk1YnGg==} + hasBin: true + dependencies: + argparse: 2.0.1 + entities: 2.1.0 + linkify-it: 3.0.3 + mdurl: 1.0.1 + uc.micro: 1.0.6 + dev: true + + /markdownlint-cli2-formatter-default/0.0.3_markdownlint-cli2@0.4.0: + resolution: {integrity: sha512-QEAJitT5eqX1SNboOD+SO/LNBpu4P4je8JlR02ug2cLQAqmIhh8IJnSK7AcaHBHhNADqdGydnPpQOpsNcEEqCw==} + peerDependencies: + markdownlint-cli2: '>=0.0.4' + dependencies: + markdownlint-cli2: 0.4.0 + dev: true + + /markdownlint-cli2/0.4.0: + resolution: {integrity: sha512-EcwP5tAbyzzL3ACI0L16LqbNctmh8wNX56T+aVvIxWyTAkwbYNx2V7IheRkXS3mE7R/pnaApZ/RSXcXuzRVPjg==} + engines: {node: '>=12'} + hasBin: true + dependencies: + globby: 12.1.0 + markdownlint: 0.25.1 + markdownlint-cli2-formatter-default: 0.0.3_markdownlint-cli2@0.4.0 + markdownlint-rule-helpers: 0.16.0 + micromatch: 4.0.4 + strip-json-comments: 4.0.0 + yaml: 1.10.2 + dev: true + + /markdownlint-rule-helpers/0.16.0: + resolution: {integrity: sha512-oEacRUVeTJ5D5hW1UYd2qExYI0oELdYK72k1TKGvIeYJIbqQWAz476NAc7LNixSySUhcNl++d02DvX0ccDk9/w==} + dev: true + + /markdownlint/0.25.1: + resolution: {integrity: sha512-AG7UkLzNa1fxiOv5B+owPsPhtM4D6DoODhsJgiaNg1xowXovrYgOnLqAgOOFQpWOlHFVQUzjMY5ypNNTeov92g==} + engines: {node: '>=12'} + dependencies: + markdown-it: 12.3.2 + dev: true + /mdast-squeeze-paragraphs/4.0.0: resolution: {integrity: sha512-zxdPn69hkQ1rm4J+2Cs2j6wDEv7O17TfXTJ33tl/+JPIoEmtV9t2ZzBM5LPHE8QlHsmVD8t3vPKCyY3oH+H8MQ==} dependencies: @@ -7999,7 +8075,6 @@ packages: /mdurl/1.0.1: resolution: {integrity: sha1-/oWy7HWlkDfyrf7BAP1sYBdhFS4=} - dev: false /media-typer/0.3.0: resolution: {integrity: sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=} @@ -8031,7 +8106,6 @@ packages: /merge2/1.4.1: resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} engines: {node: '>= 8'} - dev: false /methods/1.1.2: resolution: {integrity: sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=} @@ -8067,7 +8141,6 @@ packages: dependencies: braces: 3.0.2 picomatch: 2.3.0 - dev: false /mime-db/1.33.0: resolution: {integrity: sha512-BHJ/EKruNIqJf/QahvxwQZXKygOQ256myeN/Ew+THcAa5q+PjyTTMMeNQC4DZw5AwfvelsUrA6B67NKMqXDbzQ==} @@ -8681,7 +8754,6 @@ packages: /path-type/4.0.0: resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==} engines: {node: '>=8'} - dev: false /picocolors/0.2.1: resolution: {integrity: sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA==} @@ -8694,7 +8766,6 @@ packages: /picomatch/2.3.0: resolution: {integrity: sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==} engines: {node: '>=8.6'} - dev: false /pify/2.3.0: resolution: {integrity: sha1-7RQaasBDqEnqWISY59yosVMw6Qw=} @@ -9330,7 +9401,6 @@ packages: /queue-microtask/1.2.3: resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} - dev: false /randombytes/2.1.0: resolution: {integrity: sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==} @@ -9927,7 +9997,6 @@ packages: /reusify/1.0.4: resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} engines: {iojs: '>=1.0.0', node: '>=0.10.0'} - dev: false /rimraf/2.7.1: resolution: {integrity: sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==} @@ -9962,7 +10031,6 @@ packages: resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} dependencies: queue-microtask: 1.2.3 - dev: false /rxjs/6.6.7: resolution: {integrity: sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==} @@ -10279,6 +10347,11 @@ packages: engines: {node: '>=8'} dev: false + /slash/4.0.0: + resolution: {integrity: sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==} + engines: {node: '>=12'} + dev: true + /snapdragon-node/2.1.1: resolution: {integrity: sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==} engines: {node: '>=0.10.0'} @@ -10589,6 +10662,11 @@ packages: engines: {node: '>=8'} dev: false + /strip-json-comments/4.0.0: + resolution: {integrity: sha512-LzWcbfMbAsEDTRmhjWIioe8GcDRl0fa35YMXFoJKDdiD/quGFmjJjdgPjFJJNwCMaLyQqFIDqCdHD2V4HfLgYA==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + dev: true + /style-to-object/0.3.0: resolution: {integrity: sha512-CzFnRRXhzWIdItT3OmF8SQfWyahHhjq3HwcMNCNLn+N7klOOqPjMeG/4JSu77D7ypZdGvSzvkrbyeTMizz2VrA==} dependencies: @@ -10778,7 +10856,6 @@ packages: engines: {node: '>=8.0'} dependencies: is-number: 7.0.0 - dev: false /to-regex/3.0.2: resolution: {integrity: sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==} @@ -10856,6 +10933,10 @@ packages: resolution: {integrity: sha512-6Gurc1n//gjp9eQNXjD9O3M/sMwVtN5S8Lv9bvOYBfKfDNiIIhqiyi01vMBO45u4zkDE420w/e0se7Vs+sIg+g==} dev: false + /uc.micro/1.0.6: + resolution: {integrity: sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==} + dev: true + /unbox-primitive/1.0.1: resolution: {integrity: sha512-tZU/3NqK3dA5gpE1KtyiJUrEB0lxnGkMFHptJ7q6ewdZ8s12QrODwNbhIJStmJkd1QDXa1NRA8aF2A1zk/Ypyw==} dependencies: @@ -11629,7 +11710,6 @@ packages: /yaml/1.10.2: resolution: {integrity: sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==} engines: {node: '>= 6'} - dev: false /yargs-parser/13.1.2: resolution: {integrity: sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==} diff --git a/versioned_docs/version-1.4.17/about.md b/versioned_docs/version-1.4.17/about.md index 724ece6..d0eb731 100644 --- a/versioned_docs/version-1.4.17/about.md +++ b/versioned_docs/version-1.4.17/about.md @@ -13,4 +13,4 @@ description: 关于本文档站点的一些说明 如果你发现文档中有不正确或者需要添加的内容,非常欢迎参与到文档编辑当中。 ::: -当前文档的仓库地址为 [halo-dev/docs](https://github.com/halo-dev/docs) ,所以你可以 fork 此仓库,修改之后提交 `Pull request` 等待我们合并即可。 \ No newline at end of file +当前文档的仓库地址为 [halo-dev/docs](https://github.com/halo-dev/docs) ,所以你可以 fork 此仓库,修改之后提交 `Pull request` 等待我们合并即可。 diff --git a/versioned_docs/version-1.4.17/contribution/issue.md b/versioned_docs/version-1.4.17/contribution/issue.md index 83a9d3a..6ab45dd 100644 --- a/versioned_docs/version-1.4.17/contribution/issue.md +++ b/versioned_docs/version-1.4.17/contribution/issue.md @@ -9,7 +9,7 @@ description: 问题反馈渠道及指南 ## GitHub Issues -链接:https://github.com/halo-dev/halo/issues +链接: 如果你在使用过程中,遇到了一些 bug 或者需要添加某些新特性,请尽量在 GitHub Issues 进行反馈,这非常有助于我们跟踪解决此问题,您也可以很方便的接收到处理状态。 @@ -23,6 +23,6 @@ description: 问题反馈渠道及指南 ## Halo 官方社区 -链接:https://bbs.halo.run +链接: -此平台主要目的用于与其他 Halo 用户进行交流。但如果您对 GitHub 不是很熟悉或者没有账号,您也可以在此平台进行反馈。 \ No newline at end of file +此平台主要目的用于与其他 Halo 用户进行交流。但如果您对 GitHub 不是很熟悉或者没有账号,您也可以在此平台进行反馈。 diff --git a/versioned_docs/version-1.4.17/developer-guide/core/code-style.md b/versioned_docs/version-1.4.17/developer-guide/core/code-style.md index 25039d3..eb0cdd7 100644 --- a/versioned_docs/version-1.4.17/developer-guide/core/code-style.md +++ b/versioned_docs/version-1.4.17/developer-guide/core/code-style.md @@ -26,4 +26,4 @@ Halo 添加了 checkstyle 插件,来保证每位提交者代码的风格保持 - 选择 `./config/checkstyle/checkstyle.xml` 配置文件,点击确定即可。 -至此,有关代码风格检查工具和格式化配置已经完成。 \ No newline at end of file +至此,有关代码风格检查工具和格式化配置已经完成。 diff --git a/versioned_docs/version-1.4.17/developer-guide/core/prepare.md b/versioned_docs/version-1.4.17/developer-guide/core/prepare.md index efa091b..7c07c48 100644 --- a/versioned_docs/version-1.4.17/developer-guide/core/prepare.md +++ b/versioned_docs/version-1.4.17/developer-guide/core/prepare.md @@ -9,7 +9,7 @@ description: 开发环境的一些说明 2. 工具:[Gradle](https://gradle.org/),[Lombok](https://projectlombok.org/) 插件 3. JDK:`11+` -> 推荐 IntelliJ IDEA 社区版(开源免费)https://github.com/JetBrains/intellij-community +> 推荐 IntelliJ IDEA 社区版(开源免费) `Halo` 项目使用了 `Lombok`,运行 `Halo` 之前请检查 `IDE` 是否已经安装好了 `Lombok` 插件。 diff --git a/versioned_docs/version-1.4.17/developer-guide/core/structure.md b/versioned_docs/version-1.4.17/developer-guide/core/structure.md index 6dbb1c5..a080fdc 100644 --- a/versioned_docs/version-1.4.17/developer-guide/core/structure.md +++ b/versioned_docs/version-1.4.17/developer-guide/core/structure.md @@ -31,11 +31,6 @@ description: Halo 项目的构成 在开发的时候,希望大家能够在 `~/halo-dev/application.yml` 中进行添加自定义配置。当然后面也会讲到如何用`运行参数` 和 `VM options` 进行控制配置,届时可根据具体情况进行选择。 - -
    -
    - +:::warning 开发的时候,我们不建议直接更改`项目源码`中的所包含的`配置文件`,包括 `application.yml`、`application-dev.yml`、`application-test.yml` 和 `application-user.yml`。 - -
    -
    \ No newline at end of file +::: diff --git a/versioned_docs/version-1.4.17/developer-guide/theme/config-files.md b/versioned_docs/version-1.4.17/developer-guide/theme/config-files.md index b812f1d..18f8ee4 100644 --- a/versioned_docs/version-1.4.17/developer-guide/theme/config-files.md +++ b/versioned_docs/version-1.4.17/developer-guide/theme/config-files.md @@ -258,4 +258,4 @@ general: ``` -更多实例可参考:。 \ No newline at end of file +更多实例可参考:。 diff --git a/versioned_docs/version-1.4.17/developer-guide/theme/global-variable.md b/versioned_docs/version-1.4.17/developer-guide/theme/global-variable.md index 82ba72e..7ff661e 100644 --- a/versioned_docs/version-1.4.17/developer-guide/theme/global-variable.md +++ b/versioned_docs/version-1.4.17/developer-guide/theme/global-variable.md @@ -5,16 +5,15 @@ description: 系统提供的一些全局变量 ## 博客地址 -``` +```html ${blog_url!} ``` 此变量与后台博客设置中的 `博客地址` 相对应。 - ## 网站根路径 -``` +```html ${context!} ``` @@ -24,12 +23,12 @@ ${context!} 假设,我设置的 `博客地址` 为 `https://halo.run`,那么: -- 全局绝对路径为开启的状态下:https://halo.run/ +- 全局绝对路径为开启的状态下: - 全局绝对路径为关闭的状态下:/ ## 主题资源根路径 -``` +```html ${theme_base!} ``` @@ -37,7 +36,7 @@ ${theme_base!} 举个例子,你当前开发的主题为 `anatole`,当你要获取主题下 `css/style.css` 这个文件的路径,那么: -``` +```html ${theme_base!}/css/style.css ``` @@ -45,25 +44,25 @@ ${theme_base!}/css/style.css 主题名称: -``` +```html ${theme.name!} ``` 主题 git 仓库地址: -``` +```html ${theme.repo!} ``` 主题版本号: -``` +```html ${theme.version!} ``` ## 博客标题 -``` +```html ${blog_title!} ``` @@ -71,7 +70,7 @@ ${blog_title!} ## 博客 Logo -``` +```html ${blog_logo!} ``` @@ -79,7 +78,7 @@ ${blog_logo!} ## Halo 版本 -``` +```html ${version!} ``` @@ -89,37 +88,37 @@ ${version!} 昵称: -``` +```html ${user.nickname!} ``` 邮箱地址: -``` +```html ${user.email!} ``` 描述: -``` +```html ${user.description!} ``` 头像地址: -``` +```html ${user.avatar!} ``` 上次登录时间: -``` +```html ${user.expireTime!} ``` ## SEO 关键词 -``` +```html ${meta_keywords!} ``` @@ -132,16 +131,15 @@ ${meta_keywords!} ## SEO 描述 -``` +```html ${meta_description!} ``` 需要注意的是,虽然这个变量在任何页面都可以使用,但是其值可能在不同的页面是不一样的。会根据用户的设置,生成对应的值。 - ## RSS 2.0 订阅地址 -``` +```html ${rss_url!} ``` @@ -149,7 +147,7 @@ ${rss_url!} ## Atom 格式的订阅地址 -``` +```html ${atom_url!} ``` @@ -157,7 +155,7 @@ ${atom_url!} ## Xml 格式的网站地图地址 -``` +```html ${sitemap_xml_url!} ``` @@ -165,7 +163,7 @@ ${sitemap_xml_url!} ## HTML 格式的网站地图地址 -``` +```html ${sitemap_html_url!} ``` @@ -173,7 +171,7 @@ ${sitemap_html_url!} ## 友情链接页面地址 -``` +```html ${links_url!} ``` @@ -184,7 +182,7 @@ ${links_url!} ## 图库页面地址 -``` +```html ${photos_url!} ``` @@ -195,7 +193,7 @@ ${photos_url!} ## 日志页面地址 -``` +```html ${journals_url!} ``` @@ -206,7 +204,7 @@ ${journals_url!} ## 文章归档页面地址 -``` +```html ${archives_url!} ``` @@ -217,7 +215,7 @@ ${archives_url!} ## 分类列表页面地址 -``` +```html ${categories_url!} ``` @@ -228,7 +226,7 @@ ${categories_url!} ## 标签列表页面地址 -``` +```html ${tags_url!} ``` @@ -258,6 +256,6 @@ ${tags_url!} ```html <#if is_index??> - 当前页面是首页 + 当前页面是首页 ``` diff --git a/versioned_docs/version-1.4.17/developer-guide/theme/page-variable.md b/versioned_docs/version-1.4.17/developer-guide/theme/page-variable.md index a2d8320..555be22 100644 --- a/versioned_docs/version-1.4.17/developer-guide/theme/page-variable.md +++ b/versioned_docs/version-1.4.17/developer-guide/theme/page-variable.md @@ -21,69 +21,69 @@ description: 每个页面所返回的变量 ```json [{ - "content": [{ - "categories": [{ - "createTime": "2020-10-13T13:23:39.143Z", - "description": "string", - "fullPath": "string", - "id": 0, - "name": "string", - "parentId": 0, - "slug": "string", - "thumbnail": "string" - }], - "commentCount": 0, - "createTime": "2020-10-13T13:23:39.143Z", - "disallowComment": true, - "editTime": "2020-10-13T13:23:39.143Z", - "editorType": "MARKDOWN", - "fullPath": "string", - "id": 0, - "likes": 0, - "metaDescription": "string", - "metaKeywords": "string", - "metas": {}, - "password": "string", - "slug": "string", - "status": "PUBLISHED", - "summary": "string", - "tags": [{ - "createTime": "2020-10-13T13:23:39.143Z", - "fullPath": "string", - "id": 0, - "name": "string", - "slug": "string", - "thumbnail": "string" - }], - "template": "string", - "thumbnail": "string", - "title": "string", - "topPriority": 0, - "topped": true, - "updateTime": "2020-10-13T13:23:39.143Z", - "visits": 0, - "wordCount": 0 - }], - "empty": true, - "first": true, - "last": true, - "number": 0, - "numberOfElements": 0, - "pageable": { - "page": 0, - "size": 0, - "sort": [ - "string" - ] - }, - "size": 0, - "sort": { - "sort": [ - "string" - ] - }, - "totalElements": 0, - "totalPages": 0 + "content": [{ + "categories": [{ + "createTime": "2020-10-13T13:23:39.143Z", + "description": "string", + "fullPath": "string", + "id": 0, + "name": "string", + "parentId": 0, + "slug": "string", + "thumbnail": "string" + }], + "commentCount": 0, + "createTime": "2020-10-13T13:23:39.143Z", + "disallowComment": true, + "editTime": "2020-10-13T13:23:39.143Z", + "editorType": "MARKDOWN", + "fullPath": "string", + "id": 0, + "likes": 0, + "metaDescription": "string", + "metaKeywords": "string", + "metas": {}, + "password": "string", + "slug": "string", + "status": "PUBLISHED", + "summary": "string", + "tags": [{ + "createTime": "2020-10-13T13:23:39.143Z", + "fullPath": "string", + "id": 0, + "name": "string", + "slug": "string", + "thumbnail": "string" + }], + "template": "string", + "thumbnail": "string", + "title": "string", + "topPriority": 0, + "topped": true, + "updateTime": "2020-10-13T13:23:39.143Z", + "visits": 0, + "wordCount": 0 + }], + "empty": true, + "first": true, + "last": true, + "number": 0, + "numberOfElements": 0, + "pageable": { + "page": 0, + "size": 0, + "sort": [ + "string" + ] + }, + "size": 0, + "sort": { + "sort": [ + "string" + ] + }, + "totalElements": 0, + "totalPages": 0 }] ``` @@ -93,7 +93,7 @@ description: 每个页面所返回的变量 ```html <#list posts.content as post> - ${post.title!} + ${post.title!} ``` @@ -299,7 +299,7 @@ ${prevPost.attribute} ```html <#if prevPost??> - 上一篇:${prevPost.title!} + 上一篇:${prevPost.title!} ``` @@ -397,7 +397,7 @@ ${nextPost.attribute} ```html <#if nextPost??> - 下一篇:${nextPost.title!} + 下一篇:${nextPost.title!} ``` @@ -421,15 +421,15 @@ ${nextPost.attribute} ```json [{ - "createTime": "2021-02-25T13:32:11.189Z", - "description": "string", - "fullPath": "string", - "id": 0, - "name": "string", - "parentId": 0, - "password": "string", - "slug": "string", - "thumbnail": "string" + "createTime": "2021-02-25T13:32:11.189Z", + "description": "string", + "fullPath": "string", + "id": 0, + "name": "string", + "parentId": 0, + "password": "string", + "slug": "string", + "thumbnail": "string" }] ``` @@ -439,7 +439,7 @@ ${nextPost.attribute} ```html <#list categories as category> - ${category.name!} + ${category.name!} ``` @@ -464,12 +464,12 @@ ${nextPost.attribute} ```json [{ - "createTime": "2021-02-25T13:34:48.779Z", - "fullPath": "string", - "id": 0, - "name": "string", - "slug": "string", - "thumbnail": "string" + "createTime": "2021-02-25T13:34:48.779Z", + "fullPath": "string", + "id": 0, + "name": "string", + "slug": "string", + "thumbnail": "string" }] ``` @@ -479,7 +479,7 @@ ${nextPost.attribute} ```html <#list tags as tag> - ${tag.name!} + ${tag.name!} ``` @@ -635,69 +635,69 @@ ${metas.key} ```json [{ - "content": [{ - "categories": [{ - "createTime": "2020-10-13T13:23:39.143Z", - "description": "string", - "fullPath": "string", - "id": 0, - "name": "string", - "parentId": 0, - "slug": "string", - "thumbnail": "string" - }], - "commentCount": 0, - "createTime": "2020-10-13T13:23:39.143Z", - "disallowComment": true, - "editTime": "2020-10-13T13:23:39.143Z", - "editorType": "MARKDOWN", - "fullPath": "string", - "id": 0, - "likes": 0, - "metaDescription": "string", - "metaKeywords": "string", - "metas": {}, - "password": "string", - "slug": "string", - "status": "PUBLISHED", - "summary": "string", - "tags": [{ - "createTime": "2020-10-13T13:23:39.143Z", - "fullPath": "string", - "id": 0, - "name": "string", - "slug": "string", - "thumbnail": "string" - }], - "template": "string", - "thumbnail": "string", - "title": "string", - "topPriority": 0, - "topped": true, - "updateTime": "2020-10-13T13:23:39.143Z", - "visits": 0, - "wordCount": 0 - }], - "empty": true, - "first": true, - "last": true, - "number": 0, - "numberOfElements": 0, - "pageable": { - "page": 0, - "size": 0, - "sort": [ - "string" - ] - }, - "size": 0, - "sort": { - "sort": [ - "string" - ] - }, - "totalElements": 0, - "totalPages": 0 + "content": [{ + "categories": [{ + "createTime": "2020-10-13T13:23:39.143Z", + "description": "string", + "fullPath": "string", + "id": 0, + "name": "string", + "parentId": 0, + "slug": "string", + "thumbnail": "string" + }], + "commentCount": 0, + "createTime": "2020-10-13T13:23:39.143Z", + "disallowComment": true, + "editTime": "2020-10-13T13:23:39.143Z", + "editorType": "MARKDOWN", + "fullPath": "string", + "id": 0, + "likes": 0, + "metaDescription": "string", + "metaKeywords": "string", + "metas": {}, + "password": "string", + "slug": "string", + "status": "PUBLISHED", + "summary": "string", + "tags": [{ + "createTime": "2020-10-13T13:23:39.143Z", + "fullPath": "string", + "id": 0, + "name": "string", + "slug": "string", + "thumbnail": "string" + }], + "template": "string", + "thumbnail": "string", + "title": "string", + "topPriority": 0, + "topped": true, + "updateTime": "2020-10-13T13:23:39.143Z", + "visits": 0, + "wordCount": 0 + }], + "empty": true, + "first": true, + "last": true, + "number": 0, + "numberOfElements": 0, + "pageable": { + "page": 0, + "size": 0, + "sort": [ + "string" + ] + }, + "size": 0, + "sort": { + "sort": [ + "string" + ] + }, + "totalElements": 0, + "totalPages": 0 }] ``` @@ -707,7 +707,7 @@ ${metas.key} ```html <#list posts.content as post> - ${post.title!} + ${post.title!} ``` @@ -733,62 +733,62 @@ ${metas.key} ```json { - "content": [{ - "posts": [{ - "categories": [{ - "createTime": "2021-03-07T05:45:06.271Z", - "description": "string", - "fullPath": "string", - "id": 0, - "name": "string", - "parentId": 0, - "password": "string", - "slug": "string", - "thumbnail": "string" - }], - "commentCount": 0, - "createTime": "2021-03-07T05:45:06.271Z", - "disallowComment": true, - "editTime": "2021-03-07T05:45:06.271Z", - "editorType": "MARKDOWN", - "fullPath": "string", - "id": 0, - "likes": 0, - "metaDescription": "string", - "metaKeywords": "string", - "metas": {}, - "password": "string", - "slug": "string", - "status": "DRAFT", - "summary": "string", - "tags": [{ - "createTime": "2021-03-07T05:45:06.271Z", - "fullPath": "string", - "id": 0, - "name": "string", - "slug": "string", - "thumbnail": "string" - }], - "template": "string", - "thumbnail": "string", - "title": "string", - "topPriority": 0, - "topped": true, - "updateTime": "2021-03-07T05:45:06.271Z", - "visits": 0, - "wordCount": 0 - }], - "year": 0 - }], - "hasContent": true, - "hasNext": true, - "hasPrevious": true, - "isEmpty": true, - "isFirst": true, - "page": 0, - "pages": 0, - "rpp": 0, - "total": 0 + "content": [{ + "posts": [{ + "categories": [{ + "createTime": "2021-03-07T05:45:06.271Z", + "description": "string", + "fullPath": "string", + "id": 0, + "name": "string", + "parentId": 0, + "password": "string", + "slug": "string", + "thumbnail": "string" + }], + "commentCount": 0, + "createTime": "2021-03-07T05:45:06.271Z", + "disallowComment": true, + "editTime": "2021-03-07T05:45:06.271Z", + "editorType": "MARKDOWN", + "fullPath": "string", + "id": 0, + "likes": 0, + "metaDescription": "string", + "metaKeywords": "string", + "metas": {}, + "password": "string", + "slug": "string", + "status": "DRAFT", + "summary": "string", + "tags": [{ + "createTime": "2021-03-07T05:45:06.271Z", + "fullPath": "string", + "id": 0, + "name": "string", + "slug": "string", + "thumbnail": "string" + }], + "template": "string", + "thumbnail": "string", + "title": "string", + "topPriority": 0, + "topped": true, + "updateTime": "2021-03-07T05:45:06.271Z", + "visits": 0, + "wordCount": 0 + }], + "year": 0 + }], + "hasContent": true, + "hasNext": true, + "hasPrevious": true, + "isEmpty": true, + "isFirst": true, + "page": 0, + "pages": 0, + "rpp": 0, + "total": 0 } ``` @@ -800,7 +800,7 @@ ${metas.key} <#list archives.content as archive>

    ${archive.year?c}

    <#list archive.posts as post> - ${post.title!} + ${post.title!} ``` @@ -842,69 +842,69 @@ ${metas.key} ```json [{ - "content": [{ - "categories": [{ - "createTime": "2020-10-13T13:23:39.143Z", - "description": "string", - "fullPath": "string", - "id": 0, - "name": "string", - "parentId": 0, - "slug": "string", - "thumbnail": "string" - }], - "commentCount": 0, - "createTime": "2020-10-13T13:23:39.143Z", - "disallowComment": true, - "editTime": "2020-10-13T13:23:39.143Z", - "editorType": "MARKDOWN", - "fullPath": "string", - "id": 0, - "likes": 0, - "metaDescription": "string", - "metaKeywords": "string", - "metas": {}, - "password": "string", - "slug": "string", - "status": "PUBLISHED", - "summary": "string", - "tags": [{ - "createTime": "2020-10-13T13:23:39.143Z", - "fullPath": "string", - "id": 0, - "name": "string", - "slug": "string", - "thumbnail": "string" - }], - "template": "string", - "thumbnail": "string", - "title": "string", - "topPriority": 0, - "topped": true, - "updateTime": "2020-10-13T13:23:39.143Z", - "visits": 0, - "wordCount": 0 - }], - "empty": true, - "first": true, - "last": true, - "number": 0, - "numberOfElements": 0, - "pageable": { - "page": 0, - "size": 0, - "sort": [ - "string" - ] - }, - "size": 0, - "sort": { - "sort": [ - "string" - ] - }, - "totalElements": 0, - "totalPages": 0 + "content": [{ + "categories": [{ + "createTime": "2020-10-13T13:23:39.143Z", + "description": "string", + "fullPath": "string", + "id": 0, + "name": "string", + "parentId": 0, + "slug": "string", + "thumbnail": "string" + }], + "commentCount": 0, + "createTime": "2020-10-13T13:23:39.143Z", + "disallowComment": true, + "editTime": "2020-10-13T13:23:39.143Z", + "editorType": "MARKDOWN", + "fullPath": "string", + "id": 0, + "likes": 0, + "metaDescription": "string", + "metaKeywords": "string", + "metas": {}, + "password": "string", + "slug": "string", + "status": "PUBLISHED", + "summary": "string", + "tags": [{ + "createTime": "2020-10-13T13:23:39.143Z", + "fullPath": "string", + "id": 0, + "name": "string", + "slug": "string", + "thumbnail": "string" + }], + "template": "string", + "thumbnail": "string", + "title": "string", + "topPriority": 0, + "topped": true, + "updateTime": "2020-10-13T13:23:39.143Z", + "visits": 0, + "wordCount": 0 + }], + "empty": true, + "first": true, + "last": true, + "number": 0, + "numberOfElements": 0, + "pageable": { + "page": 0, + "size": 0, + "sort": [ + "string" + ] + }, + "size": 0, + "sort": { + "sort": [ + "string" + ] + }, + "totalElements": 0, + "totalPages": 0 }] ``` @@ -914,7 +914,7 @@ ${metas.key} ```html <#list posts.content as post> - ${post.title!} + ${post.title!} ``` @@ -940,15 +940,15 @@ ${category.attribute} ```json { - "createTime": "2020-10-11T05:59:40.622Z", - "description": "string", - "fullPath": "string", - "id": 0, - "name": "string", - "parentId": 0, - "slug": "string", - "thumbnail": "string", - "postCount": 0 + "createTime": "2020-10-11T05:59:40.622Z", + "description": "string", + "fullPath": "string", + "id": 0, + "name": "string", + "parentId": 0, + "slug": "string", + "thumbnail": "string", + "postCount": 0 } ``` @@ -988,69 +988,69 @@ ${category.attribute} ```json [{ - "content": [{ - "categories": [{ - "createTime": "2020-10-13T13:23:39.143Z", - "description": "string", - "fullPath": "string", - "id": 0, - "name": "string", - "parentId": 0, - "slug": "string", - "thumbnail": "string" - }], - "commentCount": 0, - "createTime": "2020-10-13T13:23:39.143Z", - "disallowComment": true, - "editTime": "2020-10-13T13:23:39.143Z", - "editorType": "MARKDOWN", - "fullPath": "string", - "id": 0, - "likes": 0, - "metaDescription": "string", - "metaKeywords": "string", - "metas": {}, - "password": "string", - "slug": "string", - "status": "PUBLISHED", - "summary": "string", - "tags": [{ - "createTime": "2020-10-13T13:23:39.143Z", - "fullPath": "string", - "id": 0, - "name": "string", - "slug": "string", - "thumbnail": "string" - }], - "template": "string", - "thumbnail": "string", - "title": "string", - "topPriority": 0, - "topped": true, - "updateTime": "2020-10-13T13:23:39.143Z", - "visits": 0, - "wordCount": 0 - }], - "empty": true, - "first": true, - "last": true, - "number": 0, - "numberOfElements": 0, - "pageable": { - "page": 0, - "size": 0, - "sort": [ - "string" - ] - }, - "size": 0, - "sort": { - "sort": [ - "string" - ] - }, - "totalElements": 0, - "totalPages": 0 + "content": [{ + "categories": [{ + "createTime": "2020-10-13T13:23:39.143Z", + "description": "string", + "fullPath": "string", + "id": 0, + "name": "string", + "parentId": 0, + "slug": "string", + "thumbnail": "string" + }], + "commentCount": 0, + "createTime": "2020-10-13T13:23:39.143Z", + "disallowComment": true, + "editTime": "2020-10-13T13:23:39.143Z", + "editorType": "MARKDOWN", + "fullPath": "string", + "id": 0, + "likes": 0, + "metaDescription": "string", + "metaKeywords": "string", + "metas": {}, + "password": "string", + "slug": "string", + "status": "PUBLISHED", + "summary": "string", + "tags": [{ + "createTime": "2020-10-13T13:23:39.143Z", + "fullPath": "string", + "id": 0, + "name": "string", + "slug": "string", + "thumbnail": "string" + }], + "template": "string", + "thumbnail": "string", + "title": "string", + "topPriority": 0, + "topped": true, + "updateTime": "2020-10-13T13:23:39.143Z", + "visits": 0, + "wordCount": 0 + }], + "empty": true, + "first": true, + "last": true, + "number": 0, + "numberOfElements": 0, + "pageable": { + "page": 0, + "size": 0, + "sort": [ + "string" + ] + }, + "size": 0, + "sort": { + "sort": [ + "string" + ] + }, + "totalElements": 0, + "totalPages": 0 }] ``` @@ -1060,7 +1060,7 @@ ${category.attribute} ```html <#list posts.content as post> - ${post.title!} + ${post.title!} ``` @@ -1086,12 +1086,12 @@ ${tag.attribute} ```json { - "createTime": "2020-10-11T06:14:30.595Z", - "fullPath": "string", - "id": 0, - "name": "string", - "slug": "string", - "thumbnail": "string" + "createTime": "2020-10-11T06:14:30.595Z", + "fullPath": "string", + "id": 0, + "name": "string", + "slug": "string", + "thumbnail": "string" } ``` @@ -1143,69 +1143,69 @@ ${keyword!} ```json [{ - "content": [{ - "categories": [{ - "createTime": "2020-10-13T13:23:39.143Z", - "description": "string", - "fullPath": "string", - "id": 0, - "name": "string", - "parentId": 0, - "slug": "string", - "thumbnail": "string" - }], - "commentCount": 0, - "createTime": "2020-10-13T13:23:39.143Z", - "disallowComment": true, - "editTime": "2020-10-13T13:23:39.143Z", - "editorType": "MARKDOWN", - "fullPath": "string", - "id": 0, - "likes": 0, - "metaDescription": "string", - "metaKeywords": "string", - "metas": {}, - "password": "string", - "slug": "string", - "status": "PUBLISHED", - "summary": "string", - "tags": [{ - "createTime": "2020-10-13T13:23:39.143Z", - "fullPath": "string", - "id": 0, - "name": "string", - "slug": "string", - "thumbnail": "string" - }], - "template": "string", - "thumbnail": "string", - "title": "string", - "topPriority": 0, - "topped": true, - "updateTime": "2020-10-13T13:23:39.143Z", - "visits": 0, - "wordCount": 0 - }], - "empty": true, - "first": true, - "last": true, - "number": 0, - "numberOfElements": 0, - "pageable": { - "page": 0, - "size": 0, - "sort": [ - "string" - ] - }, - "size": 0, - "sort": { - "sort": [ - "string" - ] - }, - "totalElements": 0, - "totalPages": 0 + "content": [{ + "categories": [{ + "createTime": "2020-10-13T13:23:39.143Z", + "description": "string", + "fullPath": "string", + "id": 0, + "name": "string", + "parentId": 0, + "slug": "string", + "thumbnail": "string" + }], + "commentCount": 0, + "createTime": "2020-10-13T13:23:39.143Z", + "disallowComment": true, + "editTime": "2020-10-13T13:23:39.143Z", + "editorType": "MARKDOWN", + "fullPath": "string", + "id": 0, + "likes": 0, + "metaDescription": "string", + "metaKeywords": "string", + "metas": {}, + "password": "string", + "slug": "string", + "status": "PUBLISHED", + "summary": "string", + "tags": [{ + "createTime": "2020-10-13T13:23:39.143Z", + "fullPath": "string", + "id": 0, + "name": "string", + "slug": "string", + "thumbnail": "string" + }], + "template": "string", + "thumbnail": "string", + "title": "string", + "topPriority": 0, + "topped": true, + "updateTime": "2020-10-13T13:23:39.143Z", + "visits": 0, + "wordCount": 0 + }], + "empty": true, + "first": true, + "last": true, + "number": 0, + "numberOfElements": 0, + "pageable": { + "page": 0, + "size": 0, + "sort": [ + "string" + ] + }, + "size": 0, + "sort": { + "sort": [ + "string" + ] + }, + "totalElements": 0, + "totalPages": 0 }] ``` @@ -1215,7 +1215,7 @@ ${keyword!} ```html <#list posts.content as post> - ${post.title!} + ${post.title!} ``` @@ -1251,25 +1251,25 @@ ${keyword!} ```json { - "content": [{ - "description": "string", - "id": 0, - "location": "string", - "name": "string", - "takeTime": "2021-03-07T05:28:12.352Z", - "team": "string", - "thumbnail": "string", - "url": "string" - }], - "hasContent": true, - "hasNext": true, - "hasPrevious": true, - "isEmpty": true, - "isFirst": true, - "page": 0, - "pages": 0, - "rpp": 0, - "total": 0 + "content": [{ + "description": "string", + "id": 0, + "location": "string", + "name": "string", + "takeTime": "2021-03-07T05:28:12.352Z", + "team": "string", + "thumbnail": "string", + "url": "string" + }], + "hasContent": true, + "hasNext": true, + "hasPrevious": true, + "isEmpty": true, + "isFirst": true, + "page": 0, + "pages": 0, + "rpp": 0, + "total": 0 } ``` @@ -1277,7 +1277,7 @@ ${keyword!} ```html <#list photos.content as photo> - ${photo.description!} + ${photo.description!} ``` @@ -1307,24 +1307,24 @@ ${keyword!} ```json { - "content": [{ - "commentCount": 0, - "content": "string", - "createTime": "2021-03-07T05:32:06.365Z", - "id": 0, - "likes": 0, - "sourceContent": "string", - "type": "INTIMATE" - }], - "hasContent": true, - "hasNext": true, - "hasPrevious": true, - "isEmpty": true, - "isFirst": true, - "page": 0, - "pages": 0, - "rpp": 0, - "total": 0 + "content": [{ + "commentCount": 0, + "content": "string", + "createTime": "2021-03-07T05:32:06.365Z", + "id": 0, + "likes": 0, + "sourceContent": "string", + "type": "INTIMATE" + }], + "hasContent": true, + "hasNext": true, + "hasPrevious": true, + "isEmpty": true, + "isFirst": true, + "page": 0, + "pages": 0, + "rpp": 0, + "total": 0 } ``` @@ -1334,7 +1334,7 @@ ${keyword!}
      <#list journals.content as journal>
    • - ${journal.createTime?string('yyyy年MM月dd日')}:${journal.content!} + ${journal.createTime?string('yyyy年MM月dd日')}:${journal.content!}
    @@ -1345,10 +1345,10 @@ ${keyword!} ```html
    • - 2021年3月7日:内容1 + 2021年3月7日:内容1
    • - 2021年3月7日:内容2 + 2021年3月7日:内容2
    ``` diff --git a/versioned_docs/version-1.4.17/developer-guide/theme/prepare.md b/versioned_docs/version-1.4.17/developer-guide/theme/prepare.md index 9941028..a7e3b19 100644 --- a/versioned_docs/version-1.4.17/developer-guide/theme/prepare.md +++ b/versioned_docs/version-1.4.17/developer-guide/theme/prepare.md @@ -44,7 +44,7 @@ Halo 的运行可参考上述 [系统开发](/developer-guide/core/prepare), > 为了让开发更加规范,我们推荐使用以下的目录结构。 -``` +```txt ├── module // 公共模板目录 │   ├── comment.ftl // 比如:评论模板 │   ├── layout.ftl // 比如:布局模板 @@ -73,4 +73,4 @@ Halo 的运行可参考上述 [系统开发](/developer-guide/core/prepare), ├── screenshot.png // 主题预览图 ├── settings.yaml // 主题选项配置文件 └── theme.yaml // 主题描述文件 -``` \ No newline at end of file +``` diff --git a/versioned_docs/version-1.4.17/developer-guide/theme/public-template-tag.md b/versioned_docs/version-1.4.17/developer-guide/theme/public-template-tag.md index 98be161..515a72a 100644 --- a/versioned_docs/version-1.4.17/developer-guide/theme/public-template-tag.md +++ b/versioned_docs/version-1.4.17/developer-guide/theme/public-template-tag.md @@ -7,7 +7,7 @@ description: 系统提供的一些宏模板 ## 公共 head 模板 -> 需要注意的是,为了保证系统功能的完整性,我们强制要求在每个页面的 `` 标签下必须包含此模板。 +> 需要注意的是,为了保证系统功能的完整性,我们强制要求在每个页面的 `` 标签下必须包含此模板。 ```html <@global.head /> @@ -27,14 +27,12 @@ description: 系统提供的一些宏模板 ## 公共底部 -> 需要注意的是,为了保证系统功能的完整性,我们强制要求在每个页面的尾部必须包含此模板。 - +> 需要注意的是,为了保证系统功能的完整性,我们强制要求在每个页面的尾部必须包含此模板。 ```html <@global.footer /> ``` - 等同于: ```html @@ -51,7 +49,6 @@ description: 系统提供的一些宏模板 x 年前/x 个月前/x 天前/昨天/x 小时前/x 分钟前/x 秒前/刚刚 ``` - ## 评论模块 ```html @@ -73,23 +70,22 @@ x 年前/x 个月前/x 天前/昨天/x 小时前/x 分钟前/x 秒前/刚刚 - target:post / sheet / journal 对象 - type:评论类型,可为:post / sheet / journal - 例子: 在文章页面(post.ftl or post_xxx.ftl): -``` +```html <@global.comment target=post type="post" /> ``` 在自定义页面(sheet.ftl or post_sheet.ftl): -``` +```html <@global.comment target=sheet type="sheet" /> ``` 在日志页面(journals.ftl): -``` +```html <@global.comment target=journal type="journal" /> -``` \ No newline at end of file +``` diff --git a/versioned_docs/version-1.4.17/developer-guide/theme/template-tag.md b/versioned_docs/version-1.4.17/developer-guide/theme/template-tag.md index d798a2e..123e988 100644 --- a/versioned_docs/version-1.4.17/developer-guide/theme/template-tag.md +++ b/versioned_docs/version-1.4.17/developer-guide/theme/template-tag.md @@ -30,47 +30,47 @@ posts: ```json [{ - "categories": [{ - "createTime": "2020-10-11T05:22:08.264Z", - "description": "string", - "fullPath": "string", - "id": 0, - "name": "string", - "parentId": 0, - "slug": "string", - "thumbnail": "string" - }], - "commentCount": 0, - "createTime": "2020-10-11T05:22:08.264Z", - "disallowComment": true, - "editTime": "2020-10-11T05:22:08.264Z", - "editorType": "MARKDOWN", - "fullPath": "string", - "id": 0, - "likes": 0, - "metaDescription": "string", - "metaKeywords": "string", - "metas": {}, - "password": "string", - "slug": "string", - "status": "PUBLISHED", - "summary": "string", - "tags": [{ - "createTime": "2020-10-11T05:22:08.264Z", - "fullPath": "string", - "id": 0, - "name": "string", - "slug": "string", - "thumbnail": "string" - }], - "template": "string", - "thumbnail": "string", - "title": "string", - "topPriority": 0, - "topped": true, - "updateTime": "2020-10-11T05:22:08.264Z", - "visits": 0, - "wordCount": 0 + "categories": [{ + "createTime": "2020-10-11T05:22:08.264Z", + "description": "string", + "fullPath": "string", + "id": 0, + "name": "string", + "parentId": 0, + "slug": "string", + "thumbnail": "string" + }], + "commentCount": 0, + "createTime": "2020-10-11T05:22:08.264Z", + "disallowComment": true, + "editTime": "2020-10-11T05:22:08.264Z", + "editorType": "MARKDOWN", + "fullPath": "string", + "id": 0, + "likes": 0, + "metaDescription": "string", + "metaKeywords": "string", + "metas": {}, + "password": "string", + "slug": "string", + "status": "PUBLISHED", + "summary": "string", + "tags": [{ + "createTime": "2020-10-11T05:22:08.264Z", + "fullPath": "string", + "id": 0, + "name": "string", + "slug": "string", + "thumbnail": "string" + }], + "template": "string", + "thumbnail": "string", + "title": "string", + "topPriority": 0, + "topped": true, + "updateTime": "2020-10-11T05:22:08.264Z", + "visits": 0, + "wordCount": 0 }] ``` @@ -146,50 +146,50 @@ archives: ```json [{ - "posts": [{ - "categories": [{ - "createTime": "2020-10-11T05:30:45.245Z", - "description": "string", - "fullPath": "string", - "id": 0, - "name": "string", - "parentId": 0, - "slug": "string", - "thumbnail": "string" - }], - "commentCount": 0, - "createTime": "2020-10-11T05:30:45.245Z", - "disallowComment": true, - "editTime": "2020-10-11T05:30:45.245Z", - "editorType": "MARKDOWN", - "fullPath": "string", - "id": 0, - "likes": 0, - "metaDescription": "string", - "metaKeywords": "string", - "metas": {}, - "password": "string", - "slug": "string", - "status": "PUBLISHED", - "summary": "string", - "tags": [{ - "createTime": "2020-10-11T05:30:45.245Z", - "fullPath": "string", - "id": 0, - "name": "string", - "slug": "string", - "thumbnail": "string" - }], - "template": "string", - "thumbnail": "string", - "title": "string", - "topPriority": 0, - "topped": true, - "updateTime": "2020-10-11T05:30:45.245Z", - "visits": 0, - "wordCount": 0 - }], - "year": 0 + "posts": [{ + "categories": [{ + "createTime": "2020-10-11T05:30:45.245Z", + "description": "string", + "fullPath": "string", + "id": 0, + "name": "string", + "parentId": 0, + "slug": "string", + "thumbnail": "string" + }], + "commentCount": 0, + "createTime": "2020-10-11T05:30:45.245Z", + "disallowComment": true, + "editTime": "2020-10-11T05:30:45.245Z", + "editorType": "MARKDOWN", + "fullPath": "string", + "id": 0, + "likes": 0, + "metaDescription": "string", + "metaKeywords": "string", + "metas": {}, + "password": "string", + "slug": "string", + "status": "PUBLISHED", + "summary": "string", + "tags": [{ + "createTime": "2020-10-11T05:30:45.245Z", + "fullPath": "string", + "id": 0, + "name": "string", + "slug": "string", + "thumbnail": "string" + }], + "template": "string", + "thumbnail": "string", + "title": "string", + "topPriority": 0, + "topped": true, + "updateTime": "2020-10-11T05:30:45.245Z", + "visits": 0, + "wordCount": 0 + }], + "year": 0 }] ``` @@ -253,51 +253,51 @@ archives: ```json [{ - "month": 0, - "posts": [{ - "categories": [{ - "createTime": "2020-10-11T05:35:01.835Z", - "description": "string", - "fullPath": "string", - "id": 0, - "name": "string", - "parentId": 0, - "slug": "string", - "thumbnail": "string" - }], - "commentCount": 0, - "createTime": "2020-10-11T05:35:01.835Z", - "disallowComment": true, - "editTime": "2020-10-11T05:35:01.835Z", - "editorType": "MARKDOWN", - "fullPath": "string", - "id": 0, - "likes": 0, - "metaDescription": "string", - "metaKeywords": "string", - "metas": {}, - "password": "string", - "slug": "string", - "status": "PUBLISHED", - "summary": "string", - "tags": [{ - "createTime": "2020-10-11T05:35:01.835Z", - "fullPath": "string", - "id": 0, - "name": "string", - "slug": "string", - "thumbnail": "string" - }], - "template": "string", - "thumbnail": "string", - "title": "string", - "topPriority": 0, - "topped": true, - "updateTime": "2020-10-11T05:35:01.835Z", - "visits": 0, - "wordCount": 0 - }], - "year": 0 + "month": 0, + "posts": [{ + "categories": [{ + "createTime": "2020-10-11T05:35:01.835Z", + "description": "string", + "fullPath": "string", + "id": 0, + "name": "string", + "parentId": 0, + "slug": "string", + "thumbnail": "string" + }], + "commentCount": 0, + "createTime": "2020-10-11T05:35:01.835Z", + "disallowComment": true, + "editTime": "2020-10-11T05:35:01.835Z", + "editorType": "MARKDOWN", + "fullPath": "string", + "id": 0, + "likes": 0, + "metaDescription": "string", + "metaKeywords": "string", + "metas": {}, + "password": "string", + "slug": "string", + "status": "PUBLISHED", + "summary": "string", + "tags": [{ + "createTime": "2020-10-11T05:35:01.835Z", + "fullPath": "string", + "id": 0, + "name": "string", + "slug": "string", + "thumbnail": "string" + }], + "template": "string", + "thumbnail": "string", + "title": "string", + "topPriority": 0, + "topped": true, + "updateTime": "2020-10-11T05:35:01.835Z", + "visits": 0, + "wordCount": 0 + }], + "year": 0 }] ``` @@ -362,103 +362,102 @@ archives(year): ```json [{ - "posts": [{ - "categories": [{ - "createTime": "2020-10-11T05:30:45.245Z", - "description": "string", - "fullPath": "string", - "id": 0, - "name": "string", - "parentId": 0, - "slug": "string", - "thumbnail": "string" - }], - "commentCount": 0, - "createTime": "2020-10-11T05:30:45.245Z", - "disallowComment": true, - "editTime": "2020-10-11T05:30:45.245Z", - "editorType": "MARKDOWN", - "fullPath": "string", - "id": 0, - "likes": 0, - "metaDescription": "string", - "metaKeywords": "string", - "metas": {}, - "password": "string", - "slug": "string", - "status": "PUBLISHED", - "summary": "string", - "tags": [{ - "createTime": "2020-10-11T05:30:45.245Z", - "fullPath": "string", - "id": 0, - "name": "string", - "slug": "string", - "thumbnail": "string" - }], - "template": "string", - "thumbnail": "string", - "title": "string", - "topPriority": 0, - "topped": true, - "updateTime": "2020-10-11T05:30:45.245Z", - "visits": 0, - "wordCount": 0 - }], - "year": 0 + "posts": [{ + "categories": [{ + "createTime": "2020-10-11T05:30:45.245Z", + "description": "string", + "fullPath": "string", + "id": 0, + "name": "string", + "parentId": 0, + "slug": "string", + "thumbnail": "string" + }], + "commentCount": 0, + "createTime": "2020-10-11T05:30:45.245Z", + "disallowComment": true, + "editTime": "2020-10-11T05:30:45.245Z", + "editorType": "MARKDOWN", + "fullPath": "string", + "id": 0, + "likes": 0, + "metaDescription": "string", + "metaKeywords": "string", + "metas": {}, + "password": "string", + "slug": "string", + "status": "PUBLISHED", + "summary": "string", + "tags": [{ + "createTime": "2020-10-11T05:30:45.245Z", + "fullPath": "string", + "id": 0, + "name": "string", + "slug": "string", + "thumbnail": "string" + }], + "template": "string", + "thumbnail": "string", + "title": "string", + "topPriority": 0, + "topped": true, + "updateTime": "2020-10-11T05:30:45.245Z", + "visits": 0, + "wordCount": 0 + }], + "year": 0 }] ``` archives(month): - ```json [{ - "month": 0, - "posts": [{ - "categories": [{ - "createTime": "2020-10-11T05:35:01.835Z", - "description": "string", - "fullPath": "string", - "id": 0, - "name": "string", - "parentId": 0, - "slug": "string", - "thumbnail": "string" - }], - "commentCount": 0, - "createTime": "2020-10-11T05:35:01.835Z", - "disallowComment": true, - "editTime": "2020-10-11T05:35:01.835Z", - "editorType": "MARKDOWN", - "fullPath": "string", - "id": 0, - "likes": 0, - "metaDescription": "string", - "metaKeywords": "string", - "metas": {}, - "password": "string", - "slug": "string", - "status": "PUBLISHED", - "summary": "string", - "tags": [{ - "createTime": "2020-10-11T05:35:01.835Z", - "fullPath": "string", - "id": 0, - "name": "string", - "slug": "string", - "thumbnail": "string" - }], - "template": "string", - "thumbnail": "string", - "title": "string", - "topPriority": 0, - "topped": true, - "updateTime": "2020-10-11T05:35:01.835Z", - "visits": 0, - "wordCount": 0 - }], - "year": 0 + "month": 0, + "posts": [{ + "categories": [{ + "createTime": "2020-10-11T05:35:01.835Z", + "description": "string", + "fullPath": "string", + "id": 0, + "name": "string", + "parentId": 0, + "slug": "string", + "thumbnail": "string" + }], + "commentCount": 0, + "createTime": "2020-10-11T05:35:01.835Z", + "disallowComment": true, + "editTime": "2020-10-11T05:35:01.835Z", + "editorType": "MARKDOWN", + "fullPath": "string", + "id": 0, + "likes": 0, + "metaDescription": "string", + "metaKeywords": "string", + "metas": {}, + "password": "string", + "slug": "string", + "status": "PUBLISHED", + "summary": "string", + "tags": [{ + "createTime": "2020-10-11T05:35:01.835Z", + "fullPath": "string", + "id": 0, + "name": "string", + "slug": "string", + "thumbnail": "string" + }], + "template": "string", + "thumbnail": "string", + "title": "string", + "topPriority": 0, + "topped": true, + "updateTime": "2020-10-11T05:35:01.835Z", + "visits": 0, + "wordCount": 0 + }], + "year": 0 }] ``` @@ -523,47 +522,47 @@ posts: ```json [{ - "categories": [{ - "createTime": "2020-10-11T05:35:01.811Z", - "description": "string", - "fullPath": "string", - "id": 0, - "name": "string", - "parentId": 0, - "slug": "string", - "thumbnail": "string" - }], - "commentCount": 0, - "createTime": "2020-10-11T05:35:01.811Z", - "disallowComment": true, - "editTime": "2020-10-11T05:35:01.811Z", - "editorType": "MARKDOWN", - "fullPath": "string", - "id": 0, - "likes": 0, - "metaDescription": "string", - "metaKeywords": "string", - "metas": {}, - "password": "string", - "slug": "string", - "status": "PUBLISHED", - "summary": "string", - "tags": [{ - "createTime": "2020-10-11T05:35:01.811Z", - "fullPath": "string", - "id": 0, - "name": "string", - "slug": "string", - "thumbnail": "string" - }], - "template": "string", - "thumbnail": "string", - "title": "string", - "topPriority": 0, - "topped": true, - "updateTime": "2020-10-11T05:35:01.811Z", - "visits": 0, - "wordCount": 0 + "categories": [{ + "createTime": "2020-10-11T05:35:01.811Z", + "description": "string", + "fullPath": "string", + "id": 0, + "name": "string", + "parentId": 0, + "slug": "string", + "thumbnail": "string" + }], + "commentCount": 0, + "createTime": "2020-10-11T05:35:01.811Z", + "disallowComment": true, + "editTime": "2020-10-11T05:35:01.811Z", + "editorType": "MARKDOWN", + "fullPath": "string", + "id": 0, + "likes": 0, + "metaDescription": "string", + "metaKeywords": "string", + "metas": {}, + "password": "string", + "slug": "string", + "status": "PUBLISHED", + "summary": "string", + "tags": [{ + "createTime": "2020-10-11T05:35:01.811Z", + "fullPath": "string", + "id": 0, + "name": "string", + "slug": "string", + "thumbnail": "string" + }], + "template": "string", + "thumbnail": "string", + "title": "string", + "topPriority": 0, + "topped": true, + "updateTime": "2020-10-11T05:35:01.811Z", + "visits": 0, + "wordCount": 0 }] ``` @@ -571,7 +570,7 @@ posts: ```html <@postTag method="listByCategoryId" top="${category.id?c}"> - 分类 ${category.name!} 下的文章: + 分类 ${category.name!} 下的文章: <#list posts as post> ${post.title!} @@ -607,47 +606,47 @@ posts: ```json [{ - "categories": [{ - "createTime": "2020-10-11T05:35:01.811Z", - "description": "string", - "fullPath": "string", - "id": 0, - "name": "string", - "parentId": 0, - "slug": "string", - "thumbnail": "string" - }], - "commentCount": 0, - "createTime": "2020-10-11T05:35:01.811Z", - "disallowComment": true, - "editTime": "2020-10-11T05:35:01.811Z", - "editorType": "MARKDOWN", - "fullPath": "string", - "id": 0, - "likes": 0, - "metaDescription": "string", - "metaKeywords": "string", - "metas": {}, - "password": "string", - "slug": "string", - "status": "PUBLISHED", - "summary": "string", - "tags": [{ - "createTime": "2020-10-11T05:35:01.811Z", - "fullPath": "string", - "id": 0, - "name": "string", - "slug": "string", - "thumbnail": "string" - }], - "template": "string", - "thumbnail": "string", - "title": "string", - "topPriority": 0, - "topped": true, - "updateTime": "2020-10-11T05:35:01.811Z", - "visits": 0, - "wordCount": 0 + "categories": [{ + "createTime": "2020-10-11T05:35:01.811Z", + "description": "string", + "fullPath": "string", + "id": 0, + "name": "string", + "parentId": 0, + "slug": "string", + "thumbnail": "string" + }], + "commentCount": 0, + "createTime": "2020-10-11T05:35:01.811Z", + "disallowComment": true, + "editTime": "2020-10-11T05:35:01.811Z", + "editorType": "MARKDOWN", + "fullPath": "string", + "id": 0, + "likes": 0, + "metaDescription": "string", + "metaKeywords": "string", + "metas": {}, + "password": "string", + "slug": "string", + "status": "PUBLISHED", + "summary": "string", + "tags": [{ + "createTime": "2020-10-11T05:35:01.811Z", + "fullPath": "string", + "id": 0, + "name": "string", + "slug": "string", + "thumbnail": "string" + }], + "template": "string", + "thumbnail": "string", + "title": "string", + "topPriority": 0, + "topped": true, + "updateTime": "2020-10-11T05:35:01.811Z", + "visits": 0, + "wordCount": 0 }] ``` @@ -655,7 +654,7 @@ posts: ```html <@postTag method="listByCategorySlug" categorySlug="${category.slug!}"> - 分类 ${category.name!} 下的文章: + 分类 ${category.name!} 下的文章: <#list posts as post> ${post.title!} @@ -691,47 +690,47 @@ posts: ```json [{ - "categories": [{ - "createTime": "2020-10-11T05:35:01.811Z", - "description": "string", - "fullPath": "string", - "id": 0, - "name": "string", - "parentId": 0, - "slug": "string", - "thumbnail": "string" - }], - "commentCount": 0, - "createTime": "2020-10-11T05:35:01.811Z", - "disallowComment": true, - "editTime": "2020-10-11T05:35:01.811Z", - "editorType": "MARKDOWN", - "fullPath": "string", - "id": 0, - "likes": 0, - "metaDescription": "string", - "metaKeywords": "string", - "metas": {}, - "password": "string", - "slug": "string", - "status": "PUBLISHED", - "summary": "string", - "tags": [{ - "createTime": "2020-10-11T05:35:01.811Z", - "fullPath": "string", - "id": 0, - "name": "string", - "slug": "string", - "thumbnail": "string" - }], - "template": "string", - "thumbnail": "string", - "title": "string", - "topPriority": 0, - "topped": true, - "updateTime": "2020-10-11T05:35:01.811Z", - "visits": 0, - "wordCount": 0 + "categories": [{ + "createTime": "2020-10-11T05:35:01.811Z", + "description": "string", + "fullPath": "string", + "id": 0, + "name": "string", + "parentId": 0, + "slug": "string", + "thumbnail": "string" + }], + "commentCount": 0, + "createTime": "2020-10-11T05:35:01.811Z", + "disallowComment": true, + "editTime": "2020-10-11T05:35:01.811Z", + "editorType": "MARKDOWN", + "fullPath": "string", + "id": 0, + "likes": 0, + "metaDescription": "string", + "metaKeywords": "string", + "metas": {}, + "password": "string", + "slug": "string", + "status": "PUBLISHED", + "summary": "string", + "tags": [{ + "createTime": "2020-10-11T05:35:01.811Z", + "fullPath": "string", + "id": 0, + "name": "string", + "slug": "string", + "thumbnail": "string" + }], + "template": "string", + "thumbnail": "string", + "title": "string", + "topPriority": 0, + "topped": true, + "updateTime": "2020-10-11T05:35:01.811Z", + "visits": 0, + "wordCount": 0 }] ``` @@ -739,7 +738,7 @@ posts: ```html <@postTag method="listByTagId" tagId="${tag.id?c}"> - 标签 ${tag.name!} 下的文章: + 标签 ${tag.name!} 下的文章: <#list posts as post> ${post.title!} @@ -775,47 +774,47 @@ posts: ```json [{ - "categories": [{ - "createTime": "2020-10-11T05:35:01.811Z", - "description": "string", - "fullPath": "string", - "id": 0, - "name": "string", - "parentId": 0, - "slug": "string", - "thumbnail": "string" - }], - "commentCount": 0, - "createTime": "2020-10-11T05:35:01.811Z", - "disallowComment": true, - "editTime": "2020-10-11T05:35:01.811Z", - "editorType": "MARKDOWN", - "fullPath": "string", - "id": 0, - "likes": 0, - "metaDescription": "string", - "metaKeywords": "string", - "metas": {}, - "password": "string", - "slug": "string", - "status": "PUBLISHED", - "summary": "string", - "tags": [{ - "createTime": "2020-10-11T05:35:01.811Z", - "fullPath": "string", - "id": 0, - "name": "string", - "slug": "string", - "thumbnail": "string" - }], - "template": "string", - "thumbnail": "string", - "title": "string", - "topPriority": 0, - "topped": true, - "updateTime": "2020-10-11T05:35:01.811Z", - "visits": 0, - "wordCount": 0 + "categories": [{ + "createTime": "2020-10-11T05:35:01.811Z", + "description": "string", + "fullPath": "string", + "id": 0, + "name": "string", + "parentId": 0, + "slug": "string", + "thumbnail": "string" + }], + "commentCount": 0, + "createTime": "2020-10-11T05:35:01.811Z", + "disallowComment": true, + "editTime": "2020-10-11T05:35:01.811Z", + "editorType": "MARKDOWN", + "fullPath": "string", + "id": 0, + "likes": 0, + "metaDescription": "string", + "metaKeywords": "string", + "metas": {}, + "password": "string", + "slug": "string", + "status": "PUBLISHED", + "summary": "string", + "tags": [{ + "createTime": "2020-10-11T05:35:01.811Z", + "fullPath": "string", + "id": 0, + "name": "string", + "slug": "string", + "thumbnail": "string" + }], + "template": "string", + "thumbnail": "string", + "title": "string", + "topPriority": 0, + "topped": true, + "updateTime": "2020-10-11T05:35:01.811Z", + "visits": 0, + "wordCount": 0 }] ``` @@ -823,7 +822,7 @@ posts: ```html <@postTag method="listByTagSlug" tagSlug="${tag.slug!}"> - 标签 ${tag.name!} 下的文章: + 标签 ${tag.name!} 下的文章: <#list posts as post> ${post.title!} @@ -861,32 +860,32 @@ comments: ```json [{ - "allowNotification": true, - "author": "string", - "authorUrl": "string", - "content": "string", - "createTime": "2020-10-13T12:35:54.974Z", - "email": "string", - "gravatarMd5": "string", - "id": 0, - "ipAddress": "string", - "isAdmin": true, - "parentId": 0, - "post": { - "createTime": "2020-10-13T12:35:54.974Z", - "editTime": "2020-10-13T12:35:54.974Z", - "editorType": "MARKDOWN", - "fullPath": "string", - "id": 0, - "metaDescription": "string", - "metaKeywords": "string", - "slug": "string", - "status": "PUBLISHED", - "title": "string", - "updateTime": "2020-10-13T12:35:54.974Z" - }, - "status": "PUBLISHED", - "userAgent": "string" + "allowNotification": true, + "author": "string", + "authorUrl": "string", + "content": "string", + "createTime": "2020-10-13T12:35:54.974Z", + "email": "string", + "gravatarMd5": "string", + "id": 0, + "ipAddress": "string", + "isAdmin": true, + "parentId": 0, + "post": { + "createTime": "2020-10-13T12:35:54.974Z", + "editTime": "2020-10-13T12:35:54.974Z", + "editorType": "MARKDOWN", + "fullPath": "string", + "id": 0, + "metaDescription": "string", + "metaKeywords": "string", + "slug": "string", + "status": "PUBLISHED", + "title": "string", + "updateTime": "2020-10-13T12:35:54.974Z" + }, + "status": "PUBLISHED", + "userAgent": "string" }] ``` @@ -967,15 +966,15 @@ categories: ```json [{ - "createTime": "2020-10-11T05:59:40.622Z", - "description": "string", - "fullPath": "string", - "id": 0, - "name": "string", - "parentId": 0, - "slug": "string", - "thumbnail": "string", - "postCount": 0 + "createTime": "2020-10-11T05:59:40.622Z", + "description": "string", + "fullPath": "string", + "id": 0, + "name": "string", + "parentId": 0, + "slug": "string", + "thumbnail": "string", + "postCount": 0 }] ``` @@ -1119,14 +1118,14 @@ categories: ```json [{ - "createTime": "2020-10-11T05:59:40.622Z", - "description": "string", - "fullPath": "string", - "id": 0, - "name": "string", - "parentId": 0, - "slug": "string", - "thumbnail": "string" + "createTime": "2020-10-11T05:59:40.622Z", + "description": "string", + "fullPath": "string", + "id": 0, + "name": "string", + "parentId": 0, + "slug": "string", + "thumbnail": "string" }] ``` @@ -1203,13 +1202,13 @@ tags: ```json [{ - "createTime": "2020-10-11T06:14:30.595Z", - "fullPath": "string", - "id": 0, - "name": "string", - "slug": "string", - "thumbnail": "string", - "postCount": 0 + "createTime": "2020-10-11T06:14:30.595Z", + "fullPath": "string", + "id": 0, + "name": "string", + "slug": "string", + "thumbnail": "string", + "postCount": 0 }] ``` @@ -1251,12 +1250,12 @@ tags: ```json [{ - "createTime": "2020-10-11T06:14:30.595Z", - "fullPath": "string", - "id": 0, - "name": "string", - "slug": "string", - "thumbnail": "string" + "createTime": "2020-10-11T06:14:30.595Z", + "fullPath": "string", + "id": 0, + "name": "string", + "slug": "string", + "thumbnail": "string" }] ``` @@ -1333,14 +1332,14 @@ menus: ```json [{ - "icon": "string", - "id": 0, - "name": "string", - "parentId": 0, - "priority": 0, - "target": "string", - "team": "string", - "url": "string" + "icon": "string", + "id": 0, + "name": "string", + "parentId": 0, + "priority": 0, + "target": "string", + "team": "string", + "url": "string" }] ``` @@ -1391,25 +1390,25 @@ menus: ```json [{ - "children": [{ - "children": [{}], - "icon": "string", - "id": 0, - "name": "string", - "parentId": 0, - "priority": 0, - "target": "string", - "team": "string", - "url": "string" - }], - "icon": "string", - "id": 0, - "name": "string", - "parentId": 0, - "priority": 0, - "target": "string", - "team": "string", - "url": "string" + "children": [{ + "children": [{}], + "icon": "string", + "id": 0, + "name": "string", + "parentId": 0, + "priority": 0, + "target": "string", + "team": "string", + "url": "string" + }], + "icon": "string", + "id": 0, + "name": "string", + "parentId": 0, + "priority": 0, + "target": "string", + "team": "string", + "url": "string" }] ``` @@ -1478,14 +1477,14 @@ menus: ```json [{ - "icon": "string", - "id": 0, - "name": "string", - "parentId": 0, - "priority": 0, - "target": "string", - "team": "string", - "url": "string" + "icon": "string", + "id": 0, + "name": "string", + "parentId": 0, + "priority": 0, + "target": "string", + "team": "string", + "url": "string" }] ``` @@ -1537,25 +1536,25 @@ menus: ```json [{ - "children": [{ - "children": [{}], - "icon": "string", - "id": 0, - "name": "string", - "parentId": 0, - "priority": 0, - "target": "string", - "team": "string", - "url": "string" - }], - "icon": "string", - "id": 0, - "name": "string", - "parentId": 0, - "priority": 0, - "target": "string", - "team": "string", - "url": "string" + "children": [{ + "children": [{}], + "icon": "string", + "id": 0, + "name": "string", + "parentId": 0, + "priority": 0, + "target": "string", + "team": "string", + "url": "string" + }], + "icon": "string", + "id": 0, + "name": "string", + "parentId": 0, + "priority": 0, + "target": "string", + "team": "string", + "url": "string" }] ``` @@ -1625,15 +1624,15 @@ links: ```json [{ - "id": 0, - "name": "string", - "url": "string", - "logo": "string", - "description": "string", - "team": "string", - "priority": 0, - "createTime": "2021-01-10 20:48:00", - "updateTime": "2021-01-10 20:48:00" + "id": 0, + "name": "string", + "url": "string", + "logo": "string", + "description": "string", + "team": "string", + "priority": 0, + "createTime": "2021-01-10 20:48:00", + "updateTime": "2021-01-10 20:48:00" }] ``` @@ -1688,15 +1687,15 @@ links: ```json [{ - "id": 0, - "name": "string", - "url": "string", - "logo": "string", - "description": "string", - "team": "string", - "priority": 0, - "createTime": "2021-01-10 20:48:00", - "updateTime": "2021-01-10 20:48:00" + "id": 0, + "name": "string", + "url": "string", + "logo": "string", + "description": "string", + "team": "string", + "priority": 0, + "createTime": "2021-01-10 20:48:00", + "updateTime": "2021-01-10 20:48:00" }] ``` @@ -1751,18 +1750,18 @@ links: teams: -``` +```json [{ - "team": "string", - "links": [{ - "id": 0, - "name": "string", - "url": "string", - "logo": "string", - "description": "string", - "team": "string", - "priority": 0 - }] + "team": "string", + "links": [{ + "id": 0, + "name": "string", + "url": "string", + "logo": "string", + "description": "string", + "team": "string", + "priority": 0 + }] }] ``` @@ -1771,7 +1770,7 @@ teams: ```html <@linkTag method="listTeams"> <#list teams as team> -

    ${team.team}

    +

    ${team.team}

      <#list links as link>
    • @@ -1834,18 +1833,18 @@ teams: teams: -``` +```json [{ - "team": "string", - "links": [{ - "id": 0, - "name": "string", - "url": "string", - "logo": "string", - "description": "string", - "team": "string", - "priority": 0 - }] + "team": "string", + "links": [{ + "id": 0, + "name": "string", + "url": "string", + "logo": "string", + "description": "string", + "team": "string", + "priority": 0 + }] }] ``` @@ -1854,7 +1853,7 @@ teams: ```html <@linkTag method="listTeamsByRandom"> <#list teams as team> -

      ${team.team}

      +

      ${team.team}

        <#list links as link>
      • @@ -1955,16 +1954,16 @@ photos: ```json [{ - "id": 0, - "name": "string", - "description": "string", - "takeTime": "2021-01-10 20:48:00", - "location": "string", - "thumbnail": "string", - "url": "string", - "team": "string", - "createTime": "2021-01-10 20:48:00", - "updateTime": "2021-01-10 20:48:00" + "id": 0, + "name": "string", + "description": "string", + "takeTime": "2021-01-10 20:48:00", + "location": "string", + "thumbnail": "string", + "url": "string", + "team": "string", + "createTime": "2021-01-10 20:48:00", + "updateTime": "2021-01-10 20:48:00" }] ``` @@ -2006,17 +2005,17 @@ teams: ```json [{ - "team": "string", - "photos": [{ - "id": 0, - "name": "string", - "thumbnail": "string", - "takeTime": "2021-01-10 20:48:00", - "url": "string", - "team": "string", - "location": "string", - "description": "string" - }] + "team": "string", + "photos": [{ + "id": 0, + "name": "string", + "thumbnail": "string", + "takeTime": "2021-01-10 20:48:00", + "url": "string", + "team": "string", + "location": "string", + "description": "string" + }] }] ``` @@ -2024,12 +2023,12 @@ teams: ```html <@photoTag method="listTeams"> - <#list teams as team> -

        ${team.team}

        + <#list teams as team> +

        ${team.team}

        <#list team.photos as photo> ${photo.description} - + ``` @@ -2067,16 +2066,16 @@ photos: ```json [{ - "id": 0, - "name": "string", - "description": "string", - "takeTime": "2021-01-10 20:48:00", - "location": "string", - "thumbnail": "string", - "url": "string", - "team": "string", - "createTime": "2021-01-10 20:48:00", - "updateTime": "2021-01-10 20:48:00" + "id": 0, + "name": "string", + "description": "string", + "takeTime": "2021-01-10 20:48:00", + "location": "string", + "thumbnail": "string", + "url": "string", + "team": "string", + "createTime": "2021-01-10 20:48:00", + "updateTime": "2021-01-10 20:48:00" }] ``` @@ -2085,7 +2084,7 @@ photos: ```html <@photoTag method="listTeams" team="风景"> <#list team.photos as photo> - ${photo.description} + ${photo.description} ``` @@ -2149,7 +2148,7 @@ count: long 1. method:index 2. page:当前页,通过 `${posts.number}` 得到 3. total:总页数,通过 `${posts.totalPages}` 得到 -3. display:页码展示数量 +4. display:页码展示数量 #### 返回参数 @@ -2157,15 +2156,15 @@ pagination: ```json { - "nextPageFullPath": "string", - "prevPageFullPath": "string", - "hasPrev": true, - "hasNext": true, - "rainbowPages": [{ - "page": 0, - "fullPath": "string", - "isCurrent": true - }] + "nextPageFullPath": "string", + "prevPageFullPath": "string", + "hasPrev": true, + "hasNext": true, + "rainbowPages": [{ + "page": 0, + "fullPath": "string", + "isCurrent": true + }] } ``` @@ -2236,7 +2235,7 @@ pagination: 1. method:archives 2. page:当前页,通过 `${posts.number}` 得到 3. total:总页数,通过 `${posts.totalPages}` 得到 -3. display:页码展示数量 +4. display:页码展示数量 #### 返回参数 @@ -2244,15 +2243,15 @@ pagination: ```json { - "nextPageFullPath": "string", - "prevPageFullPath": "string", - "hasPrev": true, - "hasNext": true, - "rainbowPages": [{ - "page": 0, - "fullPath": "string", - "isCurrent": true - }] + "nextPageFullPath": "string", + "prevPageFullPath": "string", + "hasPrev": true, + "hasNext": true, + "rainbowPages": [{ + "page": 0, + "fullPath": "string", + "isCurrent": true + }] } ``` @@ -2332,15 +2331,15 @@ pagination: ```json { - "nextPageFullPath": "string", - "prevPageFullPath": "string", - "hasPrev": true, - "hasNext": true, - "rainbowPages": [{ - "page": 0, - "fullPath": "string", - "isCurrent": true - }] + "nextPageFullPath": "string", + "prevPageFullPath": "string", + "hasPrev": true, + "hasNext": true, + "rainbowPages": [{ + "page": 0, + "fullPath": "string", + "isCurrent": true + }] } ``` @@ -2411,8 +2410,8 @@ pagination: 1. method:tagPosts 2. page:当前页,通过 `${posts.number}` 得到 3. total:总页数,通过 `${posts.totalPages}` 得到 -3. display:页码展示数量 -4. slug:标签 slug +4. display:页码展示数量 +5. slug:标签 slug #### 返回参数 @@ -2420,15 +2419,15 @@ pagination: ```json { - "nextPageFullPath": "string", - "prevPageFullPath": "string", - "hasPrev": true, - "hasNext": true, - "rainbowPages": [{ - "page": 0, - "fullPath": "string", - "isCurrent": true - }] + "nextPageFullPath": "string", + "prevPageFullPath": "string", + "hasPrev": true, + "hasNext": true, + "rainbowPages": [{ + "page": 0, + "fullPath": "string", + "isCurrent": true + }] } ``` @@ -2499,8 +2498,8 @@ pagination: 1. method:categoryPosts 2. page:当前页,通过 `${posts.number}` 得到 3. total:总页数,通过 `${posts.totalPages}` 得到 -3. display:页码展示数量 -4. slug:标签 slug +4. display:页码展示数量 +5. slug:标签 slug #### 返回参数 @@ -2508,15 +2507,15 @@ pagination: ```json { - "nextPageFullPath": "string", - "prevPageFullPath": "string", - "hasPrev": true, - "hasNext": true, - "rainbowPages": [{ - "page": 0, - "fullPath": "string", - "isCurrent": true - }] + "nextPageFullPath": "string", + "prevPageFullPath": "string", + "hasPrev": true, + "hasNext": true, + "rainbowPages": [{ + "page": 0, + "fullPath": "string", + "isCurrent": true + }] } ``` @@ -2587,7 +2586,7 @@ pagination: 1. method:photos 2. page:当前页,通过 `${photos.number}` 得到 3. total:总页数,通过 `${photos.totalPages}` 得到 -3. display:页码展示数量 +4. display:页码展示数量 #### 返回参数 @@ -2595,15 +2594,15 @@ pagination: ```json { - "nextPageFullPath": "string", - "prevPageFullPath": "string", - "hasPrev": true, - "hasNext": true, - "rainbowPages": [{ - "page": 0, - "fullPath": "string", - "isCurrent": true - }] + "nextPageFullPath": "string", + "prevPageFullPath": "string", + "hasPrev": true, + "hasNext": true, + "rainbowPages": [{ + "page": 0, + "fullPath": "string", + "isCurrent": true + }] } ``` @@ -2674,7 +2673,7 @@ pagination: 1. method:journals 2. page:当前页,通过 `${journals.number}` 得到 3. total:总页数,通过 `${journals.totalPages}` 得到 -3. display:页码展示数量 +4. display:页码展示数量 #### 返回参数 @@ -2682,15 +2681,15 @@ pagination: ```json { - "nextPageFullPath": "string", - "prevPageFullPath": "string", - "hasPrev": true, - "hasNext": true, - "rainbowPages": [{ - "page": 0, - "fullPath": "string", - "isCurrent": true - }] + "nextPageFullPath": "string", + "prevPageFullPath": "string", + "hasPrev": true, + "hasNext": true, + "rainbowPages": [{ + "page": 0, + "fullPath": "string", + "isCurrent": true + }] } ``` @@ -2744,4 +2743,4 @@ pagination: 下一页
      -``` \ No newline at end of file +``` diff --git a/versioned_docs/version-1.4.17/getting-started/config.md b/versioned_docs/version-1.4.17/getting-started/config.md index c952308..9c0dbeb 100644 --- a/versioned_docs/version-1.4.17/getting-started/config.md +++ b/versioned_docs/version-1.4.17/getting-started/config.md @@ -12,9 +12,11 @@ Halo 的配置文件名为 `application.yaml`,其必须位于[工作目录](/g 如下将详细列出配置文件 `application.yaml` 中所有的配置项。 ## 基础配置 + 基础配置中的配置设置一般来说是**必要的**,且必须在 application.yaml 里进行定义。 ### 端口 + 用于指定 HTTP 服务器监听的端口,Halo 默认设置为 `8090`。 ```yaml @@ -25,6 +27,7 @@ server: 请注意,如果您选择设置端口为 `80`,则需要确保您的 80 端口未被占用,通常**不建议**直接设置为 80 端口。 ### 数据库 + Halo 目前支持 `H2` 及 `MySQL` 数据库。 :::tip @@ -88,9 +91,11 @@ create database halodb character set utf8mb4 collate utf8mb4_bin; - 默认时区为 `Asia/Shanghai`,如果与您所在时区不一致,则可以修改为您所在的时区。 ## 高级配置 + 高级配置中的配置设置是可选的,如果不需要,可以略过。 ### 后台路径 + Halo 支持自定义后台管理的**根路径**。 ```yaml @@ -102,6 +107,7 @@ halo: 注意:仅为改动后台管理的根路径,因此前后不带 `/`。 ### 缓存 + 某些情况下,需要用户根据需求来设置缓存数据的保存方式,例如将缓存数据持久化保存在本地。 ```yaml @@ -111,10 +117,12 @@ halo: ``` 目前支持两种策略: + - `memory` 将数据缓存至内存,重启服务缓存将清空。 - `level` 将数据缓存至本地,重启服务不会清空缓存。 ### 压缩 + 启用压缩对于减少带宽和加快页面加载非常有用,在**未使用** `Nginx` 或 `Caddy` 等反向代理服务器时(反向代理服务器通常是默认开启 Gzip 的),可以考虑开启系统自带的Gzip 功能。 ```yaml diff --git a/versioned_docs/version-1.4.17/getting-started/downloads.md b/versioned_docs/version-1.4.17/getting-started/downloads.md index 81884b0..591ab97 100644 --- a/versioned_docs/version-1.4.17/getting-started/downloads.md +++ b/versioned_docs/version-1.4.17/getting-started/downloads.md @@ -22,4 +22,4 @@ description: 目前所有与 Halo 相关的下载地址 - [https://halo.cary.tech](https://halo.cary.tech) -此镜像源由 [新逸Cary](https://blog.xinac.cn) 提供并维护。 \ No newline at end of file +此镜像源由 [新逸Cary](https://blog.xinac.cn) 提供并维护。 diff --git a/versioned_docs/version-1.4.17/getting-started/install/docker.md b/versioned_docs/version-1.4.17/getting-started/install/docker.md index 891d230..3c53a37 100644 --- a/versioned_docs/version-1.4.17/getting-started/install/docker.md +++ b/versioned_docs/version-1.4.17/getting-started/install/docker.md @@ -8,36 +8,43 @@ description: 使用 Docker 部署 ::: ## 使用 Docker 镜像 + Halo 在 Docker Hub 上发布的镜像为 [halohub/halo](https://hub.docker.com/r/halohub/halo) 1. 创建[工作目录](/getting-started/prepare#工作目录) + ```bash mkdir ~/.halo && cd ~/.halo ``` 2. 下载示例配置文件到[工作目录](/getting-started/prepare#工作目录) + ```bash wget https://dl.halo.run/config/application-template.yaml -O ./application.yaml ``` 3. 编辑配置文件,配置数据库或者端口等,如需配置请参考[参考配置](/getting-started/config) + ```bash vim application.yaml ``` 4. 拉取最新的 Halo 镜像 + ```bash docker pull halohub/halo:1.4.17 ``` :::info -查看最新版本镜像:https://hub.docker.com/r/halohub/halo ,我们推荐使用具体版本号的镜像,但也提供了 `latest` 标签的镜像,它始终是最新的。 +查看最新版本镜像: ,我们推荐使用具体版本号的镜像,但也提供了 `latest` 标签的镜像,它始终是最新的。 ::: 5. 创建容器 + ```bash docker run -it -d --name halo -p 8090:8090 -v ~/.halo:/root/.halo --restart=unless-stopped halohub/halo:1.4.17 ``` + - **-it:** 开启输入功能并连接伪终端 - **-d:** 后台运行容器 - **--name:** 为容器指定一个名称 @@ -78,7 +85,7 @@ server { ### Caddy 1.x -``` +```txt https://www.yourdomain.com { gzip tls your@email.com @@ -90,7 +97,7 @@ https://www.yourdomain.com { ### Caddy 2.x -``` +```txt www.yourdomain.com encode gzip @@ -98,4 +105,4 @@ encode gzip reverse_proxy 127.0.0.1:8090 ``` -以上配置都可以在 https://github.com/halo-dev/halo-common 找到。 \ No newline at end of file +以上配置都可以在 找到。 diff --git a/versioned_docs/version-1.4.17/getting-started/install/linux.md b/versioned_docs/version-1.4.17/getting-started/install/linux.md index ab2d030..a1c8c98 100644 --- a/versioned_docs/version-1.4.17/getting-started/install/linux.md +++ b/versioned_docs/version-1.4.17/getting-started/install/linux.md @@ -8,6 +8,7 @@ description: 在Linux上快速安装Halo ::: ## 依赖检查 + 目前运行 Halo 的最低依赖要求为 JRE 11,请务必确保在进行下面操作之前已经正确安装了 JRE。 目前介绍两种 Linux 发行版的安装方式,均为 OpenJRE,不推荐 Oracle 版本。 @@ -61,32 +62,37 @@ OpenJDK 64-Bit Server VM (build 11.0.10+9-Ubuntu-0ubuntu1.20.04, mixed mode) ::: 创建一个名为 halo 的用户(名字可以随意) + ```bash useradd -m halo ``` 给予 sudo 权限 + ```bash usermod -aG wheel halo ``` 为 halo 用户创建密码 + ```bash passwd halo ``` 登录到 halo 账户 + ```bash su - halo ``` 2. 创建存放 [运行包](/getting-started/prepare#运行包) 的目录,这里以 `~/app` 为例 -``` +```bash mkdir ~/app && cd ~/app ``` 3. 下载运行包 + ```bash wget https://dl.halo.run/release/halo-1.4.17.jar -O halo.jar ``` @@ -102,26 +108,31 @@ mkdir ~/.halo && cd ~/.halo ``` 5. 下载示例配置文件到 [工作目录](/getting-started/prepare#工作目录) + ```bash wget https://dl.halo.run/config/application-template.yaml -O ./application.yaml ``` 6. 编辑配置文件,配置数据库或者端口等,如需配置请参考 [参考配置](/getting-started/config) + ```bash vim application.yaml ``` 7. 测试运行 Halo + ```bash cd ~/app && java -jar halo.jar ``` 8. 如看到类似以下日志输出,则代表启动成功。 + ```bash run.halo.app.listener.StartedListener : Halo started at http://127.0.0.1:8090 run.halo.app.listener.StartedListener : Halo admin started at http://127.0.0.1:8090/admin run.halo.app.listener.StartedListener : Halo has started successfully! ``` + 打开 `http://ip: 端口号` 即可看到安装引导界面。 :::info @@ -143,16 +154,19 @@ exit ``` 2. 下载 Halo 官方的 halo.service 模板 + ```bash wget https://dl.halo.run/config/halo.service -O /etc/systemd/system/halo.service ``` 3. 修改 halo.service + ```bash vim /etc/systemd/system/halo.service ``` 4. 修改配置 + - **YOUR_JAR_PATH**:Halo 运行包的绝对路径,例如 `/home/halo/app/halo.jar`,注意:此路径不支持 `~` 符号。 - **USER**:运行 Halo 的系统用户,如果有按照上方教程创建新的用户来运行 Halo,修改为你创建的用户名称即可。反之请删除 `User=USER`。 @@ -182,21 +196,25 @@ WantedBy=multi-user.target ::: 5. 重新加载 systemd + ```bash systemctl daemon-reload ``` 6. 运行服务 + ```bash systemctl start halo ``` 7. 在系统启动时启动服务 + ```bash systemctl enable halo ``` 您可以查看服务日志检查启动状态 + ```bash journalctl -n 20 -u halo ``` @@ -230,7 +248,7 @@ server { ### Caddy 1.x -``` +```txt https://www.yourdomain.com { gzip tls your@email.com @@ -242,7 +260,7 @@ https://www.yourdomain.com { ### Caddy 2.x -``` +```txt www.yourdomain.com encode gzip @@ -250,4 +268,4 @@ encode gzip reverse_proxy 127.0.0.1:8090 ``` -以上配置都可以在 https://github.com/halo-dev/halo-common 找到。 +以上配置都可以在 找到。 diff --git a/versioned_docs/version-1.4.17/getting-started/install/other/docker-mysql.md b/versioned_docs/version-1.4.17/getting-started/install/other/docker-mysql.md index 224b28c..3f518b0 100644 --- a/versioned_docs/version-1.4.17/getting-started/install/other/docker-mysql.md +++ b/versioned_docs/version-1.4.17/getting-started/install/other/docker-mysql.md @@ -86,7 +86,7 @@ docker run --name some-mysql -v ~/.halo/mysql:/var/lib/mysql -e MYSQL_ROOT_PASSW 5. 创建 `Halo` 工作目录 -``` +```bash mkdir ~/.halo && cd ~/.halo ``` @@ -140,7 +140,7 @@ docker network connect halo-net some-mysql 3. 同之前一样创建 `Halo` 工作目录 -``` +```bash mkdir ~/.halo && cd ~/.halo ``` diff --git a/versioned_docs/version-1.4.17/getting-started/install/other/oneinstack.md b/versioned_docs/version-1.4.17/getting-started/install/other/oneinstack.md index c6bb386..353adfe 100644 --- a/versioned_docs/version-1.4.17/getting-started/install/other/oneinstack.md +++ b/versioned_docs/version-1.4.17/getting-started/install/other/oneinstack.md @@ -15,7 +15,7 @@ description: 使用 OneinStack 的 vhost 脚本创建 Halo 站点的 Nginx 配 点击下方链接进入 OneinStack 官网,仅选择 `安装 Nginx`,其他的都可以取消选择。 -https://oneinstack.com/auto + 最后点击 `复制安装命令` 到服务器执行即可。如果你仅安装 Nginx,你的链接应该是这样: @@ -55,12 +55,12 @@ sh vhost.sh 2. 按照提示选择或输入相关信息 -```bash +```bash What Are You Doing? - 1. Use HTTP Only - 2. Use your own SSL Certificate and Key - 3. Use Let's Encrypt to Create SSL Certificate and Key - q. Exit + 1. Use HTTP Only + 2. Use your own SSL Certificate and Key + 3. Use Let's Encrypt to Create SSL Certificate and Key + q. Exit Please input the correct option: ``` @@ -260,14 +260,14 @@ nginx -t 如果输出如下提示则代表配置有效: -``` +```bash nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful ``` 重载 Nginx 配置: -``` +```bash nginx -s reload ``` diff --git a/versioned_docs/version-1.4.17/getting-started/install/other/tencent-cloudbase.md b/versioned_docs/version-1.4.17/getting-started/install/other/tencent-cloudbase.md index 1c853a2..2353e0e 100644 --- a/versioned_docs/version-1.4.17/getting-started/install/other/tencent-cloudbase.md +++ b/versioned_docs/version-1.4.17/getting-started/install/other/tencent-cloudbase.md @@ -14,13 +14,13 @@ description: 使用腾讯云 CloudBase 一键部署 1. 系统使用内置的 H2 Database,暂不支持使用 MySQL。 1. 工作目录保存在腾讯云提供的 CFS 上,在使用此方式创建应用的时候会要求创建 CFS。 1. 目前使用该方式部署,不支持修改 [配置文件](/getting-started/config)。 -1. 费用相关请参考 https://cloud.tencent.com/document/product/876/18864 +1. 费用相关请参考 ## 进入云开发页面 点击下方按钮即可进入到腾讯云云开发 CloudBase 创建应用界面,此按钮可在云开发页面自动选择 Halo 的配置模板。 -[![](https://main.qcloudimg.com/raw/67f5a389f1ac6f3b4d04c7256438e44f.svg)](https://console.cloud.tencent.com/tcb/env/index?action=CreateAndDeployCloudBaseProject&appUrl=https%3A%2F%2Fgithub.com%2Fhalo-dev%2Ftencent-cloudbase-halo&branch=master) +[![CloudBase](https://main.qcloudimg.com/raw/67f5a389f1ac6f3b4d04c7256438e44f.svg)](https://console.cloud.tencent.com/tcb/env/index?action=CreateAndDeployCloudBaseProject&appUrl=https%3A%2F%2Fgithub.com%2Fhalo-dev%2Ftencent-cloudbase-halo&branch=master) ## 配置并部署 @@ -48,7 +48,7 @@ description: 使用腾讯云 CloudBase 一键部署 ![tencent-cloudbase-6.png](/img/tencent-cloudbase/tencent-cloudbase-6.png) -**Halo 初始化页面** +**Halo 初始化页面**: ![tencent-cloudbase-7.png](/img/tencent-cloudbase/tencent-cloudbase-7.png) @@ -77,4 +77,3 @@ description: 使用腾讯云 CloudBase 一键部署 - [Halo 配置文件仓库](https://github.com/halo-dev/tencent-cloudbase-halo) - [腾讯云 CloudBase](https://console.cloud.tencent.com/tcb/env/index) - [云开发使用指南](https://cloud.tencent.com/document/product/876) - diff --git a/versioned_docs/version-1.4.17/getting-started/install/third-party.md b/versioned_docs/version-1.4.17/getting-started/install/third-party.md index a79dff7..e8f075c 100644 --- a/versioned_docs/version-1.4.17/getting-started/install/third-party.md +++ b/versioned_docs/version-1.4.17/getting-started/install/third-party.md @@ -10,4 +10,4 @@ title: 三方指南 - [如何用服务器优雅地搭建一个博客—Hello,Halo!](https://www.bilibili.com/video/BV1JN411Q7Na/) - [Halo+云服务器+Nginx反向代理实现个人博客搭建](https://yusart.xyz/archives/halo%E4%B8%AA%E4%BA%BA%E5%8D%9A%E5%AE%A2%E6%90%AD%E5%BB%BA) - [如何在 Windows 下搭建 Halo](https://ykanade.cn/2021/08/11/HaloInWindows/) -- [Halo 博客建站记录](https://catchersun.cn/archives/halo%E5%8D%9A%E5%AE%A2%E5%BB%BA%E7%AB%99%E8%AE%B0%E5%BD%95) \ No newline at end of file +- [Halo 博客建站记录](https://catchersun.cn/archives/halo%E5%8D%9A%E5%AE%A2%E5%BB%BA%E7%AB%99%E8%AE%B0%E5%BD%95) diff --git a/versioned_docs/version-1.4.17/getting-started/install/windows.md b/versioned_docs/version-1.4.17/getting-started/install/windows.md index 374492f..72cab80 100644 --- a/versioned_docs/version-1.4.17/getting-started/install/windows.md +++ b/versioned_docs/version-1.4.17/getting-started/install/windows.md @@ -6,13 +6,15 @@ title: 在 Windows 服务器上部署 在继续操作之前,我们推荐您先阅读[《写在前面》](/getting-started/prepare),这可以快速帮助你了解 Halo。 ::: -# 系统要求 +## 系统要求 + 目前运行 Halo 的最低依赖要求为 JRE 11,而 Java9 之后将不再提供 32 位系统的环境,因此请确保您的服务器属于 64 位 CPU。 -# 依赖检查 +## 依赖检查 + 如下将介绍在 Windows 下安装 OpenJRE 11 的方式。如果您的服务器已经安装过 OpenJRE 11,则可以直接跳过本节。 -1. 使用浏览器前往 https://developers.redhat.com/content-gateway/file/java-11-openjdk-jre-11.0.10.9-1.windows.redhat.x86_64.msi 下载 OpenJRE 11 的可执行程序。 +1. 使用浏览器前往 下载 OpenJRE 11 的可执行程序。 2. 下载时会提示登录“红帽”,任意注册账号登录即可。登录完成之后会自动下载 JRE。 @@ -21,7 +23,8 @@ title: 在 Windows 服务器上部署 ![img2.png](/img/img2.png) 4. 安装完成之后, 使用 Win+R 打开运行窗口并输入 `CMD` 后,回车打开 CMD 窗口。之后键入 `java -version`。显示如下所示内容即代表安装成功。 -``` + +```bash openjdk version "11.0.10" 2021-01-19 LTS OpenJDK Runtime Environment 18.9 (build 11.0.10+9-LTS) OpenJDK 64-Bit Server VM 18.9 (build 11.0.10+9-LTS, mixed mode) @@ -29,10 +32,11 @@ OpenJDK 64-Bit Server VM 18.9 (build 11.0.10+9-LTS, mixed mode) ![1615618595.jpg](/img/1615618595.jpg) -# 安装 Halo +## 安装 Halo + 1. 下载运行包 -使用浏览器前往 https://dl.halo.run/release/halo-1.4.6.jar 下载最新版本 Halo 运行包,**并保存至桌面**。修改 Jar 包名称为 `halo.jar` +使用浏览器前往 下载最新版本 Halo 运行包,**并保存至桌面**。修改 Jar 包名称为 `halo.jar` :::info 如果下载速度不理想,可以[在这里](/getting-started/downloads)选择其他下载地址。 @@ -40,7 +44,7 @@ OpenJDK 64-Bit Server VM 18.9 (build 11.0.10+9-LTS, mixed mode) 2. 下载示例配置文件 -使用浏览器前往 https://dl.halo.run/config/application-template.yaml 下载示例配置文件,**并保存至桌面**。修改示例配置文件名字为 `application.yaml`。 +使用浏览器前往 下载示例配置文件,**并保存至桌面**。修改示例配置文件名字为 `application.yaml`。 :::tip IE 浏览器下,配置文件可能会以文本的形式直接打开,因此推荐使用其他浏览器或下载器下载。 @@ -51,16 +55,19 @@ IE 浏览器下,配置文件可能会以文本的形式直接打开,因此 4. 测试运行 Halo 使用 Win+R 打开运行窗口并输入 `CMD` 后,回车打开 CMD 窗口,并键入如下命令。 -``` + +```bash cd Desktop && java -jar halo.jar ``` 5. 如看到类似以下日志输出,则代表启动成功。 + ```bash run.halo.app.listener.StartedListener : Halo started at http://127.0.0.1:8090 run.halo.app.listener.StartedListener : Halo admin started at http://127.0.0.1:8090/admin run.halo.app.listener.StartedListener : Halo has started successfully! ``` + 浏览器打开 `http://ip:端口号` 即可看到安装引导界面。 :::info diff --git a/versioned_docs/version-1.4.17/getting-started/prepare.md b/versioned_docs/version-1.4.17/getting-started/prepare.md index 29dba99..96a3354 100644 --- a/versioned_docs/version-1.4.17/getting-started/prepare.md +++ b/versioned_docs/version-1.4.17/getting-started/prepare.md @@ -84,14 +84,16 @@ create database halodb character set utf8mb4 collate utf8mb4_bin; 代表当前系统下的 [用户目录](https://zh.wikipedia.org/wiki/%E5%AE%B6%E7%9B%AE%E5%BD%95)。 ### 运行包 + 指 Halo 构建所产生的 Jar 包,后缀为 `.jar`。可能与其他网站应用有所区别的是,Halo 仅仅只有这一个文件。而且所有数据统一保存在下面所说的 `工作目录`。 ### 工作目录 + 指 Halo 所依赖的工作目录,在 Halo 运行的时候会在系统当前用户目录下产生一个 `.halo` 的文件夹,绝对路径为 `~/.halo`。由于这个工作目录是固定的,所以上面所说的 `运行包`不限制所存放的位置,里面通常包含下列目录或文件: 1. `db`:存放 H2 Database 的物理文件,如果您使用 MySQL 数据库,那么不会存在这个目录。 2. `templates/themes`:里面包含用户所下载的主题。 3. `static`:相当于网站的根目录。 4. `logs`:运行日志目录。 -4. `upload`:附件目录。 -5. `application.yaml`:配置文件。 +5. `upload`:附件目录。 +6. `application.yaml`:配置文件。 diff --git a/versioned_docs/version-1.4.17/getting-started/upgrade.md b/versioned_docs/version-1.4.17/getting-started/upgrade.md index 6c1d412..8d2593e 100644 --- a/versioned_docs/version-1.4.17/getting-started/upgrade.md +++ b/versioned_docs/version-1.4.17/getting-started/upgrade.md @@ -57,11 +57,10 @@ java -jar halo.jar 5. 重启服务 -``` +```bash service halo start ``` - ## Docker > 我们假设您的容器是按照 [使用 Docker 部署 Halo](/getting-started/install/docker) 中的命令构建的。如有不同,请根据实际情况修改。 @@ -93,7 +92,7 @@ docker pull halohub/halo:1.4.17 ``` :::info -查看最新版本镜像:https://hub.docker.com/r/halohub/halo ,我们推荐使用具体版本号的镜像,但也提供了 `latest` 标签的镜像,它始终是最新的。 +查看最新版本镜像: ,我们推荐使用具体版本号的镜像,但也提供了 `latest` 标签的镜像,它始终是最新的。 ::: 4. 创建容器 @@ -101,9 +100,10 @@ docker pull halohub/halo:1.4.17 ```bash docker run -it -d --name halo -p 8090:8090 -v ~/.halo:/root/.halo --restart=unless-stopped halohub/halo:1.4.17 ``` + - **-it:** 开启输入功能并连接伪终端 - **-d:** 后台运行容器 - **--name:** 为容器指定一个名称 - **-p:** 端口映射,格式为 `主机(宿主)端口:容器端口` ,可在 `application.yaml` 配置。 - **-v:** 工作目录映射。形式为:-v 宿主机路径:/root/.halo,后者不能修改。 -- **--restart:** 建议设置为 `unless-stopped`,在 Docker 启动的时候自动启动 Halo 容器。 \ No newline at end of file +- **--restart:** 建议设置为 `unless-stopped`,在 Docker 启动的时候自动启动 Halo 容器。 diff --git a/versioned_docs/version-1.4.17/intro.md b/versioned_docs/version-1.4.17/intro.md index 9e89f8a..4977c0a 100644 --- a/versioned_docs/version-1.4.17/intro.md +++ b/versioned_docs/version-1.4.17/intro.md @@ -72,7 +72,7 @@ docker run -it -d --name halo -p 8090:8090 -v ~/.halo:/root/.halo --restart=alwa | [halo-comment-normal](https://github.com/halo-dev/halo-comment-normal) | npm release | 另外一款评论组件 | | [halo-mobile-app](https://github.com/halo-dev/halo-mobile-app) | 已停止维护 | 移动端管理 APP | | [tencent-cloudbase-halo](https://github.com/halo-dev/tencent-cloudbase-halo) | 无 | 腾讯云 CloudBase 一键部署配置 | -| [halo-theme-*](https://github.com/topics/halo-theme) | 无 | GitHub 上开源的 Halo 主题集合 | +| [halo-theme-*](https://github.com/topics/halo-theme) | 无 | GitHub 上开源的 Halo 主题集合 | ## 许可证 diff --git a/versioned_docs/version-1.4.17/user-guide/config.md b/versioned_docs/version-1.4.17/user-guide/config.md index dfd9884..f348c04 100644 --- a/versioned_docs/version-1.4.17/user-guide/config.md +++ b/versioned_docs/version-1.4.17/user-guide/config.md @@ -29,7 +29,7 @@ description: 系统功能的相关配置说明 很多人反映评论中自己的头像不显示,其实评论部分调用的头像并不是在个人资料中设置的那个,而是 `Gravatar`。所以这一点怪我,从 Halo 发布至今我都没有说明这个事情。 -至于什么是 `Gravatar`,引用 `Gravatar` 官方的说明:`全球公认的头像`。这可不是在吹牛,因为只要接入了 Gravatar 的网站,你在网站上使用在 Gravatar 注册的邮箱之后,都会显示你设置的头像,而不需要额外设置。比较出名的网站有 `Github`,`Gitlab`,`V2ex` 等。所以点击 https://cn.gravatar.com/ 注册一个吧。 +至于什么是 `Gravatar`,引用 `Gravatar` 官方的说明:`全球公认的头像`。这可不是在吹牛,因为只要接入了 Gravatar 的网站,你在网站上使用在 Gravatar 注册的邮箱之后,都会显示你设置的头像,而不需要额外设置。比较出名的网站有 `Github`,`Gitlab`,`V2ex` 等。所以点击 注册一个吧。 ## 设置用户头像/Logo/Favicon @@ -158,8 +158,8 @@ A:诸如百度统计,CNZZ,Google Analytics。可以非常详细的统计 点击主题下方的设置按钮即可进入主题设置。另外主题设置还有一种预览模式,可以实时查看主题设置变更后的效果。当你设置当前激活主题的时候,在页面右下角有一个 `预览模式` 的按钮,点击即可进入预览模式。 ## 设置备案信息 -由于后台博客设置并没有提供设置备案信息的选项,所以有很多人不知道该怎么添加备案信息,这里简单说明一下。 +由于后台博客设置并没有提供设置备案信息的选项,所以有很多人不知道该怎么添加备案信息,这里简单说明一下。 第一步: @@ -167,7 +167,6 @@ A:诸如百度统计,CNZZ,Google Analytics。可以非常详细的统计 这时候你应该可以看到一个`页脚信息`的选项,而且有提示 `支持 HTML 格式的文本`。所以我们把备案信息放在这里即可。 - 第二步: -将整理好的备案信息填写到页脚信息即可,如果没记错的话,公安联网备案是有提供`网站公安机关备案号`和`备案编号HTML代码`的。 \ No newline at end of file +将整理好的备案信息填写到页脚信息即可,如果没记错的话,公安联网备案是有提供`网站公安机关备案号`和`备案编号HTML代码`的。 diff --git a/versioned_docs/version-1.4.17/user-guide/markdown.md b/versioned_docs/version-1.4.17/user-guide/markdown.md index 0b49a84..ac9ff8f 100644 --- a/versioned_docs/version-1.4.17/user-guide/markdown.md +++ b/versioned_docs/version-1.4.17/user-guide/markdown.md @@ -9,21 +9,27 @@ Halo 使用的 `Markdown` 解析器为 [flexmark-java](https://github.com/vsch/f ## 代码块 - ```language - 代码块 - ``` +````markdown +```language +代码块 +``` +```` 其中,language 为必填,如果不填写,很可能主题的代码高亮插件无法识别代码的语言,导致样式异常。举几个例子: - ```java - public static void main(String[] args){ -     System.out.println("Hello World!"); - } - ``` +````markdown +```java +public static void main(String[] args){ +    System.out.println("Hello World!"); +} +``` +```` - ```javascript - console.log("Hello World!") - ``` +````markdown +```javascript +console.log("Hello World!") +``` +```` ## TOC @@ -33,9 +39,9 @@ Halo 使用的 `Markdown` 解析器为 [flexmark-java](https://github.com/vsch/f 支持自动将一个链接解析为可点击的格式,如下: -````markdown +```markdown https://halo.run -```` +``` 将被解析为: @@ -177,21 +183,21 @@ Halo 内置一些短连接以更好地支持一些 HTML 语法,但是编辑器 ## 脚注 -#### 语法 +语法: ```markdown [^脚注名] [^脚注名]: 脚注内容 ``` -#### 示例 +示例: ```markdown 驿外[^1]断桥边,寂寞开无主。已是黄昏独自愁,更着风和雨 [^1]: 驿(yì)外:指荒僻、冷清之地。驿,驿站。 ``` -#### 解析结果 +解析结果: ```html

      驿外[1]断桥边,寂寞开无主。已是黄昏独自愁,更着风和雨

      @@ -202,4 +208,4 @@ Halo 内置一些短连接以更好地支持一些 HTML 语法,但是编辑器
    • -``` \ No newline at end of file +```