Browse Source

Add header & adjust heading margin

Track3 1 year ago
parent
commit
3fa13c487c

+ 14 - 8
assets/scss/style.scss

@@ -25,13 +25,13 @@ body {
   letter-spacing: .04rem;
 
   >main {
-    margin-bottom: 5rem;
+    margin-bottom: 4rem;
   }
 
   >section,
   >nav,
   >footer {
-    margin-block: 5rem;
+    margin-block: 4rem;
   }
 }
 
@@ -75,8 +75,8 @@ textarea {
 }
 
 h1 {
-  margin-top: .5rem;
-  margin-bottom: 2rem;
+  margin-top: 4rem;
+  margin-bottom: 2.5rem;
   line-height: 1.25;
   font-size: 1.75em;
 }
@@ -165,8 +165,12 @@ a {
   }
 
   &.home {
+    position: absolute;
+    line-height: 1;
+    font-size: 75%;
+    font-style: italic;
     text-decoration: none;
-    color: var(--c-txt);
+    color: var(--c-txt-alt);
   }
 }
 
@@ -351,7 +355,8 @@ textarea {
 }
 
 .post-info {
-  margin-top: -1.75rem;
+  margin-top: -2.25rem;
+  margin-bottom: 1.5rem;
   line-height: normal;
   font-size: 90%;
   font-style: italic;
@@ -444,13 +449,14 @@ a.footnote-ref {
 
 @media all and (min-width: 992px) {
   h1 {
-    margin-top: 3rem;
+    margin-top: 5rem;
+    font-size: 2em;
   }
 }
 
 @media all and (min-width: 1300px) {
   h1 {
-    margin-top: 7rem;
+    margin-top: 8rem;
   }
 
   figure.big {

+ 1 - 1
layouts/404.html

@@ -1,6 +1,6 @@
 {{ define "main" }}
 	<main class="wrapper">
-		<h1><a href="/" class="home">{{.Title}}</a></h1>
+		<h1>{{.Title}}</h1>
 		<p>服务器找不到请求的页面,可能原因有:</p>
 		<ul class="lsc">
 			<li>您可能输入了错误的网址;</li>

+ 5 - 0
layouts/_default/baseof.html

@@ -35,6 +35,11 @@
 </head>
 
 <body>
+	{{ if not .IsHome -}}
+	<header>
+		<a title="主页" href="{{"" | relURL}}" class="home">← {{.Site.Title}}</a>
+	</header>
+	{{- end -}}
 	{{ block "main" . }}
 	{{ end }}
 	<nav class="wrapper">

+ 1 - 1
layouts/_default/list.html

@@ -1,6 +1,6 @@
 {{ define "main" }}
 	<main class="wrapper">
-		<h1><a href="/" class="home">{{.Title}}</a></h1>
+		<h1>{{.Title}}</h1>
 		{{ if .Content -}}
 		<div class="content">
 			{{ .Content }}

+ 1 - 1
layouts/_default/single.html

@@ -1,6 +1,6 @@
 {{ define "main" }}
 	<main class="wrapper">
-		<h1><a href="/" class="home">{{.Title}}</a></h1>
+		<h1>{{.Title}}</h1>
 		{{ if .Content -}}
 		<div class="content">
 			{{ .Content }}

+ 1 - 1
layouts/gallery/list.html

@@ -1,6 +1,6 @@
 {{ define "main" }}
 	<main class="wrapper">
-		<h1><a href="/" class="home">{{.Title}}</a></h1>
+		<h1>{{.Title}}</h1>
 		{{ if .Content -}}
 		<div class="content">
 			{{ .Content }}

+ 1 - 1
layouts/gallery/single.html

@@ -1,6 +1,6 @@
 {{ define "main" }}
 	<main class="wrapper">
-		<h1><a href="/" class="home">{{.Title}}</a></h1>
+		<h1>{{.Title}}</h1>
 		<ul class="lsn dim album-header">
 			{{ with .Params.location -}}
 			<li><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-map-pin"><path d="M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"></path><circle cx="12" cy="10" r="3"></circle></svg>{{ . }}</li>

+ 1 - 1
layouts/writing/single.html

@@ -1,6 +1,6 @@
 {{ define "main" }}
 	<main class="wrapper">
-		<h1><a href="/" class="home">{{.Title}}</a></h1>
+		<h1>{{.Title}}</h1>
 		<div class="dim post-info">
 			{{ dateFormat ":date_long" .Date.Local }}
 		</div>