You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 8186eec
Browse filesBrowse the repository at this point in the historyBrowse files
- config: Auto Sidebar blog option on; Auto Sidebar 0.11.0 and Auto Navbar 0.8.2
- docs: Auto Sidebar Grouping and Blogs sections, blog page notes, scopes demo sidebars sorted by date
Copy file name to clipboardExpand all lines: docs/plugins/auto-sidebar/index.md
+23Lines changed: 23 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -72,6 +72,7 @@ A line that starts with a dot is a setting for the folder, not an entry. Every s
72
72
|`.sort: key [asc\|desc], …`| Order the entries this file doesn't list by `key`. Default: `name`. |
73
73
|`.limit: n`| Show at most `n` of the entries this file doesn't list, after sorting. `0` for no limit. |
74
74
|`.more: Text`| When `.limit` left entries out, end with a link to the landing page titled `Text`. |
75
+
|`.group: year\|month\|blog`| Put the entries this file doesn't list in groups. See [Grouping](#grouping). |
75
76
|`.hide`| Hide this folder's own link, but keep showing its children. |
76
77
|`.hideall` or `.hide-all`| Leave this folder and everything under it out of the sidebar. |
77
78
@@ -109,6 +110,27 @@ A folder with hundreds of pages makes a sidebar too long to use, and VitePress s
109
110
-`.more: Older posts` ends the list with a link to the folder's landing page, but only when entries were left out. The blog doesn't need one: its landing page is already listed as "All posts".
110
111
-`.limit: 0` means no limit. The `limit` and `more` options set both for every folder; a folder's own lines win.
111
112
113
+
### Grouping
114
+
115
+
`.group: month` puts the entries a `.sidebar` doesn't list into one group per month of their date ("October 2026"), after sorting and `.limit`; `.group: year` into one per year. `.group: blog` groups a main blog's site-wide posts by the section blog they came from (see [Blogs](#blogs)).
116
+
117
+
- Each group sits where its first entry falls, so with posts newest first, the months run newest first too.
118
+
- The month is the one the date is written in, whatever its offset.
119
+
- Listed entries, subfolders and undated pages stay outside the groups.
120
+
121
+
### Blogs
122
+
123
+
With `blog: true`, each [Blog](/plugins/blog/) folder lists the posts its blog page lists. This site turns it on.
124
+
125
+
- A folder whose landing page is a blog (`blog-index`) and has no `.sort` lists its posts pinned first, then newest first.
126
+
- The main blog's folder (`blog-index: { scope: site }`) also lists every `scope: site` post in the folders it covers, sorted in with its own. So a site-wide post in a section blog shows twice: in its section and in the main blog.
127
+
- Those posts count toward `.limit`, and `.exclude` files and `excludeFrontmatter` hide them like any page.
128
+
-`.group: blog` in the main blog's `.sidebar` puts them in one group per section blog, linked to its page. A section blog whose folder is right inside the main blog's already has its group there, so its posts aren't repeated.
129
+
130
+
The [Scopes Demo](/plugins/blog/demo/) in this sidebar shows it: its site-wide team post is listed under Scopes Demo and under Team Blog, and the section-only post only under Team Blog. The demo's `.sidebar` keeps the Team Blog group below the posts:
131
+
132
+
<<< @/plugins/blog/demo/.sidebar{txt}
133
+
112
134
### Recipes
113
135
114
136
`.sort` and `.limit` turn a folder that grows every week into a sidebar that stays short and current. Some realistic setups:
@@ -204,6 +226,7 @@ index.md:All decisions
204
226
|`sort`|`'name'`| Order for unlisted entries in every folder, e.g. `'date desc'`. See [Sorting](#sorting). |
205
227
|`limit`|`0`| Most unlisted entries every folder shows, after sorting. See [Limiting](#limiting). |
206
228
|`more`| none | Link text for the landing page when a limit left entries out. |
229
+
|`blog`|`false`| Follow [Blog](/plugins/blog/#scopes) scopes in blog folders. See [Blogs](#blogs). |
207
230
|`groupTitleFromIndex`|`false`| Label a folder's group with its landing page's title. |
208
231
|`verbose`|`false`| Log each folder as it is processed. |
Copy file name to clipboardExpand all lines: docs/plugins/blog/index.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -236,7 +236,7 @@ The list goes where `<!-- blog-posts -->` is, or after the page's content if the
236
236
237
237
Before 0.4.0, these settings were called `sticky` and `stickyLimit`. The old names are still read, so older posts keep working.
238
238
239
-
To keep pinned posts on top of the sidebar too, sort the blog folder with [Auto Sidebar](/plugins/auto-sidebar/#sorting)'s `.sort` setting, by pinning and then date. This site's blog does:
239
+
To keep pinned posts on top of the sidebar too, turn on [Auto Sidebar](/plugins/auto-sidebar/#blogs)'s `blog` option, or sort the blog folder with its `.sort` setting, by pinning and then date. This site's blog does both:
240
240
241
241
<<< @/blog/.sidebar{txt}
242
242
@@ -363,6 +363,8 @@ Scopes decide which blog lists a post.
363
363
364
364
So a site with only a main blog needs no scope settings at all, and a post inside a section only reaches the main blog when it says `scope: site`. The [Scopes Demo](/plugins/blog/demo/) shows all three cases live.
365
365
366
+
[Auto Sidebar](/plugins/auto-sidebar/#blogs)'s `blog` option follows the same scopes: a `scope: site` post is listed in its section's folder and in the main blog's folder. A post in a folder with no section blog of its own stays in that folder's group.
0 commit comments