Feat: add pin icon in home post list and add repost icon in section .etc.

This commit is contained in:
Cell
2023-12-27 16:30:36 +08:00
parent 0c3148b3ee
commit da54fef151
20 changed files with 96 additions and 51 deletions
+4 -4
View File
@@ -30,19 +30,19 @@
.ms-1,
.mx-1 {
margin-left: 0.25rem !important;
margin-left: 0.25em !important;
}
.me-1,
.mx-1 {
margin-right: 0.25rem !important;
margin-right: 0.25em !important;
}
.ps-1,
.px-1 {
padding-left: 0.25rem !important;
padding-left: 0.25em !important;
}
.pe-1,
.px-1 {
padding-right: 0.25rem !important;
padding-right: 0.25em !important;
}
@each $color, $value in $theme-colors {
+10 -6
View File
@@ -10,15 +10,19 @@
font-weight: bold;
line-height: 140%;
.icon-repost {
color: var(--#{$prefix}success);
.icon-pin {
display: inline-block;
width: max-content;
margin-right: 0.25rem;
transform: rotate(30deg);
margin-right: 0.25em;
@extend .text-danger;
}
[data-theme='dark'] & {
color: var(--#{$prefix}success-dark);
}
.icon-repost {
display: inline-block;
width: max-content;
margin-right: 0.25em;
@extend .text-success;
}
}
+4 -3
View File
@@ -103,9 +103,10 @@ other = "Teilen auf"
# === posts/single.html ===
[single]
contents= "Inhalt"
repost= ""
publishedOnDate= "veröffentlicht an {{ .Date }}"
contents = "Inhalt"
pin = ""
repost = ""
publishedOnDate = "veröffentlicht an {{ .Date }}"
views = "Aufrufe"
comments = "Kommentare"
author = "Autor"
+1
View File
@@ -103,6 +103,7 @@ other = "Share on"
# === posts/single.html ===
[single]
contents = "Contents"
pin = "Pin to top"
repost = "Repost"
publishedOnDate = "published on {{ .Date }}"
views = "views"
+4 -3
View File
@@ -103,9 +103,10 @@ other = "Compartir en"
# === posts/single.html ===
[single]
contents= "Contenido"
repost= ""
publishedOnDate= "publicado el {{ .Date }}"
contents = "Contenido"
pin = ""
repost = ""
publishedOnDate = "publicado el {{ .Date }}"
views = "vistas"
comments = "Comentarios"
author = "Autor"
+4 -3
View File
@@ -102,9 +102,10 @@ other = "Partager via"
# === posts/single.html ===
[single]
contents= "Contenus"
repost= "Reposter"
publishedOnDate= "publié le {{ .Date }}"
contents = "Contenus"
pin = ""
repost = "Reposter"
publishedOnDate = "publié le {{ .Date }}"
views = "vues"
comments = "commentaires"
author = "Auteur"
+4 -3
View File
@@ -103,9 +103,10 @@ other = "Condividi su"
# === posts/single.html ===
[single]
contents= "Contenuti"
repost= ""
publishedOnDate= "pubblicato su {{ .Date }}"
contents = "Contenuti"
pin = ""
repost = ""
publishedOnDate = "pubblicato su {{ .Date }}"
views = "visualizzazioni"
comments = "commenti"
author = "Autore"
+4 -3
View File
@@ -103,9 +103,10 @@ other = "Udostępnij na"
# === posts/single.html ===
[single]
contents= "Spis treści"
repost= ""
publishedOnDate= "opublikowano {{ .Date }}"
contents = "Spis treści"
pin = ""
repost = ""
publishedOnDate = "opublikowano {{ .Date }}"
views = "wyświetleń"
comments = "komentarzy"
author = "Autor"
+4 -3
View File
@@ -103,9 +103,10 @@ other = "Compartilhe em"
# === posts/single.html ===
[single]
contents= "Conteúdos"
repost= ""
publishedOnDate= "publicado em {{ .Date }}"
contents = "Conteúdos"
pin = ""
repost = ""
publishedOnDate = "publicado em {{ .Date }}"
views = "visualizações"
comments = "comentários"
author = "Autor"
+4 -3
View File
@@ -103,9 +103,10 @@ other = "Distribuie pe"
# === posts/single.html ===
[single]
contents= "Cuprins"
repost= ""
publishedOnDate= "publicat la {{ .Date }}"
contents = "Cuprins"
pin = ""
repost = ""
publishedOnDate = "publicat la {{ .Date }}"
views = "vizualizări"
comments = "comentarii"
author = "Autor"
+4 -3
View File
@@ -103,9 +103,10 @@ other = "Поделиться в"
# === posts/single.html ===
[single]
contents= "Содержание"
repost= ""
publishedOnDate= "Опубликовано {{ .Date }}"
contents = "Содержание"
pin = ""
repost = ""
publishedOnDate = "Опубликовано {{ .Date }}"
views = "просмотров"
comments = "комментариев"
author = "Автор"
+4 -3
View File
@@ -103,9 +103,10 @@ other = "Подели на"
# === posts/single.html ===
[single]
contents= "Садржаји"
repost= ""
publishedOnDate= "објављено {{ .Date }}"
contents = "Садржаји"
pin = ""
repost = ""
publishedOnDate = "објављено {{ .Date }}"
views = "прегледа"
comments = "коментари"
author = "Аутор"
+4 -3
View File
@@ -102,9 +102,10 @@ other = "Chia sẻ trên"
# === posts/single.html ===
[single]
contents= "Nội dung"
repost= ""
publishedOnDate= "đăng ngày {{ .Date }}"
contents = "Nội dung"
pin = ""
repost = ""
publishedOnDate = "đăng ngày {{ .Date }}"
views = "lượt xem"
comments = "bình luận"
author = "Tác giả"
+4 -3
View File
@@ -101,9 +101,10 @@ other = "分享到"
# === posts/single.html ===
[single]
contents= "目录"
repost= "转载"
publishedOnDate= "发布于 {{ .Date }}"
contents = "目录"
pin = "置顶"
repost = "转载"
publishedOnDate = "发布于 {{ .Date }}"
views = "次阅读"
comments = "条评论"
author = "作者"
+4 -3
View File
@@ -101,9 +101,10 @@ other = "分享到"
# === posts/single.html ===
[single]
contents= "目錄"
repost= "轉貼"
publishedOnDate= "發佈於 {{ .Date }}"
contents = "目錄"
pin = "置頂"
repost = "轉貼"
publishedOnDate = "發佈於 {{ .Date }}"
views = "次閱讀"
comments = "條評論"
author = "作者"
+7 -1
View File
@@ -40,7 +40,13 @@
<h2 class="group-title">{{ .Key }}</h2>
{{- range .Pages -}}
<article class="archive-item">
<a href="{{ .RelPermalink }}" class="archive-item-link">{{- .LinkTitle -}}</a>
<a href="{{ .RelPermalink }}" class="archive-item-link">
{{- $repost := .Params.repost | default dict -}}
{{- if eq $repost.enable true -}}
{{- dict "Class" "fa-solid fa-share fa-fw text-success me-1" | partial "plugin/icon.html" -}}
{{- end -}}
{{- .LinkTitle -}}
</a>
<span class="archive-item-date" title='{{ "2006-01-02 15:04:05" | .Date.Format }}'>
{{- .Date | dateFormat ($.Site.Params.section.dateFormat | default "01-02") -}}
</span>
+5 -1
View File
@@ -19,7 +19,11 @@
{{- /* Title */ -}}
<h2 class="single-title" itemprop="name headline">
{{ $repost := $params.repost | default dict }}
{{- with $params.weight -}}
{{- $icon := dict "Class" "fa-solid fa-thumbtack fa-fw" -}}
<span title="{{ T "single.pin" }}" class="icon-pin">{{- $icon | partial "plugin/icon.html" -}}</span>
{{- end -}}
{{- $repost := $params.repost | default dict -}}
{{- with $repost -}}
{{- if eq .Enable true -}}
{{- $icon := dict "Class" "fa-solid fa-share fa-fw" -}}
+7 -1
View File
@@ -37,7 +37,13 @@
<h3 class="group-title">{{ .Key }}</h3>
{{- range .Pages -}}
<article class="archive-item">
<a href="{{ .RelPermalink }}" class="archive-item-link">{{- .LinkTitle -}}</a>
<a href="{{ .RelPermalink }}" class="archive-item-link">
{{- $repost := .Params.repost | default dict -}}
{{- if eq $repost.enable true -}}
{{- dict "Class" "fa-solid fa-share fa-fw text-success me-1" | partial "plugin/icon.html" -}}
{{- end -}}
{{- .LinkTitle -}}
</a>
<span class="archive-item-date" title='{{ "2006-01-02 15:04:05" | .Date.Format }}'>
{{- .Date | dateFormat ($.Site.Params.list.dateFormat | default "01-02") -}}
</span>
+7 -1
View File
@@ -15,7 +15,13 @@
</h3>
{{- range first 5 $pages -}}
<article class="archive-item">
<a href="{{ .RelPermalink }}" class="archive-item-link">{{- .LinkTitle -}}</a>
<a href="{{ .RelPermalink }}" class="archive-item-link">
{{- $repost := .Params.repost | default dict -}}
{{- if eq $repost.enable true -}}
{{- dict "Class" "fa-solid fa-share fa-fw text-success me-1" | partial "plugin/icon.html" -}}
{{- end -}}
{{- .LinkTitle -}}
</a>
</article>
{{- end -}}
{{- if gt (len $pages) 5 -}}
+7 -1
View File
@@ -15,7 +15,13 @@
</h3>
{{- range first 5 $pages -}}
<article class="archive-item">
<a href="{{ .RelPermalink }}" class="archive-item-link">{{- .LinkTitle -}}</a>
<a href="{{ .RelPermalink }}" class="archive-item-link">
{{- $repost := .Params.repost | default dict -}}
{{- if eq $repost.enable true -}}
{{- dict "Class" "fa-solid fa-share fa-fw text-success me-1" | partial "plugin/icon.html" -}}
{{- end -}}
{{- .LinkTitle -}}
</a>
</article>
{{- end -}}
{{- if gt (len $pages) 5 -}}