mirror of
https://github.com/dillonzq/LoveIt.git
synced 2025-03-30 10:59:15 +02:00
fix(link): fix tags/categories link bug
This commit is contained in:
parent
a4116f14a7
commit
a0f31c35fe
7 changed files with 48 additions and 35 deletions
assets/css
layouts
resources/_gen/assets/scss/css
|
@ -6,8 +6,8 @@
|
|||
line-height: 3rem;
|
||||
}
|
||||
|
||||
.meta {
|
||||
font-size: .88rem;
|
||||
.post-meta {
|
||||
font-size: .875rem;
|
||||
color: $global-font-secondary-color;
|
||||
|
||||
span {
|
||||
|
|
|
@ -30,8 +30,7 @@
|
|||
font-size: 1.6rem;
|
||||
}
|
||||
|
||||
.meta {
|
||||
font-size: .875rem !important;
|
||||
.post-meta {
|
||||
a {
|
||||
color: $global-font-secondary-color !important;
|
||||
|
||||
|
|
|
@ -13,25 +13,30 @@
|
|||
</h1>
|
||||
|
||||
{{- /* Meta */ -}}
|
||||
<div class="meta">
|
||||
<div class="post-meta">
|
||||
{{- $author := .Params.author | default .Site.Author.name -}}
|
||||
{{- $authorLink := .Params.authorLink | default .Site.Author.link | default (relLangURL "/") -}}
|
||||
<a class="author" href="{{ $authorLink }}" rel="author" target="_blank">
|
||||
<i class="fas fa-user-circle fa-fw"></i>{{ $author }}
|
||||
</a>
|
||||
<span class="post-author">
|
||||
<a class="author" href="{{ $authorLink }}" rel="author" target="_blank">
|
||||
<i class="fas fa-user-circle fa-fw"></i>{{ $author }}
|
||||
</a>
|
||||
</span>
|
||||
|
||||
{{- $publish_date := .PublishDate.Format (.Site.Params.dateFormatToUse | default "2006-01-02") -}}
|
||||
{{ T "publish" }} <time datetime={{ $publish_date }}>{{ $publish_date }}</time>
|
||||
<span class="post-publish">
|
||||
{{ T "publish" }} <time datetime={{ $publish_date }}>{{ $publish_date }}</time>
|
||||
</span>
|
||||
|
||||
{{- with .Params.categories -}}
|
||||
<span class="post-category">
|
||||
{{- T "included" -}}
|
||||
<span class="post-category">
|
||||
{{- T "included" -}}
|
||||
{{- range . -}}
|
||||
{{- $name := . -}}
|
||||
{{- with $.Site.GetPage "taxonomy" (printf "categories/%s" $name) | default ($.Site.GetPage "taxonomy" (printf "categories/%s" ($name | urlize))) -}}
|
||||
<i class="far fa-folder fa-fw"></i>
|
||||
<a href="{{ .Permalink }}">{{ $name | humanize }}</a>
|
||||
{{- end -}}
|
||||
|
||||
<span>
|
||||
<a href="{{ `/categories/` | relLangURL }}{{ urlize .}}">
|
||||
<i class="far fa-folder fa-fw"></i>{{ . | humanize }}
|
||||
</a>
|
||||
</span>
|
||||
{{- end -}}
|
||||
</span>
|
||||
{{- end -}}
|
||||
|
@ -48,8 +53,10 @@
|
|||
{{- with .Params.tags -}}
|
||||
<div class="post-tags">
|
||||
{{- range . -}}
|
||||
<span class="tag">
|
||||
<a href="{{ "tags/" | absURL }}{{ . | urlize }}/"><i class="fas fa-tag fa-fw"></i> {{ . }}</a>
|
||||
<span>
|
||||
<a href="{{ `/tags/` | relLangURL }}{{ urlize .}}">
|
||||
<i class="fas fa-tag fa-fw"></i>{{ . }}
|
||||
</a>
|
||||
</span>
|
||||
{{- end -}}
|
||||
</div>
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
<div class="menu" id="menu-mobile">
|
||||
{{- $currentPage := . -}}
|
||||
{{- range .Site.Menus.main -}}
|
||||
<a class="menu-item" href="{{ .URL | absLangURL }}" title="{{ .Title }}">
|
||||
<a class="menu-item" href="{{ .URL | relLangURL }}" title="{{ .Title }}">
|
||||
{{- .Pre | safeHTML }}{{ .Name -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
|
|
@ -41,9 +41,11 @@
|
|||
<section>
|
||||
{{- with .Params.tags -}}
|
||||
{{- range . -}}
|
||||
<span class="tag">
|
||||
<a href="{{ "tags/" | absURL }}{{ . | urlize }}/"><i class="fas fa-tag fa-fw"></i> {{ . }}</a>
|
||||
</span>
|
||||
<span>
|
||||
<a href="{{ `/tags/` | relLangURL }}{{ urlize .}}">
|
||||
<i class="fas fa-tag fa-fw"></i>{{ . }}
|
||||
</a>
|
||||
</span>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
</section>
|
||||
|
|
|
@ -6,26 +6,31 @@
|
|||
<h1 class="single-title animated flipInX">{{ .Title }}</h1>
|
||||
|
||||
{{- /* Meta */ -}}
|
||||
<div class="meta">
|
||||
<div class="meta-line">
|
||||
<div class="post-meta">
|
||||
<div class="post-meta-line">
|
||||
{{- $author := .Params.author | default .Site.Author.name -}}
|
||||
{{- $authorLink := .Params.authorLink | default .Site.Author.link | default (relLangURL "/") -}}
|
||||
<a class="author" href="{{ $authorLink }}" rel="author" target="_blank">
|
||||
<i class="fas fa-user-circle fa-fw"></i>{{ $author }}
|
||||
</a>
|
||||
<span class="post-author">
|
||||
<a class="author" href="{{ $authorLink }}" rel="author" target="_blank">
|
||||
<i class="fas fa-user-circle fa-fw"></i>{{ $author }}
|
||||
</a>
|
||||
</span>
|
||||
|
||||
{{- with .Params.categories -}}
|
||||
<span class="post-category">
|
||||
{{- T "included" -}}
|
||||
<span class="post-category">
|
||||
{{- T "included" -}}
|
||||
{{- range . -}}
|
||||
{{- $name := . -}}
|
||||
{{- with $.Site.GetPage "taxonomy" (printf "categories/%s" $name) | default ($.Site.GetPage "taxonomy" (printf "categories/%s" ($name | urlize))) -}}
|
||||
<i class="far fa-folder fa-fw"></i><a href="{{ .Permalink }}">{{ $name | humanize }}</a>
|
||||
{{- end -}}
|
||||
|
||||
<span>
|
||||
<a href="{{ `/categories/` | relLangURL }}{{ urlize .}}">
|
||||
<i class="far fa-folder fa-fw"></i>{{ . | humanize }}
|
||||
</a>
|
||||
</span>
|
||||
{{- end -}}
|
||||
</span>
|
||||
{{- end -}}
|
||||
</div>
|
||||
<div class="meta-line">
|
||||
<div class="post-meta-line">
|
||||
{{- $publish_date := .PublishDate.Format (.Site.Params.dateFormatToUse | default "2006-01-02") -}}
|
||||
<i class="far fa-calendar-alt fa-fw"></i><time datetime={{ $publish_date }}>{{ $publish_date }}</time>
|
||||
<i class="fas fa-pencil-alt fa-fw"></i>{{ T "wordCount" .WordCount }}
|
||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Add table
Reference in a new issue