File tree 4 files changed +44
-26
lines changed
4 files changed +44
-26
lines changed Original file line number Diff line number Diff line change 14
14
"social-comments" : " Social Comments" ,
15
15
"post-page" : " Post Page" ,
16
16
"about-page" : " About Page" ,
17
+ "archives-page" : " Archives Page" ,
17
18
"search" : " Search" ,
18
19
"summary-images" : " Summary Images" ,
19
20
"syntax-highlighting" : " Syntax Highlighting" ,
20
21
"custom-archives-header" : " Custom Archives Header" ,
21
22
"social-links" : " Social Links" ,
22
- "custom-nav-items" : " Custom Nav Items" ,
23
23
"light-and-dark-mode" : " Light and Dark Mode" ,
24
24
"custom" : " Custom Theme" ,
25
25
"decap-cms" : " Decap CMS" ,
Original file line number Diff line number Diff line change
1
+ # Archives Page
2
+
3
+ Archives page is a list of all posts by timeline. It will be rendered as ` /posts ` .
4
+
5
+ ## Custom Header
6
+
7
+ You can custom your archives page's header by placing a ` _index.md ` in ` content/posts ` .
8
+
9
+ For example, paste below in ` _index.md ` :
10
+
11
+ ``` markdown
12
+ ---
13
+ title: Archives
14
+ ---
15
+
16
+ All posts by timeline.
17
+ ```
18
+
19
+ These will be rendered as:
20
+
21
+ ``` html
22
+ <h1 class =" text-3xl" >Archives</h1 >
23
+ <p class =" text-sm" >All posts by timeline.</p >
24
+ ```
25
+
26
+ One is the title, and the other is the description.
27
+
28
+ ## Custom Group Layout
29
+
30
+ The timeline is grouped by year by default. You can use a custom layout to group by month or any other way.
31
+ This can be done by adding a ` groupLayout ` field in the front matter of the ` _index.md ` file.
32
+
33
+ For example, in ` content/posts/_index.md ` :
34
+
35
+ ``` markdown
36
+ ---
37
+ groupLayout: Jan 2006
38
+ ---
39
+ ```
40
+
41
+ For how to define the layout, please refer to [ layout string] ( https://gohugo.io/methods/pages/groupbydate/#layout-string ) .
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -16,7 +16,8 @@ <h1 class="text-3xl">
16
16
17
17
< div class ="max-w-[65ch] mx-auto mt-8 lg:mt-12 ">
18
18
< ul class ="timeline timeline-vertical ">
19
- {{ range .Pages.GroupByDate "2006" }}
19
+ {{ $groupLayout := default "2006" .Params.groupLayout }}
20
+ {{ range .Pages.GroupByDate $groupLayout }}
20
21
< li class ="[--timeline-col-start:64px] ">
21
22
< hr class ="dark:bg-base-content " />
22
23
< div class ="timeline-start !justify-self-start ">
You can’t perform that action at this time.
0 commit comments