-
-开发的时候,我们不建议直接更改`项目源码`中的所包含的`配置文件`,包括 `application.yml`、`application-dev.yml`、`application-test.yml` 和 `application-user.yml`。
-
-
-Halo documentation versions
+ return ( +Halo documentation versions
- {latestVersion && ( -
-
-
-
-
- )}
+ {latestVersion && (
+ Current version (Stable)
-- Here you can find the documentation for current released version. -
-{latestVersion.label} | -- Documentation - | -- - Release Notes - - | -
---|
+
+
+
+
+ )}
- {currentVersion !== latestVersion && (
- Current version (Stable)
++ Here you can find the documentation for current released version. +
+{latestVersion.label} | ++ Documentation + | ++ + Release Notes + + | +
---|
-
-
-
-
- )}
+ {currentVersion !== latestVersion && (
+ Next version (Unreleased)
-- Here you can find the documentation for work-in-process unreleased - version. -
-{currentVersion.label} | -- Documentation - | -
---|
+
+
+
+
+ )}
- {(pastVersions.length > 0) && (
- Next version (Unreleased)
++ Here you can find the documentation for work-in-process unreleased + version. +
+{currentVersion.label} | ++ Documentation + | +
---|
-
-
- {pastVersions.map((version) => (
-
-
+ {(pastVersions.length > 0 || VersionsArchivedList.length > 0) && (
+ Past versions (Not maintained anymore)
-- Here you can find documentation for previous versions of - Docusaurus. -
-{version.label} | -- Documentation - | -- - Release Notes - - | -
---|
+
+
+ {pastVersions.map((version) => (
+
+
+ )}
+ Past versions (Not maintained anymore)
++ Here you can find documentation for previous versions of + Docusaurus. +
+{version.label} | +
+
+ |
+
+
+ |
+
---|---|---|
{versionName} | +
+
+ |
+
+
+ |
+
${settings.index_title!}
-#if> -``` - -```html -// 获取背景图片 - -<#if settings.background_cover?? && settings.background_cover != ''> - -#if> -``` - -```html -// 获取背景颜色 - - - -或者 - - - -``` - -```html -// 判断是否开启背景音乐 - -<#if settings.music_enabled!false> - do something... -#if> -``` - -```html -// 获取代码高亮主题 - - - -``` - -更多实例可参考:${archive.year?c}
- <#list archive.posts as post> - ${post.title!} - #list> -#list> -``` - -输出: - -```html -2021
-title1 -title2 -title3 -2020
-title4 -title5 -title6 -``` - -## 分类目录页面(categories.ftl) - -访问路径不固定,视固定链接配置而定,默认为:`http://yourdomain/categories` - -此页面无页面变量,可以使用 [模板标签](/developer-guide/theme/template-tag) 获取分类列表。 - -## 单个分类所属文章页面(category.ftl) - -访问路径不固定,视固定链接配置而定,默认为:`http://yourdomain/categories/{slug}` - -### posts(List) - -#### 语法 - -```html -<#list posts.content as post> -// do something -#list> -``` - -#### 参数 - -```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 -}] -``` - -#### 示例 - -遍历输出某个分类的文章: - -```html -<#list posts.content as post> - ${post.title!} -#list> -``` - -输出: - -```html -title1 -title2 -title3 -``` - -### category(Object) - -#### 语法 - -```html -${category.attribute} -``` - -注: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 -} -``` - -#### 示例 - -```html -分类:${category.name!} -``` - -输出: - -```html -分类:name1 -``` - -## 标签页面(tags.ftl) - -访问路径不固定,视固定链接配置而定,默认为:`http://yourdomain/tags` - -此页面无页面变量,可以使用 [模板标签](/developer-guide/theme/template-tag) 获取标签列表。 - -## 单个标签所属文章页面(tag.ftl) - -访问路径不固定,视固定链接配置而定,默认为:`http://yourdomain/tags/{slug}` - -### posts(List) - -#### 语法 - -```html -<#list posts.content as post> -// do something -#list> -``` - -#### 参数 - -```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 -}] -``` - -#### 示例 - -遍历输出某个标签的文章: - -```html -<#list posts.content as post> - ${post.title!} -#list> -``` - -输出: - -```html -title1 -title2 -title3 -``` - -### tag(Object) - -#### 语法 - -```html -${tag.attribute} -``` - -注:attribute 代表具体属性。 - -#### 参数 - -```json -{ - "createTime": "2020-10-11T06:14:30.595Z", - "fullPath": "string", - "id": 0, - "name": "string", - "slug": "string", - "thumbnail": "string" -} -``` - -#### 示例 - -```html -标签:${tag.name!} -``` - -输出: - -```html -标签:name1 -``` - -## 文章搜索结果页面(search.ftl) - -访问路径:`http://yourdomain/search?keyword=keyword` - -### keyword(String) - -#### 语法 - -```html -${keyword!} -``` - -#### 参数 - -无 - -#### 示例 - -```html -搜索关键字为:${keyword!} -``` - -### posts(List) - -#### 语法 - -```html -<#list posts.content as post> -// do something -#list> -``` - -#### 参数 - -```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 -}] -``` - -#### 示例 - -遍历输出某个搜索结果的文章: - -```html -<#list posts.content as post> - ${post.title!} -#list> -``` - -输出: - -```html -title1 -title2 -title3 -``` - -## 友情链接页面(links.ftl) - -访问路径不固定,视固定链接配置而定,默认为:`http://yourdomain/links` - -此页面无页面变量,可以使用 [模板标签](/developer-guide/theme/template-tag) 获取友情链接列表。 - -## 图库页面(photos.ftl) - -访问路径不固定,视固定链接配置而定,默认为:`http://yourdomain/photos` - -### photos(List) - -#### 语法 - -```html -<#list photos.content as photo> -// do something -#list> -``` - -#### 参数 - -```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 -} -``` - -#### 示例 - -```html -<#list photos.content as photo> - -#list> -``` - -输出: - -```html - - - -``` - -## 日志页面(journals.ftl) - -访问路径不固定,视固定链接配置而定,默认为:`http://yourdomain/journals` - -### journals(List) - -#### 语法 - -```html -<#list journals.content as journal> -// do something -#list> -``` - -#### 参数 - -```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 -} -``` - -#### 示例 - -```html --
- <#list journals.content as journal>
-
- - ${journal.createTime?string('yyyy年MM月dd日')}:${journal.content!} - - #list> -
-
-
- - 2021年3月7日:内容1 - -
- - 2021年3月7日:内容2 - -
年份: ${archive.year?c}
--
- <#list archive.posts?sort_by("createTime")?reverse as post>
-
- - ${post.title!} - - #list> -
2019
- -2018
- -``` - -### 根据年月归档(archiveMonth) - -#### 语法 - -```html -<@postTag method="archiveMonth"> -// do something -@postTag> -``` - -参数: - -1. method:archiveMonth - -#### 返回参数 - -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 -}] -``` - -#### 示例 - -```html -<@postTag method="archiveMonth"> - <#list archives as archive> -${archive.year?c}-${archive.month?c}
--
- <#list archive.posts?sort_by("createTime")?reverse as post>
-
- - ${post.title!} - - #list> -
2019-01
- -2018-12
- -``` - -### 归档(archive) - -#### 语法 - -```html -<@postTag method="archive" type="year or month"> -// do something -@postTag> -``` - -参数: - -1. method:archive -2. type: `year` 或者 `month` - -#### 返回参数 - -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 -}] -``` - -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 -}] -``` - -#### 示例 - -```html -<@postTag method="archive" type="month"> - <#list archives as archive> -${archive.year?c}-${archive.month?c}
--
- <#list archive.posts?sort_by("createTime")?reverse as post>
-
- - ${post.title!} - - #list> -
2019-01
- -2018-12
- -``` - -### 根据分类 id 获取文章(listByCategoryId) - -#### 语法 - -```html -<@postTag method="listByCategoryId" categoryId="分类 id"> -// do something -@postTag> -``` - -参数: - -1. method:listByCategoryId -2. categoryId:分类 id - -#### 返回参数 - -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 -}] -``` - -#### 示例 - -```html -<@postTag method="listByCategoryId" top="${category.id?c}"> - 分类 ${category.name!} 下的文章: - <#list posts as post> - ${post.title!} - #list> -@postTag> -``` - -输出: - -```html -title1 -title2 -title3 -``` - -### 根据分类 slug 获取文章(listByCategorySlug) - -#### 语法 - -```html -<@postTag method="listByCategorySlug" categorySlug="分类 slug"> -// do something -@postTag> -``` - -参数: - -1. method:listByCategorySlug -2. categorySlug:分类 slug - -#### 返回参数 - -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 -}] -``` - -#### 示例 - -```html -<@postTag method="listByCategorySlug" categorySlug="${category.slug!}"> - 分类 ${category.name!} 下的文章: - <#list posts as post> - ${post.title!} - #list> -@postTag> -``` - -输出: - -```html -title1 -title2 -title3 -``` - -### 根据标签 id 获取文章(listByTagId) - -#### 语法 - -```html -<@postTag method="listByTagId" tagId="标签 id"> -// do something -@postTag> -``` - -参数: - -1. method:listByTagId -2. tagId:标签 id - -#### 返回参数 - -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 -}] -``` - -#### 示例 - -```html -<@postTag method="listByTagId" tagId="${tag.id?c}"> - 标签 ${tag.name!} 下的文章: - <#list posts as post> - ${post.title!} - #list> -@postTag> -``` - -输出: - -```html -title1 -title2 -title3 -``` - -### 根据标签 slug 获取文章(listByTagSlug) - -#### 语法 - -```html -<@postTag method="listByTagSlug" tagSlug="标签 slug"> -// do something -@postTag> -``` - -参数: - -1. method:listByTagSlug -2. tagSlug:标签 slug - -#### 返回参数 - -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 -}] -``` - -#### 示例 - -```html -<@postTag method="listByTagSlug" tagSlug="${tag.slug!}"> - 标签 ${tag.name!} 下的文章: - <#list posts as post> - ${post.title!} - #list> -@postTag> -``` - -输出: - -```html -title1 -title2 -title3 -``` - -## 评论(commentTag) - -### 获取最新评论(latest) - -#### 语法 - -```html -<@commentTag method="latest" top="获取条数"> -// do something -@commentTag> -``` - -参数: - -1. method:latest -2. top:所需要获取的条数 - -#### 返回参数 - -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" -}] -``` - -#### 示例 - -```html -<@commentTag method="latest" top="获取条数"> --
- <#list comments.content as comment>
-
- ${comment.author!}:${comment.content!} - #list> -
-
-
- author1:content1 -
- author2:content2 -
-
- <#list menus as menu>
-
- - ${menu.name!} - - #list> -
-
- <#list menus as menu>
-
-
- ${menu.name!}
- <#if menu.children?? && menu.children?size gt 0>
-
-
- <#list menu.children as child>
-
- - ${child.name!} - - #list> -
- #list>
-
-
- <#list menus as menu>
-
- - ${menu.name!} - - #list> -
-
- <#list menus as menu>
-
-
- ${menu.name!}
- <#if menu.children?? && menu.children?size gt 0>
-
-
- <#list menu.children as child>
-
- - ${child.name!} - - #list> -
- #list>
-
-
- <@linkTag method="list">
- <#list links as link>
-
- - - ${link.name!} - - - #list> - @linkTag> -
-
-
- - - Halo - - -
- - - Halo BBS - - -
-
- <@linkTag method="list">
- <#list links as link>
-
- - - ${link.name!} - - - #list> - @linkTag> -
-
-
- - - Halo BBS - - -
- - - Halo - - -
${team.team}
--
- <#list links as link>
-
- - - ${link.name!} - - - #list> -
Halo 相关
--
-
- - - Halo BBS - - -
- - - Halo - - -
网友们
--
-
- - - Ryan Wang's Blog - - -
- - - JohnNiang's Blog - - -
${team.team}
--
- <#list links as link>
-
- - - ${link.name!} - - - #list> -
Halo 相关
--
-
- - - Halo BBS - - -
- - - Halo - - -
网友们
--
-
- - - Ryan Wang's Blog - - -
- - - JohnNiang's Blog - - -
${team.team}
- <#list team.photos as photo> - - #list> - #list> -@photoTag> -``` - -输出: - -```html -风景
- - - -旅行
- - - -``` - -### 根据分组获取图片(listByTeam) - -#### 语法 - -```html -<@photoTag method="listByTeam" team="team 名称"> -// do something -@photoTag> -``` - -参数: - -1. method:listByTeam -2. team:team 名称 - -#### 返回参数 - -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" -}] -``` - -#### 示例 - -```html -<@photoTag method="listTeams" team="风景"> - <#list team.photos as photo> - - #list> -@photoTag> -``` - -输出: - -```html - - - -``` - -### 获取所有图片的数量(count) - -#### 语法 - -```html -<@photoTag method="count"> -// do something -@photoTag> -``` - -参数: - -1. method:count - -#### 返回参数 - -```json -count: long -``` - -#### 示例 - -```html -<@linkTag method="count"> -图片数量:${count!0} -@linkTag> -``` - -输出: - -```html -图片数量:20 -``` - -## 分页(paginationTag) - -### 获取首页文章列表的分页数据(index) - -#### 语法 - -```html -<@paginationTag method="index" page="${posts.number}" total="${posts.totalPages}" display="3"> -// do something -@paginationTag> -``` - -参数: - -1. method:index -2. page:当前页,通过 `${posts.number}` 得到 -3. total:总页数,通过 `${posts.totalPages}` 得到 -3. display:页码展示数量 - -#### 返回参数 - -pagination: - -```json -{ - "nextPageFullPath": "string", - "prevPageFullPath": "string", - "hasPrev": true, - "hasNext": true, - "rainbowPages": [{ - "page": 0, - "fullPath": "string", - "isCurrent": true - }] -} -``` - -#### 示例 - -```html --
- <@paginationTag method="index" page="${posts.number}" total="${posts.totalPages}" display="3">
- <#if pagination.hasPrev>
-
- - 上一页 - - #if> - <#list pagination.rainbowPages as number> - <#if number.isCurrent> -
- - ${number.page!} - - <#else> -
- - ${number.page!} - - #if> - #list> - <#if pagination.hasNext> -
- - 下一页 - - #if> - @paginationTag> -
-
- <@paginationTag method="archives" page="${posts.number}" total="${posts.totalPages}" display="3">
- <#if pagination.hasPrev>
-
- - 上一页 - - #if> - <#list pagination.rainbowPages as number> - <#if number.isCurrent> -
- - ${number.page!} - - <#else> -
- - ${number.page!} - - #if> - #list> - <#if pagination.hasNext> -
- - 下一页 - - #if> - @paginationTag> -
-
- <@paginationTag method="search" page="${posts.number}" total="${posts.totalPages}" keyword="${keyword}" display="3">
- <#if pagination.hasPrev>
-
- - 上一页 - - #if> - <#list pagination.rainbowPages as number> - <#if number.isCurrent> -
- - ${number.page!} - - <#else> -
- - ${number.page!} - - #if> - #list> - <#if pagination.hasNext> -
- - 下一页 - - #if> - @paginationTag> -
-
- <@paginationTag method="tagPosts" slug="${tag.slug!}" page="${posts.number}" total="${posts.totalPages}" display="3">
- <#if pagination.hasPrev>
-
- - 上一页 - - #if> - <#list pagination.rainbowPages as number> - <#if number.isCurrent> -
- - ${number.page!} - - <#else> -
- - ${number.page!} - - #if> - #list> - <#if pagination.hasNext> -
- - 下一页 - - #if> - @paginationTag> -
-
- <@paginationTag method="categoryPosts" slug="${category.slug!}" page="${posts.number}" total="${posts.totalPages}" display="3">
- <#if pagination.hasPrev>
-
- - 上一页 - - #if> - <#list pagination.rainbowPages as number> - <#if number.isCurrent> -
- - ${number.page!} - - <#else> -
- - ${number.page!} - - #if> - #list> - <#if pagination.hasNext> -
- - 下一页 - - #if> - @paginationTag> -
-
- <@paginationTag method="photos" page="${photos.number}" total="${photos.totalPages}" display="3">
- <#if pagination.hasPrev>
-
- - 上一页 - - #if> - <#list pagination.rainbowPages as number> - <#if number.isCurrent> -
- - ${number.page!} - - <#else> -
- - ${number.page!} - - #if> - #list> - <#if pagination.hasNext> -
- - 下一页 - - #if> - @paginationTag> -
-
- <@paginationTag method="journals" page="${journals.number}" total="${journals.totalPages}" display="3">
- <#if pagination.hasPrev>
-
- - 上一页 - - #if> - <#list pagination.rainbowPages as number> - <#if number.isCurrent> -
- - ${number.page!} - - <#else> -
- - ${number.page!} - - #if> - #list> - <#if pagination.hasNext> -
- - 下一页 - - #if> - @paginationTag> -
- - - -
- -> Halo 是一款现代化的个人独立博客系统,给习惯写博客的同学多一个选择。 - - - ------------------------------- - -## 简介 - -**Halo** `[ˈheɪloʊ]`,一个优秀的开源博客发布应用,值得一试。 - -[官网](https://halo.run) | [文档](https://docs.halo.run) | [社区](https://bbs.halo.run) | [Gitee](https://gitee.com/halo-dev) | [Telegram 频道](https://t.me/halo_dev) - -## 快速开始 - -### Fat Jar - -下载最新的 Halo 运行包: - -```bash -curl -L https://github.com/halo-dev/halo/releases/download/v1.4.15/halo-1.4.15.jar --output halo.jar -``` - -其他地址:驿外[1]断桥边,寂寞开无主。已是黄昏独自愁,更着风和雨
--
-
-
驿(yì)外:指荒僻、冷清之地。驿,驿站。 ↩︎
-
-
${settings.index_title!}
-#if> -``` - -```html -// 获取背景图片 - -<#if settings.background_cover?? && settings.background_cover != ''> - -#if> -``` - -```html -// 获取背景颜色 - - - -或者 - - - -``` - -```html -// 判断是否开启背景音乐 - -<#if settings.music_enabled!false> - do something... -#if> -``` - -```html -// 获取代码高亮主题 - - - -``` - -更多实例可参考:${archive.year?c}
- <#list archive.posts as post> - ${post.title!} - #list> -#list> -``` - -输出: - -```html -2021
-title1 -title2 -title3 -2020
-title4 -title5 -title6 -``` - -## 分类目录页面(categories.ftl) - -访问路径不固定,视固定链接配置而定,默认为:`http://yourdomain/categories` - -此页面无页面变量,可以使用 [模板标签](/developer-guide/theme/template-tag) 获取分类列表。 - -## 单个分类所属文章页面(category.ftl) - -访问路径不固定,视固定链接配置而定,默认为:`http://yourdomain/categories/{slug}` - -### posts(List) - -#### 语法 - -```html -<#list posts.content as post> -// do something -#list> -``` - -#### 参数 - -```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 -}] -``` - -#### 示例 - -遍历输出某个分类的文章: - -```html -<#list posts.content as post> - ${post.title!} -#list> -``` - -输出: - -```html -title1 -title2 -title3 -``` - -### category(Object) - -#### 语法 - -```html -${category.attribute} -``` - -注: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 -} -``` - -#### 示例 - -```html -分类:${category.name!} -``` - -输出: - -```html -分类:name1 -``` - -## 标签页面(tags.ftl) - -访问路径不固定,视固定链接配置而定,默认为:`http://yourdomain/tags` - -此页面无页面变量,可以使用 [模板标签](/developer-guide/theme/template-tag) 获取标签列表。 - -## 单个标签所属文章页面(tag.ftl) - -访问路径不固定,视固定链接配置而定,默认为:`http://yourdomain/tags/{slug}` - -### posts(List) - -#### 语法 - -```html -<#list posts.content as post> -// do something -#list> -``` - -#### 参数 - -```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 -}] -``` - -#### 示例 - -遍历输出某个标签的文章: - -```html -<#list posts.content as post> - ${post.title!} -#list> -``` - -输出: - -```html -title1 -title2 -title3 -``` - -### tag(Object) - -#### 语法 - -```html -${tag.attribute} -``` - -注:attribute 代表具体属性。 - -#### 参数 - -```json -{ - "createTime": "2020-10-11T06:14:30.595Z", - "fullPath": "string", - "id": 0, - "name": "string", - "slug": "string", - "thumbnail": "string" -} -``` - -#### 示例 - -```html -标签:${tag.name!} -``` - -输出: - -```html -标签:name1 -``` - -## 文章搜索结果页面(search.ftl) - -访问路径:`http://yourdomain/search?keyword=keyword` - -### keyword(String) - -#### 语法 - -```html -${keyword!} -``` - -#### 参数 - -无 - -#### 示例 - -```html -搜索关键字为:${keyword!} -``` - -### posts(List) - -#### 语法 - -```html -<#list posts.content as post> -// do something -#list> -``` - -#### 参数 - -```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 -}] -``` - -#### 示例 - -遍历输出某个搜索结果的文章: - -```html -<#list posts.content as post> - ${post.title!} -#list> -``` - -输出: - -```html -title1 -title2 -title3 -``` - -## 友情链接页面(links.ftl) - -访问路径不固定,视固定链接配置而定,默认为:`http://yourdomain/links` - -此页面无页面变量,可以使用 [模板标签](/developer-guide/theme/template-tag) 获取友情链接列表。 - -## 图库页面(photos.ftl) - -访问路径不固定,视固定链接配置而定,默认为:`http://yourdomain/photos` - -### photos(List) - -#### 语法 - -```html -<#list photos.content as photo> -// do something -#list> -``` - -#### 参数 - -```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 -} -``` - -#### 示例 - -```html -<#list photos.content as photo> - -#list> -``` - -输出: - -```html - - - -``` - -## 日志页面(journals.ftl) - -访问路径不固定,视固定链接配置而定,默认为:`http://yourdomain/journals` - -### journals(List) - -#### 语法 - -```html -<#list journals.content as journal> -// do something -#list> -``` - -#### 参数 - -```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 -} -``` - -#### 示例 - -```html --
- <#list journals.content as journal>
-
- - ${journal.createTime?string('yyyy年MM月dd日')}:${journal.content!} - - #list> -
-
-
- - 2021年3月7日:内容1 - -
- - 2021年3月7日:内容2 - -
年份: ${archive.year?c}
--
- <#list archive.posts?sort_by("createTime")?reverse as post>
-
- - ${post.title!} - - #list> -
2019
- -2018
- -``` - -### 根据年月归档(archiveMonth) - -#### 语法 - -```html -<@postTag method="archiveMonth"> -// do something -@postTag> -``` - -参数: - -1. method:archiveMonth - -#### 返回参数 - -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 -}] -``` - -#### 示例 - -```html -<@postTag method="archiveMonth"> - <#list archives as archive> -${archive.year?c}-${archive.month?c}
--
- <#list archive.posts?sort_by("createTime")?reverse as post>
-
- - ${post.title!} - - #list> -
2019-01
- -2018-12
- -``` - -### 归档(archive) - -#### 语法 - -```html -<@postTag method="archive" type="year or month"> -// do something -@postTag> -``` - -参数: - -1. method:archive -2. type: `year` 或者 `month` - -#### 返回参数 - -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 -}] -``` - -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 -}] -``` - -#### 示例 - -```html -<@postTag method="archive" type="month"> - <#list archives as archive> -${archive.year?c}-${archive.month?c}
--
- <#list archive.posts?sort_by("createTime")?reverse as post>
-
- - ${post.title!} - - #list> -
2019-01
- -2018-12
- -``` - -### 根据分类 id 获取文章(listByCategoryId) - -#### 语法 - -```html -<@postTag method="listByCategoryId" categoryId="分类 id"> -// do something -@postTag> -``` - -参数: - -1. method:listByCategoryId -2. categoryId:分类 id - -#### 返回参数 - -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 -}] -``` - -#### 示例 - -```html -<@postTag method="listByCategoryId" top="${category.id?c}"> - 分类 ${category.name!} 下的文章: - <#list posts as post> - ${post.title!} - #list> -@postTag> -``` - -输出: - -```html -title1 -title2 -title3 -``` - -### 根据分类 slug 获取文章(listByCategorySlug) - -#### 语法 - -```html -<@postTag method="listByCategorySlug" categorySlug="分类 slug"> -// do something -@postTag> -``` - -参数: - -1. method:listByCategorySlug -2. categorySlug:分类 slug - -#### 返回参数 - -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 -}] -``` - -#### 示例 - -```html -<@postTag method="listByCategorySlug" categorySlug="${category.slug!}"> - 分类 ${category.name!} 下的文章: - <#list posts as post> - ${post.title!} - #list> -@postTag> -``` - -输出: - -```html -title1 -title2 -title3 -``` - -### 根据标签 id 获取文章(listByTagId) - -#### 语法 - -```html -<@postTag method="listByTagId" tagId="标签 id"> -// do something -@postTag> -``` - -参数: - -1. method:listByTagId -2. tagId:标签 id - -#### 返回参数 - -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 -}] -``` - -#### 示例 - -```html -<@postTag method="listByTagId" tagId="${tag.id?c}"> - 标签 ${tag.name!} 下的文章: - <#list posts as post> - ${post.title!} - #list> -@postTag> -``` - -输出: - -```html -title1 -title2 -title3 -``` - -### 根据标签 slug 获取文章(listByTagSlug) - -#### 语法 - -```html -<@postTag method="listByTagSlug" tagSlug="标签 slug"> -// do something -@postTag> -``` - -参数: - -1. method:listByTagSlug -2. tagSlug:标签 slug - -#### 返回参数 - -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 -}] -``` - -#### 示例 - -```html -<@postTag method="listByTagSlug" tagSlug="${tag.slug!}"> - 标签 ${tag.name!} 下的文章: - <#list posts as post> - ${post.title!} - #list> -@postTag> -``` - -输出: - -```html -title1 -title2 -title3 -``` - -## 评论(commentTag) - -### 获取最新评论(latest) - -#### 语法 - -```html -<@commentTag method="latest" top="获取条数"> -// do something -@commentTag> -``` - -参数: - -1. method:latest -2. top:所需要获取的条数 - -#### 返回参数 - -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" -}] -``` - -#### 示例 - -```html -<@commentTag method="latest" top="获取条数"> --
- <#list comments.content as comment>
-
- ${comment.author!}:${comment.content!} - #list> -
-
-
- author1:content1 -
- author2:content2 -
-
- <#list menus as menu>
-
- - ${menu.name!} - - #list> -
-
- <#list menus as menu>
-
-
- ${menu.name!}
- <#if menu.children?? && menu.children?size gt 0>
-
-
- <#list menu.children as child>
-
- - ${child.name!} - - #list> -
- #list>
-
-
- <#list menus as menu>
-
- - ${menu.name!} - - #list> -
-
- <#list menus as menu>
-
-
- ${menu.name!}
- <#if menu.children?? && menu.children?size gt 0>
-
-
- <#list menu.children as child>
-
- - ${child.name!} - - #list> -
- #list>
-
-
- <@linkTag method="list">
- <#list links as link>
-
- - - ${link.name!} - - - #list> - @linkTag> -
-
-
- - - Halo - - -
- - - Halo BBS - - -
-
- <@linkTag method="list">
- <#list links as link>
-
- - - ${link.name!} - - - #list> - @linkTag> -
-
-
- - - Halo BBS - - -
- - - Halo - - -
${team.team}
--
- <#list links as link>
-
- - - ${link.name!} - - - #list> -
Halo 相关
--
-
- - - Halo BBS - - -
- - - Halo - - -
网友们
--
-
- - - Ryan Wang's Blog - - -
- - - JohnNiang's Blog - - -
${team.team}
--
- <#list links as link>
-
- - - ${link.name!} - - - #list> -
Halo 相关
--
-
- - - Halo BBS - - -
- - - Halo - - -
网友们
--
-
- - - Ryan Wang's Blog - - -
- - - JohnNiang's Blog - - -
${team.team}
- <#list team.photos as photo> - - #list> - #list> -@photoTag> -``` - -输出: - -```html -风景
- - - -旅行
- - - -``` - -### 根据分组获取图片(listByTeam) - -#### 语法 - -```html -<@photoTag method="listByTeam" team="team 名称"> -// do something -@photoTag> -``` - -参数: - -1. method:listByTeam -2. team:team 名称 - -#### 返回参数 - -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" -}] -``` - -#### 示例 - -```html -<@photoTag method="listTeams" team="风景"> - <#list team.photos as photo> - - #list> -@photoTag> -``` - -输出: - -```html - - - -``` - -### 获取所有图片的数量(count) - -#### 语法 - -```html -<@photoTag method="count"> -// do something -@photoTag> -``` - -参数: - -1. method:count - -#### 返回参数 - -```json -count: long -``` - -#### 示例 - -```html -<@linkTag method="count"> -图片数量:${count!0} -@linkTag> -``` - -输出: - -```html -图片数量:20 -``` - -## 分页(paginationTag) - -### 获取首页文章列表的分页数据(index) - -#### 语法 - -```html -<@paginationTag method="index" page="${posts.number}" total="${posts.totalPages}" display="3"> -// do something -@paginationTag> -``` - -参数: - -1. method:index -2. page:当前页,通过 `${posts.number}` 得到 -3. total:总页数,通过 `${posts.totalPages}` 得到 -3. display:页码展示数量 - -#### 返回参数 - -pagination: - -```json -{ - "nextPageFullPath": "string", - "prevPageFullPath": "string", - "hasPrev": true, - "hasNext": true, - "rainbowPages": [{ - "page": 0, - "fullPath": "string", - "isCurrent": true - }] -} -``` - -#### 示例 - -```html --
- <@paginationTag method="index" page="${posts.number}" total="${posts.totalPages}" display="3">
- <#if pagination.hasPrev>
-
- - 上一页 - - #if> - <#list pagination.rainbowPages as number> - <#if number.isCurrent> -
- - ${number.page!} - - <#else> -
- - ${number.page!} - - #if> - #list> - <#if pagination.hasNext> -
- - 下一页 - - #if> - @paginationTag> -
-
- <@paginationTag method="archives" page="${posts.number}" total="${posts.totalPages}" display="3">
- <#if pagination.hasPrev>
-
- - 上一页 - - #if> - <#list pagination.rainbowPages as number> - <#if number.isCurrent> -
- - ${number.page!} - - <#else> -
- - ${number.page!} - - #if> - #list> - <#if pagination.hasNext> -
- - 下一页 - - #if> - @paginationTag> -
-
- <@paginationTag method="search" page="${posts.number}" total="${posts.totalPages}" keyword="${keyword}" display="3">
- <#if pagination.hasPrev>
-
- - 上一页 - - #if> - <#list pagination.rainbowPages as number> - <#if number.isCurrent> -
- - ${number.page!} - - <#else> -
- - ${number.page!} - - #if> - #list> - <#if pagination.hasNext> -
- - 下一页 - - #if> - @paginationTag> -
-
- <@paginationTag method="tagPosts" slug="${tag.slug!}" page="${posts.number}" total="${posts.totalPages}" display="3">
- <#if pagination.hasPrev>
-
- - 上一页 - - #if> - <#list pagination.rainbowPages as number> - <#if number.isCurrent> -
- - ${number.page!} - - <#else> -
- - ${number.page!} - - #if> - #list> - <#if pagination.hasNext> -
- - 下一页 - - #if> - @paginationTag> -
-
- <@paginationTag method="categoryPosts" slug="${category.slug!}" page="${posts.number}" total="${posts.totalPages}" display="3">
- <#if pagination.hasPrev>
-
- - 上一页 - - #if> - <#list pagination.rainbowPages as number> - <#if number.isCurrent> -
- - ${number.page!} - - <#else> -
- - ${number.page!} - - #if> - #list> - <#if pagination.hasNext> -
- - 下一页 - - #if> - @paginationTag> -
-
- <@paginationTag method="photos" page="${photos.number}" total="${photos.totalPages}" display="3">
- <#if pagination.hasPrev>
-
- - 上一页 - - #if> - <#list pagination.rainbowPages as number> - <#if number.isCurrent> -
- - ${number.page!} - - <#else> -
- - ${number.page!} - - #if> - #list> - <#if pagination.hasNext> -
- - 下一页 - - #if> - @paginationTag> -
-
- <@paginationTag method="journals" page="${journals.number}" total="${journals.totalPages}" display="3">
- <#if pagination.hasPrev>
-
- - 上一页 - - #if> - <#list pagination.rainbowPages as number> - <#if number.isCurrent> -
- - ${number.page!} - - <#else> -
- - ${number.page!} - - #if> - #list> - <#if pagination.hasNext> -
- - 下一页 - - #if> - @paginationTag> -
- - - -
- -> Halo 是一款现代化的个人独立博客系统,给习惯写博客的同学多一个选择。 - - - ------------------------------- - -## 简介 - -**Halo** `[ˈheɪloʊ]`,一个优秀的开源博客发布应用,值得一试。 - -[官网](https://halo.run) | [文档](https://docs.halo.run) | [社区](https://bbs.halo.run) | [Gitee](https://gitee.com/halo-dev) | [Telegram 频道](https://t.me/halo_dev) - -## 快速开始 - -### Fat Jar - -下载最新的 Halo 运行包: - -```bash -curl -L https://github.com/halo-dev/halo/releases/download/v1.4.16/halo-1.4.16.jar --output halo.jar -``` - -其他地址:驿外[1]断桥边,寂寞开无主。已是黄昏独自愁,更着风和雨
--
-
-
驿(yì)外:指荒僻、冷清之地。驿,驿站。 ↩︎
-
-