Skip to content

Commit

Permalink
docs: update the docs/content pages
Browse files Browse the repository at this point in the history
Document the selection orders of summary and thumbnail
  • Loading branch information
razonyang committed Mar 19, 2022
1 parent a0e878f commit 62935e0
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 2 deletions.
24 changes: 22 additions & 2 deletions exampleSite/content/docs/content/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,28 @@ $ hugo new posts/new-post/index.zh-cn.md
> Please remind that, the created posts are generally in draft state. You'll need to specify the `-D` parameter of the command `hugo server` for previewing.
> Similarly, you need to change the `draft` to `false` or remove `draft` parameter if you want to publish the article.
## Summary Selection Order

1. If `post.excerpt = "description"` and `description` is not empty, then it'll be used.
1. Manual splitting via <code>&lt;!--more--&gt;</code>.
1. If `summary` on front matter isn't empty, then `summary` will be selected.
1. The text of content will be cut off by `post.excerptMaxLength` and formatted in plain text or HTML when `post.plainifyExcerpt = ture`.

```toml {title="config/_default/params.toml"}
[post]
# excerpt = "description"
# excerptMaxLength = 120
# copyright = false # Whether to display copyright section on each post.
# plainifyExcerpt = false # Format excerpt in HTML if false.
```

## Thumbnail Selection Order

1. The `images` on front matter are preferred.
1. Page images resources that match the filename's patterns: `*feature*`, `*cover*` and `*thumbnail*`. Such as `posts/my-page/feature.png`.

> The page images resources will be resized to several smaller versions to suit the users devices for saving the bandwidth.
## Pinning Posts

You can pin posts on the home page by setting `pinned` to `true` on the front matter.
Expand All @@ -93,8 +115,6 @@ weight = 100

> If there is multiple pinned posts, they are sorted by `weight` in descending order.
### Site Parameters

```toml {title="config/_default/params.toml"}
pinnedPost = false # Disable pinned posts globally.
pinnedPostCount = 2 # The number of pinned posts shown on home page.
Expand Down
22 changes: 22 additions & 0 deletions exampleSite/content/docs/content/index.zh-cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,28 @@ $ hugo new posts/new-post/index.zh-cn.md

> 请注意:创建的文章一般处于草稿状态,本地预览时,`hugo server` 需要指定 `-D` 参数才能预览草稿文章。文章发布时,需要将 `draft` 改为 `false`,或者直接移除 `draft` 参数。
## Summary Selection Order

1. If `post.excerpt = "description"` and `description` is not empty, then it'll be used.
1. Manual splitting via <code>&lt;!--more--&gt;</code>.
1. If `summary` on front matter isn't empty, then `summary` will be selected.
1. The text of content will be cut off by `post.excerptMaxLength` and formatted in plain text or HTML when `post.plainifyExcerpt = ture`.

```toml {title="config/_default/params.toml"}
[post]
# excerpt = "description"
# excerptMaxLength = 120
# copyright = false # Whether to display copyright section on each post.
# plainifyExcerpt = false # Format excerpt in HTML if false.
```

## Thumbnail Selection Order

1. The `images` on front matter are preferred.
1. Page images resources that match the filename's patterns: `*feature*`, `*cover*` and `*thumbnail*`. Such as `posts/my-page/feature.png`.

> The page images resources will be resized to several smaller versions to suit the users devices for saving the bandwidth.
## 文章置顶

你可以通过在 front matter 设置 `pinned``true` 以置顶文章。
Expand Down
22 changes: 22 additions & 0 deletions exampleSite/content/docs/content/index.zh-tw.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,28 @@ $ hugo new posts/new-post/index.zh-tw.md

> 請注意:創建的文章一般處於草稿狀態,本地預覽時,`hugo server` 需要指定 `-D` 參數才能預覽草稿文章。文章發佈時,需要將 `draft` 改為 `false`,或者直接移除 `draft` 參數。
## Summary Selection Order

1. If `post.excerpt = "description"` and `description` is not empty, then it'll be used.
1. Manual splitting via <code>&lt;!--more--&gt;</code>.
1. If `summary` on front matter isn't empty, then `summary` will be selected.
1. The text of content will be cut off by `post.excerptMaxLength` and formatted in plain text or HTML when `post.plainifyExcerpt = ture`.

```toml {title="config/_default/params.toml"}
[post]
# excerpt = "description"
# excerptMaxLength = 120
# copyright = false # Whether to display copyright section on each post.
# plainifyExcerpt = false # Format excerpt in HTML if false.
```

## Thumbnail Selection Order

1. The `images` on front matter are preferred.
1. Page images resources that match the filename's patterns: `*feature*`, `*cover*` and `*thumbnail*`. Such as `posts/my-page/feature.png`.

> The page images resources will be resized to several smaller versions to suit the users devices for saving the bandwidth.
## 文章置頂

你可以通過在 front matter 設置 `pinned``true` 以置頂文章。
Expand Down

0 comments on commit 62935e0

Please sign in to comment.