feat(config): add .Params.widgets.archive.path

This commit is contained in:
Jimmy Cai 2020-09-06 13:28:24 +02:00
parent 06c724c141
commit e728263d13
No known key found for this signature in database
GPG Key ID: 3EA408E527F37B18
2 changed files with 3 additions and 1 deletions

View File

@ -21,6 +21,8 @@ title = "Example Site"
enabled = ['archive', 'tag-cloud']
[params.widgets.archive]
limit = 5
### Archive page relative URL
path = "archive"
[params.widgets.tagCloud]
limit = 10
[params.opengraph]

View File

@ -12,7 +12,7 @@
{{ range first .Site.Params.widgets.archive.limit ($archive) }}
{{ $id := lower (replace .Key " " "-") }}
<div class="archive-year">
<a href="{{ $.Site.BaseURL }}/archive#{{ $id }}">
<a href="{{ $.Site.BaseURL }}{{ $.Site.Params.widgets.archive.path }}#{{ $id }}">
<span class="year">{{ .Key }}</span>
<span class="count">{{ len .Pages }}</span>
</a>