Skip to content

Commit

Permalink
feat: add archive.monthFormat parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
razonyang committed Nov 5, 2023
1 parent f663634 commit f334678
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions exampleSite/content/docs/layouts/archives/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,5 @@ The content of those files just contain a `title` parameter.
|---|:-:|:-:|---
| `archive` | Object | - | Archive.
| `archive.dateFormat` | String | `Jan 2` | Archive date format.
| `archive.monthFormat` | String | `January` | Archive month format, e.g. `1`, `01`, `Jan` and `January`.
| `archive.basePath` | String | `/archives` |
1 change: 1 addition & 0 deletions exampleSite/content/docs/layouts/archives/index.zh-hans.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,5 @@ $ tree content/archives
|---|:-:|:-:|---
| `archive` | Object | - | Archive.
| `archive.dateFormat` | String | `Jan 2` | Archive date format.
| `archive.monthFormat` | String | `January` | Archive month format, e.g. `1`, `01`, `Jan` and `January`.
| `archive.basePath` | String | `/archives` |
1 change: 1 addition & 0 deletions exampleSite/content/docs/layouts/archives/index.zh-hant.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,5 @@ $ tree content/archives
|---|:-:|:-:|---
| `archive` | Object | - | Archive.
| `archive.dateFormat` | String | `Jan 2` | Archive date format.
| `archive.monthFormat` | String | `January` | Archive month format, e.g. `1`, `01`, `Jan` and `January`.
| `archive.basePath` | String | `/archives` |
2 changes: 1 addition & 1 deletion layouts/partials/archives/year.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{{- $pages = where $pages ".Date" ">=" $fromDate }}
{{- $pages = where $pages ".Date" "<" $toDate }}
{{- range $pages.GroupByDate "01" -}}
{{- $month := (time (printf "2006-%s-01" .Key)).Format "January" -}}
{{- $month := (time (printf "2006-%s-01" .Key)).Format (default "January" site.Params.archive.monthFormat) -}}
<div class="archive card row component border-1" data-date="{{ $month }}">
<div class="card-header">
<h2 class="card-title fs-4 text-surface">{{ $month }}</h2>
Expand Down

0 comments on commit f334678

Please sign in to comment.