Explorar o código

Change fonts and typography

Track3 %!s(int64=3) %!d(string=hai) anos
pai
achega
734d2cf98c

+ 3 - 2
assets/scss/_predefined.scss

@@ -4,8 +4,9 @@ $accent: #54bab9;
 
 // Fonts
 //
-$fonts: -apple-system, BlinkMacSystemFont, PingFang SC, Hiragino Sans GB, Microsoft Yahei, Arial,sans-serif;
-$mono-fonts: Consolas, Menlo, Monaco, "Lucida Console", "Lucida Sans Typewriter", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Liberation Mono", "Nimbus Mono L", "Courier New", "YaHei Consolas Hybrid", monospace, "Segoe UI Emoji", "PingFang SC", "Microsoft YaHei";
+$fonts: "Trebuchet MS", Tahoma, Verdana, -apple-system, BlinkMacSystemFont, PingFang SC, Hiragino Sans GB, Microsoft Yahei, sans-serif;
+$serif-fonts: Palatino, Optima, Georgia, "Source Han Serif SC VF", "Source Han Serif CN VF", "Source Han Serif SC", "Source Han Serif CN", "Noto Serif CJK SC", source-han-serif-sc, serif;
+$mono-fonts: "Cascadia Code", Consolas, Menlo, Monaco, "Lucida Console", "Lucida Sans Typewriter", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Liberation Mono", "Nimbus Mono L", "Courier New", "YaHei Consolas Hybrid", monospace, "Segoe UI Emoji", "PingFang SC", "Microsoft YaHei";
 
 // Mixins
 //

+ 0 - 1
assets/scss/partials/_header.scss

@@ -20,7 +20,6 @@
     &::before {
       content: "~/";
       color: var(--c-txt-alt);
-      margin-right: .1em;
     }
   }
 }

+ 3 - 0
assets/scss/partials/_single.scss

@@ -48,6 +48,7 @@
 }
 
 .content {
+  margin-top: 1.5rem;
   text-justify: inter-ideograph; //For IE/Edge
   overflow-wrap: break-word;
 
@@ -55,6 +56,8 @@
 
   h1, h2, h3, h4, h5, h6 {
     font-weight: bold;
+    margin-top: 1.5rem;
+    margin-bottom: 1rem;
   }
   figure {
     height: auto;

+ 8 - 6
assets/scss/style.scss

@@ -38,7 +38,7 @@ textarea {
   background-color: var(--c-bg);
   line-height: 1.6em;
   font-family: $fonts;
-  letter-spacing: 1px;
+  letter-spacing: .05rem;
   transition: background-color .5s, color .5s;
 }
 
@@ -73,13 +73,15 @@ code {
 blockquote {
   margin: 1.5em 1em;
   font-style: italic;
+  font-family: $serif-fonts;
+  letter-spacing: normal;
   color: var(--c-txt-alt);
   &::before {
-    content: "“ ";
+    content: "“";
     position: absolute;
     opacity: 0.3;
     font-size: 80px;
-    transform: translate(-64px,5px);
+    transform: translate(-20px,5px);
   }
 
   p {
@@ -340,12 +342,12 @@ h1#page-title {
   }
   .content > figure {
     text-align: left;
+    &>img {
+      margin-left: 0;
+    }
     &.big {
       width: calc(var(--vw) * 100 - var(--offset) - 1em);
       margin-left: 0;
-      &>img {
-        margin-left: 0;
-      }
     }
     &.right  {
       margin-right: -280px;

+ 0 - 27
layouts/posts/rss.xml

@@ -1,27 +0,0 @@
-<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
-	<channel>
-		<title>{{ if eq  .Title  .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }}</title>
-		<link>{{ .Permalink }}</link>
-		<description>Recent {{ with .Title }}{{. | humanize}}{{ end }} on {{ .Site.Title }}</description>
-		<generator>Hugo -- gohugo.io</generator>{{ with .Site.LanguageCode }}
-		<language>{{.}}</language>{{end}}{{ with .Site.Author.email }}
-		<managingEditor>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</managingEditor>{{end}}{{ with .Site.Author.email }}
-		<webMaster>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</webMaster>{{end}}{{ with .Site.Copyright }}
-		<copyright>{{.}}</copyright>{{end}}{{ if not .Date.IsZero }}
-		<lastBuildDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end }}
-		{{ with .OutputFormats.Get "RSS" -}}
-				{{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }}
-		{{ end -}}
-		{{ range .Pages }}
-		<item>
-			<title>{{ .Title }}</title>
-			<link>{{ .Permalink }}</link>
-			<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
-			{{ with .Site.Author.email }}<author>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</author>{{end}}
-			<guid>{{ .Permalink }}</guid>
-			<description>{{ .Summary | html }}</description>
-			<content type="html">{{ printf `<![CDATA[%s]]>` .Content | safeHTML }}</content>
-		</item>
-		{{ end }}
-	</channel>
-</rss>

+ 0 - 72
layouts/posts/single.html

@@ -1,72 +0,0 @@
-{{ define "head" }}
-	{{ if .Params.images -}}
-		{{- range first 1 .Params.images -}}
-		<style>:root{ --bg-img: url({{. | absURL}});}</style>
-		{{- end -}}
-	{{- end -}}
-{{ end }}
-
-{{ define "header" }}
-{{ partialCached "header.html" . }}
-{{ end }}
-
-{{ define "main" }}
-	<main id="site-main" class="wrapper">
-		<article>
-			<header class="post-header">
-				<div class="title-area">
-					<a id="home-btn" title="{{.Site.Title}}" href="{{.Site.BaseURL}}"><img src="/apple-touch-icon.png" width="180" height="180" alt="Logo"></a>
-					<div class="title-area-l">
-						<div id="post-header-date">{{ .Date.Format .Site.Params.dateform }}</div>
-						<h1 id="page-title">{{ .Title }}</h1>
-					</div>
-				</div>
-				{{- if .Params.toc }}
-				<button id="toc-btn" title="目录"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-list"><line x1="8" y1="6" x2="21" y2="6"></line><line x1="8" y1="12" x2="21" y2="12"></line><line x1="8" y1="18" x2="21" y2="18"></line><line x1="3" y1="6" x2="3" y2="6"></line><line x1="3" y1="12" x2="3" y2="12"></line><line x1="3" y1="18" x2="3" y2="18"></line></svg> 目录</button>
-				{{- end }}
-			</header>
-			{{- if .Params.toc }}
-			<div id="toc">
-				<p class="toc-title">目录</p>
-				{{ .TableOfContents }}
-			</div>
-			{{- end }}
-			<div class="content">
-				{{ .Content }}
-			</div>
-			<hr class="post-end">
-			<footer class="post-info">
-				{{- with .Params.tags }}
-				<p>
-					<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-tag meta-icon"><path d="M20.59 13.41l-7.17 7.17a2 2 0 0 1-2.83 0L2 12V2h10l8.59 8.59a2 2 0 0 1 0 2.82z"></path><line x1="7" y1="7" x2="7" y2="7"></line></svg>
-					{{- range . -}}
-					<span class="tag"><a href="{{ "tags/" | absURL }}{{ . | urlize }}">{{.}}</a></span>
-					{{- end }}
-				</p>
-				{{- end }}
-				<p><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-file-text"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path><polyline points="14 2 14 8 20 8"></polyline><line x1="16" y1="13" x2="8" y2="13"></line><line x1="16" y1="17" x2="8" y2="17"></line><polyline points="10 9 9 9 8 9"></polyline></svg>{{ .WordCount }} Words</p>
-				<p><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-calendar"><rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect><line x1="16" y1="2" x2="16" y2="6"></line><line x1="8" y1="2" x2="8" y2="6"></line><line x1="3" y1="10" x2="21" y2="10"></line></svg>{{ dateFormat .Site.Params.dateformNumTime .Date.Local }}</p>
-				{{- if .GitInfo }}
-				<p><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-git-commit"><circle cx="12" cy="12" r="4"></circle><line x1="1.05" y1="12" x2="7" y2="12"></line><line x1="17.01" y1="12" x2="22.96" y2="12"></line></svg><a href="{{ .Site.Params.gitUrl -}}{{ .GitInfo.Hash }}" target="_blank" rel="noopener">{{ .GitInfo.AbbreviatedHash }}</a> @ {{ dateFormat .Site.Params.dateformNum .GitInfo.AuthorDate.Local }}</p>
-				{{- end }}
-			</footer>
-		</article>
-		<div class="post-nav">
-			{{- with .NextInSection }}
-			<a class="next-post" href="{{ .Permalink }}">
-				<span class="post-nav-label"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-arrow-left"><line x1="19" y1="12" x2="5" y2="12"></line><polyline points="12 19 5 12 12 5"></polyline></svg>&nbsp;Newer</span><br><span>{{ .Title }}</span>
-			</a>
-			{{- end }}
-			{{- with .PrevInSection }}
-			<a class="prev-post" href="{{ .Permalink }}">
-				<span class="post-nav-label">Older&nbsp;<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-arrow-right"><line x1="5" y1="12" x2="19" y2="12"></line><polyline points="12 5 19 12 12 19"></polyline></svg></span><br><span>{{ .Title }}</span>
-			</a>
-			{{- end }}
-		</div>
-		{{ partialCached "comments.html" . }}
-	</main>
-{{ end }}
-
-{{ define "footer" }}
-{{ partialCached "footer.html" . }}
-{{ end }}

+ 15 - 11
layouts/shortcodes/photo.html

@@ -1,6 +1,6 @@
 {{ $src := .Get "src"}}
 {{ $image := (.Page.Resources.ByType "image").GetMatch (printf "**%s**" $src) -}}
-<figure>
+<figure class="big">
 	<img src="{{$src}}" loading="lazy"
 			 {{- if or (.Get "alt") (.Get "caption") }}
 			 alt="{{ with .Get "alt" }}{{ . }}{{ else }}{{ .Get "caption" | markdownify| plainify }}{{ end }}"
@@ -12,15 +12,19 @@
 		{{ with (.Get "title") -}}
 		<h4>{{ . }}</h4>
 		{{ end -}}
-		{{- .Get "caption" | markdownify -}}
-		{{ with $image.Exif -}}
-		<div class="image_meta">
-			{{ with .Tags.Model }}{{.}} {{ end -}}
-			{{ with .Tags.FocalLength }}@ {{.}}mm {{ end -}}
-			{{ with .Tags.FNumber }}&mdash; &fnof;/{{.}}{{ end -}}
-			{{ with .Tags.ExposureTime }}, {{ lang.FormatNumber 2 . }} sec{{ end -}}
-			{{ with .Tags.ISOSpeedRatings }}, ISO {{.}} {{ end }}
-		</div>
-		{{ end -}}
+		{{- if or (.Get "caption") $image.Exif -}}
+		<p>
+			{{- .Get "caption" | markdownify -}}
+			{{ end -}}
+			{{ with $image.Exif -}}
+			<span class="image_meta">
+				{{ with .Tags.Model }}{{.}} {{ end -}}
+				{{ with .Tags.FocalLength }}@ {{.}}mm {{ end -}}
+				{{ with .Tags.FNumber }}&mdash; &fnof;/{{.}}{{ end -}}
+				{{ with .Tags.ExposureTime }}, {{ lang.FormatNumber 2 . }} sec{{ end -}}
+				{{ with .Tags.ISOSpeedRatings }}, ISO {{.}} {{ end }}
+			</span>
+			{{ end -}}
+		</p>
 	</figcaption>
 </figure>