Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Less animate #530

Closed
wants to merge 14 commits into from
24 changes: 22 additions & 2 deletions assets/css/_page/_home.scss
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,31 @@
}

.single-title {
display: flex; /* Align elements horizontally */
align-items: center; /* Vertical alignment */
justify-content: space-between; /* Optional: spread the title and date apart */
gap: 10px; /* Space between title and date */
margin: 0.4rem 0;
font-size: 1.25rem;
line-height: 140%;
margin: 0.4rem 0;
}

.title-container {
flex: 1; /* Allow the title to take up available space */
}

.date-container {
white-space: nowrap;
font-size: 16px;
font-weight: 400;
color: $global-font-color;

[data-theme='dark'] & {
color: $global-font-color-dark;
}

}

.content {
display: block;
margin-top: 0.3rem;
Expand Down Expand Up @@ -170,7 +190,7 @@

.post-footer {
margin-top: 0.4rem;
display: flex;
display: none;
justify-content: space-between;
align-items: center;
font-size: 0.875rem;
Expand Down
4 changes: 2 additions & 2 deletions i18n/zh-TW.toml
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,11 @@ other = "分享到"
contents = "目錄"
pin = "置頂"
repost = "轉貼"
publishedOnDate = "發佈於 {{ .Date }}"
publishedOnDate = "{{ .Date }}"
views = "次閱讀"
comments = "條評論"
author = "作者"
updatedOnDate = "更新於 {{ .Date }}"
updatedOnDate = "{{ .Date }}"
readMarkdown = "閱讀原始文檔"
viewSource = "查看原始碼"
editThisPage = "編輯此頁"
Expand Down
2 changes: 1 addition & 1 deletion layouts/_default/home.archives.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<div class="page archive">
<div class="header">
{{- /* Title */ -}}
<h1 class="single-title animate__animated animate__pulse animate__faster">
<h1 class="single-title">
{{- dict "Class" "fa-solid fa-box-archive fa-fw me-1" | partial "plugin/icon.html" -}}
{{- .Params.Title | default (T "archives") }} <sup>{{ $pages.Len }}</sup>
</h1>
Expand Down
4 changes: 2 additions & 2 deletions layouts/_default/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
<article class="page single special">
<div class="header">
{{- /* Title */ -}}
<h1 class="single-title animate__animated animate__pulse animate__faster">{{- cond (.Param "capitalizeTitles") (title .Title) .Title -}}</h1>
<h1 class="single-title">{{- cond (.Param "capitalizeTitles") (title .Title) .Title -}}</h1>

{{- /* Subtitle */ -}}
{{- with $params.subtitle -}}<p class="single-subtitle animate__animated animate__fadeIn">{{ . | $.RenderString }}</p>{{- end -}}
{{- with $params.subtitle -}}<p class="single-subtitle">{{ . | $.RenderString }}</p>{{- end -}}
</div>

{{- /* Content */ -}}
Expand Down
30 changes: 29 additions & 1 deletion layouts/_default/summary.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
</div>
{{- end -}}

<!--
{{- /* Title */ -}}
<h2 class="single-title" itemprop="name headline">
{{- with $params.weight -}}
Expand Down Expand Up @@ -46,6 +47,33 @@ <h2 class="single-title" itemprop="name headline">

{{- partial "single/post-included-in.html" . -}}
</div>
-->

<h2 class="single-title" itemprop="name headline">
<div class="title-container">
{{- 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" -}}
{{- $title := cond (hasPrefix .Url "http") (printf "%v -> %v" (T "single.repost") .Url ) (T "single.repost") -}}
<span title="{{ $title }}" class="icon-repost">{{- $icon | partial "plugin/icon.html" -}}</span>
{{- end -}}
{{- end -}}
<a href="{{ .RelPermalink }}">{{ cond (.Param "capitalizeTitles") (title .Title) .Title }}</a>
</div>

<div class="date-container">
{{- with .PublishDate | dateFormat (.Site.Params.dateFormat | default "2006-01-02") -}}
<span class="post-publish" title='{{ "2006-01-02 15:04:05" | $.PublishDate.Format }}'>
{{- printf `<time datetime="%v">%v</time>` . . | dict "Date" | T "single.publishedOnDate" | safeHTML -}}
</span>
{{- end -}}
</div>
</h2>

{{- /* Summary content */ -}}
<div class="content">
Expand Down Expand Up @@ -76,4 +104,4 @@ <h2 class="single-title" itemprop="name headline">
{{- end -}}
</div>
</article>
{{- /* EOF */ -}}
{{- /* EOF */ -}}
4 changes: 2 additions & 2 deletions layouts/partials/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{{- $homeRelPermalink := .Scratch.Get "homeRelPermalink" -}}

{{- /* Desktop header */ -}}
<header class="desktop animate__faster" id="header-desktop">
<header class="desktop" id="header-desktop">
<div class="header-wrapper"{{ if .Site.Params.githubCorner.enable }} data-github-corner="{{ .Site.Params.githubCorner.position }}"{{ end }}>
<div class="header-title">
<a href="{{ $homeRelPermalink }}" title="{{ .Site.Title }}">
Expand Down Expand Up @@ -152,7 +152,7 @@
</header>

{{- /* Mobile header */ -}}
<header class="mobile animate__faster" id="header-mobile">
<header class="mobile" id="header-mobile">
<div class="header-container">
<div class="header-wrapper">
<div class="header-title">
Expand Down
18 changes: 0 additions & 18 deletions layouts/partials/single/post-author.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,5 @@
{{- .Store.Set "author" $author -}}

<span class="post-author">
{{- $content := $author.name | default "Anonymous" -}}
{{- $icon := dict "Class" "fa-solid fa-user-circle" -}}
{{- /* Deprecate $params.authorAvatar in favor of $params.showAvatar and dd front matter gravatar {bool} */ -}}
{{- if $author.avatar | and $params.authorAvatar -}}
{{- $content = printf "%v&nbsp;%v" (dict "Src" $author.avatar "Class" "avatar" "Alt" $content "Width" 20 "Height" 20 | partial "plugin/image.html") $content -}}
{{- $icon = "" -}}
{{- end -}}
{{- if $author.link -}}
{{- $options := dict "Class" "author" "Destination" $author.link "Title" (T "single.author") "Rel" "author" "Icon" $icon "Content" $content -}}
{{- partial "plugin/link.html" $options -}}
{{- else -}}
<span class="author">
{{- with $icon -}}
{{- . | partial "plugin/icon.html" }}
{{ end -}}
{{- $content | safeHTML -}}
</span>
{{- end -}}
</span>
{{- /* EOF */ -}}
11 changes: 6 additions & 5 deletions layouts/posts/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
{{- $tableOfContents := .Fragments.ToHTML ($toc.startlevel | int) ($toc.endlevel | int) ($toc.ordered | default false) -}}
{{- $showToc := $toc.enable | and (ne $tableOfContents `<nav id="TableOfContents"></nav>`) -}}

<aside class="aside-collection animate__animated animate__fadeIn animate__faster" aria-label="{{ T "collections" }}">
<aside class="aside-collection" aria-label="{{ T "collections" }}">
{{- /* Collection List */ -}}
{{- partial "single/collection-list.html" . -}}

Expand All @@ -24,7 +24,7 @@
<article class="page single"{{ with .Params.fromAdapters }} data-adapters="{{ . }}"{{ end }}>
<div class="header">
{{- /* Title */ -}}
<h1 class="single-title animate__animated animate__flipInX">
<h1 class="single-title">
{{- $repost := $params.repost | default dict -}}
{{- with $repost -}}
{{- if eq .Enable true -}}
Expand All @@ -41,9 +41,9 @@ <h1 class="single-title animate__animated animate__flipInX">
</h1>

{{- /* Subtitle */ -}}
{{- with $params.subtitle -}}<p class="single-subtitle animate__animated animate__fadeIn">{{ . | $.RenderString }}</p>{{- end -}}
{{- with $params.subtitle -}}<p class="single-subtitle">{{ . | $.RenderString }}</p>{{- end -}}
</div>

<!--
{{- /* Meta */ -}}
<div class="post-meta">
<div class="post-meta-line">
Expand Down Expand Up @@ -133,7 +133,8 @@ <h1 class="single-title animate__animated animate__flipInX">
{{- end -}}
{{- end -}}
</div>
</div>
</div>*/
-->

{{- /* Featured image */ -}}
{{- $image := $params.featuredimage -}}
Expand Down
2 changes: 1 addition & 1 deletion layouts/section/section.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<div class="page archive">
<div class="header">
{{- /* Title */ -}}
<h1 class="single-title animate__animated animate__pulse animate__faster">
<h1 class="single-title">
{{- $titleIcon := "fa-solid fa-feather" -}}
{{- with .Params.titleIcon -}}
{{- $titleIcon = . -}}
Expand Down
2 changes: 1 addition & 1 deletion layouts/taxonomy/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
{{- else -}}
{{- $termTitle = printf "%v - %v" (T $taxonomy | default $taxonomy) .Title -}}
{{- end -}}
<h1 class="single-title animate__animated animate__pulse animate__faster">
<h1 class="single-title">
{{- with $termIcon -}}
{{- dict "Class" (add . " fa-fw me-1") | partial "plugin/icon.html" -}}
{{- end -}}
Expand Down
2 changes: 1 addition & 1 deletion layouts/taxonomy/terms.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
{{- $termsIcon = "fa-solid fa-layer-group" -}}
{{- end -}}
{{- /* Title */ -}}
<h1 class="single-title animate__animated animate__pulse animate__faster">
<h1 class="single-title">
{{- with $termsIcon -}}
{{- dict "Class" (add . " fa-fw me-1") | partial "plugin/icon.html" -}}
{{- end -}}
Expand Down
Loading