refactor: rename article-footer to article-meta (#1293)
* refactor: rename `article-footer` to `article-meta`, and remove unnecesary structures * fix: Update default article license URL to point to Creative Commons.
This commit is contained in:
@@ -71,12 +71,11 @@
|
|||||||
gap: 8px;
|
gap: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.article-footer,
|
.article-meta {
|
||||||
.article-translations,
|
|
||||||
.article-header-tags {
|
|
||||||
display: flex;
|
display: flex;
|
||||||
color: var(--card-text-color-tertiary);
|
flex-direction: column;
|
||||||
gap: var(--spacing-md);
|
gap: var(--spacing-lg);
|
||||||
|
font-size: 1.4rem;
|
||||||
|
|
||||||
svg {
|
svg {
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
@@ -86,30 +85,22 @@
|
|||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&,
|
||||||
time,
|
time,
|
||||||
a {
|
a,
|
||||||
|
span {
|
||||||
font-size: 1.4rem;
|
font-size: 1.4rem;
|
||||||
color: var(--card-text-color-tertiary);
|
color: var(--card-text-color-tertiary);
|
||||||
}
|
}
|
||||||
|
|
||||||
& > div {
|
& > .inline-meta {
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: var(--spacing-md);
|
gap: var(--spacing-md);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.article-time {
|
|
||||||
flex-wrap: wrap;
|
|
||||||
}
|
|
||||||
|
|
||||||
.article-translations,
|
|
||||||
.article-header-tags {
|
|
||||||
& > div {
|
|
||||||
flex-wrap: wrap;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.article-category,
|
.article-category,
|
||||||
.article-tags {
|
.article-tags {
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -173,10 +164,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.article-footer {
|
|
||||||
font-size: 1.4rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.article-preview {
|
.article-preview {
|
||||||
font-size: 1.4rem;
|
font-size: 1.4rem;
|
||||||
color: var(--card-text-color-tertiary);
|
color: var(--card-text-color-tertiary);
|
||||||
|
|||||||
@@ -45,41 +45,7 @@
|
|||||||
|
|
||||||
.article-footer {
|
.article-footer {
|
||||||
margin: var(--card-padding);
|
margin: var(--card-padding);
|
||||||
margin-top: 0;
|
gap: var(--spacing-2xl);
|
||||||
|
|
||||||
section:not(:first-child) {
|
|
||||||
margin-top: var(--card-padding);
|
|
||||||
}
|
|
||||||
|
|
||||||
section {
|
|
||||||
color: var(--card-text-color-tertiary);
|
|
||||||
text-transform: uppercase;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
font-size: 1.4rem;
|
|
||||||
gap: 15px;
|
|
||||||
|
|
||||||
svg {
|
|
||||||
width: 20px;
|
|
||||||
height: 20px;
|
|
||||||
stroke-width: 1.33;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.article-tags {
|
|
||||||
text-transform: unset;
|
|
||||||
}
|
|
||||||
|
|
||||||
.article-copyright,
|
|
||||||
.article-lastmod {
|
|
||||||
a {
|
|
||||||
color: var(--body-text-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
a.link {
|
|
||||||
box-shadow: unset;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ favicon = "img/avatar.png"
|
|||||||
[article]
|
[article]
|
||||||
[article.license]
|
[article.license]
|
||||||
enabled = true
|
enabled = true
|
||||||
default = "Licensed under CC BY-NC-SA 4.0"
|
default = "Licensed under [CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/)"
|
||||||
|
|
||||||
[widgets]
|
[widgets]
|
||||||
homepage = [
|
homepage = [
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
{{- $description = $description | default (T "list.page" (len .Pages)) -}}
|
{{- $description = $description | default (T "list.page" (len .Pages)) -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- if or $description (not .Date.IsZero) -}}
|
{{- if or $description (not .Date.IsZero) -}}
|
||||||
<footer class="article-footer">
|
<footer class="article-meta">
|
||||||
{{- if not .Date.IsZero -}}
|
{{- if not .Date.IsZero -}}
|
||||||
<time datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}">
|
<time datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}">
|
||||||
{{- .Date | time.Format .Site.Params.dateFormat.published -}}
|
{{- .Date | time.Format .Site.Params.dateFormat.published -}}
|
||||||
|
|||||||
@@ -30,48 +30,47 @@
|
|||||||
|
|
||||||
{{ $showReadingTime := $Page.Params.readingTime | default ($Page.Site.Params.article.readingTime) }}
|
{{ $showReadingTime := $Page.Params.readingTime | default ($Page.Site.Params.article.readingTime) }}
|
||||||
{{ $showDate := not $Page.Date.IsZero }}
|
{{ $showDate := not $Page.Date.IsZero }}
|
||||||
{{ $showFooter := or $showDate $showReadingTime }}
|
{{ $showTime := or $showDate $showReadingTime }}
|
||||||
{{ if $showFooter }}
|
{{ $showTranslations := $Page.IsTranslated }}
|
||||||
<footer class="article-footer">
|
{{ $showTags := and $Page.Site.Params.Article.List.ShowTags ($Page.GetTerms "tags") $IsList }}
|
||||||
|
|
||||||
|
{{ if or $showTime $showTranslations $showTags }}
|
||||||
|
<footer class="article-meta">
|
||||||
|
{{ if $showTime }}
|
||||||
|
<div class="inline-meta">
|
||||||
{{ if $showDate }}
|
{{ if $showDate }}
|
||||||
<div>
|
|
||||||
{{ partial "helper/icon" "date" }}
|
{{ partial "helper/icon" "date" }}
|
||||||
<time class="article-time--published" datetime='{{ $Page.Date.Format "2006-01-02T15:04:05Z07:00" }}'>
|
<time class="article-time--published" datetime='{{ $Page.Date.Format "2006-01-02T15:04:05Z07:00" }}'>
|
||||||
{{- $Page.Date | time.Format $Page.Site.Params.dateFormat.published -}}
|
{{- $Page.Date | time.Format $Page.Site.Params.dateFormat.published -}}
|
||||||
</time>
|
</time>
|
||||||
</div>
|
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ if $showReadingTime }}
|
{{ if $showReadingTime }}
|
||||||
<div>
|
|
||||||
{{ partial "helper/icon" "clock" }}
|
{{ partial "helper/icon" "clock" }}
|
||||||
<time class="article-time--reading">
|
<time class="article-time--reading">
|
||||||
{{ T "article.readingTime" $Page.ReadingTime }}
|
{{ T "article.readingTime" $Page.ReadingTime }}
|
||||||
</time>
|
</time>
|
||||||
|
{{ end }}
|
||||||
</div>
|
</div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</footer>
|
|
||||||
{{ end }}
|
|
||||||
|
|
||||||
{{ if $Page.IsTranslated }}
|
{{ if $showTranslations }}
|
||||||
<footer class="article-translations">
|
<div class="inline-meta">
|
||||||
{{ partial "helper/icon" "language" }}
|
{{ partial "helper/icon" "language" }}
|
||||||
<div>
|
|
||||||
{{ range $Page.Translations }}
|
{{ range $Page.Translations }}
|
||||||
<a href="{{ .RelPermalink }}" class="link">{{ .Language.LanguageName }}</a>
|
<a href="{{ .RelPermalink }}" class="link">{{ .Language.LanguageName }}</a>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ if and $Page.Site.Params.Article.List.ShowTags ($Page.GetTerms "tags") $IsList }}
|
{{ if $showTags }}
|
||||||
<footer class="article-header-tags">
|
<div class="article-tags inline-meta">
|
||||||
{{ partial "helper/icon" "tag" }}
|
{{ partial "helper/icon" "tag" }}
|
||||||
<div>
|
|
||||||
{{ range ($Page.GetTerms "tags") }}
|
{{ range ($Page.GetTerms "tags") }}
|
||||||
<a href="{{ .RelPermalink }}" class="link">{{ .LinkTitle }}</a>
|
<a href="{{ .RelPermalink }}" class="link">{{ .LinkTitle }}</a>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</div>
|
</div>
|
||||||
|
{{ end }}
|
||||||
</footer>
|
</footer>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
<footer class="article-footer">
|
<footer class="article-meta article-footer">
|
||||||
{{ partial "article/components/tags" . }}
|
{{ partial "article/components/tags" . }}
|
||||||
|
|
||||||
{{ if and (.Site.Params.article.license.enabled) (not (eq .Params.license false)) }}
|
{{ if and (.Site.Params.article.license.enabled) (not (eq .Params.license false)) }}
|
||||||
<section class="article-copyright">
|
<section class="article-copyright inline-meta">
|
||||||
{{ partial "helper/icon" "copyright" }}
|
{{ partial "helper/icon" "copyright" }}
|
||||||
<span>{{ default .Site.Params.article.license.default .Params.license | markdownify }}</span>
|
<span>{{ default .Site.Params.article.license.default .Params.license | markdownify }}</span>
|
||||||
</section>
|
</section>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{- if ne .Lastmod .Date -}}
|
{{- if ne .Lastmod .Date -}}
|
||||||
<section class="article-lastmod">
|
<section class="article-lastmod inline-meta">
|
||||||
{{ partial "helper/icon" "clock" }}
|
{{ partial "helper/icon" "clock" }}
|
||||||
<span>
|
<span>
|
||||||
{{ T "article.lastUpdatedOn" }} {{ .Lastmod | time.Format .Site.Params.dateFormat.lastUpdated }}
|
{{ T "article.lastUpdatedOn" }} {{ .Lastmod | time.Format .Site.Params.dateFormat.lastUpdated }}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<h2 class="article-title">
|
<h2 class="article-title">
|
||||||
{{- $link.title -}}
|
{{- $link.title -}}
|
||||||
</h2>
|
</h2>
|
||||||
<footer class="article-footer">
|
<footer class="article-meta">
|
||||||
{{ with $link.description }}
|
{{ with $link.description }}
|
||||||
{{ . }}
|
{{ . }}
|
||||||
{{ else }}
|
{{ else }}
|
||||||
|
|||||||
Reference in New Issue
Block a user