Skip to content

Commit

Permalink
fix(uglyurls): uglyurls with tag and categories terms (#129)
Browse files Browse the repository at this point in the history
Closes #89
  • Loading branch information
creaink authored and olOwOlo committed Mar 31, 2019
1 parent 4fe2685 commit f14d7b5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions exampleSite/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ copyright = "" # default: author.name ↓ # 默认为下面配
customCSS = []
customJS = []

uglyURLs = false # please keep same with uglyurls setting

[params.publicCDN] # load these files from public cdn # 启用公共CDN,需自行定义
enable = true
jquery = '<script src="https://cdn.jsdelivr.net/npm/jquery@3.2.1/dist/jquery.min.js" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin="anonymous"></script>'
Expand Down
6 changes: 3 additions & 3 deletions layouts/_default/terms.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
</div>
<div class="terms-tags">
{{ range $key, $value := $terms -}}
<a class="terms-link" href="{{ $name | relLangURL }}/{{ $value.Term | urlize }}/">
<a class="terms-link" href="{{ $name | relLangURL }}/{{ $value.Term | urlize }}{{ if $.Site.Params.uglyURLs }}.html{{else}}/{{ end }}">
{{ $value.Term }}
<span class="terms-count">{{ len $value.Pages }}</span>
</a>
Expand All @@ -33,12 +33,12 @@
</div>
<div class="terms-tags">
{{- range $key, $value := $terms }}
<a class="terms-link" href="{{ $name | relLangURL }}/{{ $value.Term | urlize }}/">
<a class="terms-link" href="{{ $name | relLangURL }}/{{ $value.Term | urlize }}{{ if $.Site.Params.uglyURLs }}.html{{else}}/{{ end }}">
{{ $value.Term }}
<span class="terms-count">{{ len $value.Pages }}</span>
</a>
{{ end -}}
</div>
</div>
{{- end }}
{{- end }}
{{- end }}

0 comments on commit f14d7b5

Please sign in to comment.