Merge pull request #6 from Junyi-99/feature-theme-update

Feature theme update
This commit is contained in:
Junyi 2024-03-04 15:17:46 +08:00 committed by GitHub
commit de89f02ac7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 55 additions and 33 deletions

View File

@ -28,10 +28,7 @@
--post-info-color: grey; --post-info-color: grey;
--switcher-color: #333; --switcher-color: #fff;
--switcher-bg-color: #fff;
--switcher-border-color: #333333
--switcher-border-radius: 5px;
--svg-color: #ccc; --svg-color: #ccc;
--svg-state-color:#ff5858; --svg-state-color:#ff5858;

View File

@ -30,10 +30,7 @@
--post-info-color: grey; --post-info-color: grey;
--switcher-color: #fff; --switcher-color: #333;
--switcher-bg-color: #333;
--switcher-border-color: #eeeeee;
--switcher-border-radius: 5px;
--svg-color: #333; --svg-color: #333;
--svg-state-color: #a31d1d; --svg-state-color: #a31d1d;

View File

@ -79,6 +79,11 @@ h1 {
h2 { h2 {
font-size: 1.2em; font-size: 1.2em;
margin-top: 3em;
}
h2:first-of-type {
margin-top: 0;
} }
h3 { h3 {
@ -229,9 +234,16 @@ header h2 {
margin-top: 1em; margin-top: 1em;
} }
.header-top-left {
display: flex;
align-items: center;
justify-content: space-between;
}
.site-title { .site-title {
display: inline; display: inline;
white-space: nowrap; white-space: nowrap;
font-weight: 700;
} }
header nav:not(:empty){ header nav:not(:empty){
@ -252,7 +264,7 @@ header nav a {
/* Social icons */ /* Social icons */
.social-icons { .social-icons {
display: inline; display: inline;
margin: 1em 0 0 3em; margin: 1em 0 0 1em;
padding: 0; padding: 0;
list-style-type: none; list-style-type: none;
} }
@ -415,9 +427,8 @@ article header h1 a {
.post h4 a, .post h4 a,
.post h5 a, .post h5 a,
.post h6 a { .post h6 a {
opacity: 0; opacity: 1;
position: absolute; border-bottom: none;
left: -1.2rem;
} }
.post h1:hover a, .post h1:hover a,
@ -481,10 +492,22 @@ article header h1 a {
stroke: var(--svg-state-color); stroke: var(--svg-state-color);
} }
.post-list .post-info {
color: var(--post-info-color);
font-size: 0.75em;
margin-top: 1em;
margin-bottom: 1em;
display: block;
gap: 1em;
}
.post-info { .post-info {
color: var(--post-info-color); color: var(--post-info-color);
font-size: 0.75em; font-size: 0.75em;
margin-top: 1em; margin-top: 1em;
margin-bottom: 1em;
display: flex;
gap: 1em;
} }
.post-info a { .post-info a {
@ -629,6 +652,9 @@ code.has-jax {
.read-next-title { .read-next-title {
margin-bottom: 0; margin-bottom: 0;
margin-top: 3em;
padding-top: 1em;
border-top: 1px dashed var(--thead-bg-color);
} }
.read-next-posts { .read-next-posts {
@ -687,10 +713,11 @@ code.has-jax {
/* Footer */ /* Footer */
.common-footer { .common-footer {
border-top: thin solid var(--hr-color);
padding-top: 1.5em; padding-top: 1.5em;
margin-top: 3em; margin-top: 3em;
font-size: 16px; font-size: 12px;
margin-bottom: 1.5em;
color: var(--pagination-link-color);
} }
.common-footer-bottom { .common-footer-bottom {
@ -712,12 +739,9 @@ ul.language-select > li, ul.footer-menu > li {
.theme-switcher { .theme-switcher {
color: var(--switcher-color); color: var(--switcher-color);
background: var(--switcher-bg-color); /* padding: 0.5em 1em; */
padding: 0.5em 1em; margin: 1em 0 0 1.5em;
font-size: 16px; cursor: pointer;
border: 1px solid var(--switcher-border-color);
border-radius: var(--switcher-border-radius);
margin-bottom: 1em;
} }
.h-card { .h-card {

View File

@ -1,7 +1,8 @@
<h{{ .Level }} id="{{ .Anchor | safeURL }}" {{ if .Attributes.style }}style="{{ .Attributes.style | safeCSS }}"{{ end }}>{{ .Text | safeHTML }} <h{{ .Level }} id="{{ .Anchor | safeURL }}" {{ if .Attributes.style }}style="{{ .Attributes.style | safeCSS }}"{{ end }}>
<span> <div>
<a href="#{{ .Anchor }}"> <a href="#{{ .Anchor }}">
<svg viewBox="0 0 28 23" height="100%" width="19" xmlns="http://www.w3.org/2000/svg"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71" fill="none" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71" fill="none" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2"/></svg> {{ range seq 2 .Level}}#{{end}}
</a> </a>
</span> {{ .Text | safeHTML }}
</div>
</h{{ .Level }}> </h{{ .Level }}>

View File

@ -11,15 +11,15 @@
<div class="post-header"> <div class="post-header">
<header> <header>
<h1 class="p-name post-title{{ if .Params.favorite }} favorite{{end}}{{ if .Params.draft }} draft{{end}}">{{ trim .Title " " | markdownify }}</h1> <h1 class="p-name post-title{{ if .Params.favorite }} favorite{{end}}{{ if .Params.draft }} draft{{end}}">{{ trim .Title " " | markdownify }}</h1>
{{ partial "post-language-switcher.html" . }} {{ partial "post-language-switcher.html" . }}
</header> </header>
{{ partial "post-info.html" . }}
</div> </div>
{{ partial "toc.html" .}} {{ partial "toc.html" .}}
<div class="content e-content"> <div class="content e-content">
{{ .Content }} {{ .Content }}
</div> </div>
{{ partial "post-info.html" . }}
</article> </article>
{{ if gt .Site.Params.readNextPosts 0 }} {{ if gt .Site.Params.readNextPosts 0 }}

View File

@ -13,11 +13,13 @@
{{ end }} {{ end }}
</ul> </ul>
{{ end }} {{ end }}
<div class="copyright">
<p>© {{ if isset .Site.Params "author"}}{{ .Site.Params.author }}, {{end}}{{ now.Year }}<br> <div>
© {{ if isset .Site.Params "author"}}{{ .Site.Params.author }}, {{end}}{{ now.Year }}
</div>
<div>
{{ i18n "powered" }} <a target="_blank" rel="noopener noreferrer" href="https://gohugo.io/">Hugo</a>, {{ i18n "theme" }} <a target="_blank" rel="noopener noreferrer" href="https://github.com/Junyi-99/hugo-theme-anubis2">Anubis2</a>.<br> {{ i18n "powered" }} <a target="_blank" rel="noopener noreferrer" href="https://gohugo.io/">Hugo</a>, {{ i18n "theme" }} <a target="_blank" rel="noopener noreferrer" href="https://github.com/Junyi-99/hugo-theme-anubis2">Anubis2</a>.<br>
{{ partial "footer-extra.html" . }} {{ partial "footer-extra.html" . }}
</p>
</div> </div>
</div> </div>

View File

@ -1,10 +1,11 @@
<div class="header-top"> <div class="header-top">
<div class="header-top-left"> <div class="header-top-left">
{{ partial "site-title.html" . }} {{ partial "site-title.html" . }}
{{ partial "theme-switcher.html" . }}
{{ partial "social.html" . }} {{ partial "social.html" . }}
</div> </div>
<div class="header-top-right"> <div class="header-top-right">
{{ partial "theme-switcher.html" . }}
</div> </div>
</div> </div>

View File

@ -7,9 +7,9 @@
<div class="post-info noselect"> <div class="post-info noselect">
{{ if .Params.date }} {{ if .Params.date }}
<div class="post-date dt-published"> <div class="post-date dt-published">
<a class="u-url" href="{{ .RelPermalink }}"><time datetime="{{ .Params.date.Format $machineDateFormat }}"> <time datetime="{{ .Params.date.Format $machineDateFormat }}">
{{- .Params.date.Format $dateFormat -}} {{- .Params.date.Format $dateFormat -}}
</time></a> </time>
{{ if ne .Params.date .Params.lastMod -}} {{ if ne .Params.date .Params.lastMod -}}
[{{ i18n "lastMod" }} <time datetime="{{ .Params.lastMod.Format $machineDateFormat }}"> [{{ i18n "lastMod" }} <time datetime="{{ .Params.lastMod.Format $machineDateFormat }}">
{{- .Params.lastMod.Format $dateFormat -}} {{- .Params.lastMod.Format $dateFormat -}}