浏览代码

Tweak home/single/list page design

Track3 6 年之前
父节点
当前提交
5b8150f277
共有 5 个文件被更改,包括 27 次插入26 次删除
  1. 14 18
      assets/scss/style.scss
  2. 2 3
      config.toml
  3. 9 3
      layouts/_default/list.html
  4. 1 1
      layouts/index.html
  5. 1 1
      layouts/posts/single.html

+ 14 - 18
assets/scss/style.scss

@@ -282,24 +282,19 @@ table {
   }
 }
 
-#me {
-  font-size: 2em;
+#home-title {
+  margin: 0;
 }
 
 #home-social {
-  margin-top: .2em;
   font-size: 1.4em;
 }
 
-#home-nav {
-  margin-top: .5em;
-
-  a {
+#home-nav a{
     display: block;
     border: none;
     text-align: center;
     margin-top: .5em;
-  }
 }
 
 // list.html
@@ -322,10 +317,7 @@ table {
   }
 
   .post-item {
-    display: flex;
-    justify-content: space-between;
-    align-items: baseline;
-    margin-bottom: 8px;
+    margin-bottom: 10px;
     padding: 2px 4px;
     border-radius: 3px;
     transition-property: background-color;
@@ -333,6 +325,9 @@ table {
     transition-timing-function: ease-out;
 
     a {
+      display: flex;
+      justify-content: space-between;
+      align-items: baseline;
       border: none;
     }
 
@@ -375,19 +370,16 @@ table {
 
 .post-header {
   margin-top: 1.2em;
-  margin-bottom: 1.5em;
-  border-bottom: 2px solid;
   line-height: normal;
 
   .post-meta {
-    margin: 0;
+    font-size: .9em;
     letter-spacing: normal;
     @include dimmed;
   }
 
   h1 {
-    margin-top: 0;
-    margin-bottom: .3em;
+    margin-top: .1em;
   }
 }
 
@@ -457,6 +449,10 @@ figure.right {
     &::before {
       content: "#"
     }
+
+    a {
+      border: none;
+    }
   }
 }
 
@@ -579,7 +575,7 @@ figure.right {
     .post-year {
       margin-right: 0;
       margin-bottom: 8px;
-      border-bottom: 1px dashed;
+      border-bottom: 2px dashed;
     }
   }
   #spotlight.error-404 {

+ 2 - 3
config.toml

@@ -22,10 +22,9 @@ rssLimit = 10
 
 [params]
   author         = "Track3"
-  dateform       = "Jan 02, 2006"
+  dateform       = "Jan 2, 2006"
   dateformFull   = "2006-01-02 15:04"
-  dateformList   = "Jan 2"
-  dateformSingle = "Mon, Jan 2"
+  dateformShort   = "Jan 2"
 
 [menu]
 

+ 9 - 3
layouts/_default/list.html

@@ -15,9 +15,15 @@
 			<p class="post-year">{{ .Key }}</p>
 			<ul class="posts-list">
 				{{- range .Pages }}
-				<li class="post-item"><a href="{{.Permalink}}" class="post-title">{{.Title}}</a><span class="post-day">{{ .Date.Format .Site.Params.dateformList }}</span></li>
-				{{- end }}
-			</ul>
+				<li class="post-item">
+					<a href="{{.Permalink}}">
+						<span class="post-title">{{.Title}}</span>
+						<span class="post-day">{{ .Date.Format .Site.Params.dateformShort }}</span>
+					</a>
+				</a>
+			</li>
+			{{- end }}
+		</ul>
 		</div>
 		{{- end }}
 	</main>

+ 1 - 1
layouts/index.html

@@ -1,6 +1,6 @@
 {{ define "main" }}
 	<div id="spotlight">
-		<div id="me" class="animated bounceIn">Track3's Blog</div>
+		<h1 id="home-title" class="animated bounceIn">Track3's Blog</h1>
 		<div id="home-social" class="social-icons animated bounceIn">
 			<a href="https://twitter.com/mytrack03" target="_blank"><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-twitter"><path d="M23 3a10.9 10.9 0 0 1-3.14 1.53 4.48 4.48 0 0 0-7.86 3v1A10.66 10.66 0 0 1 3 4s-4 9 5 13a11.64 11.64 0 0 1-7 2c9 5 20 0 20-11.5a4.5 4.5 0 0 0-.08-.83A7.72 7.72 0 0 0 23 3z"></path></svg></a>
 			<a href="http://t.me/mytrack3" target="_blank"><svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" aria-hidden="true" class="feather"><path d="m 22.05,1.577 c -0.393,-0.016 -0.784,0.08 -1.117,0.235 -0.484,0.186 -4.92,1.902 -9.41,3.64 C 9.263,6.325 7.005,7.198 5.267,7.867 3.53,8.537 2.222,9.035 2.153,9.059 c -0.46,0.16 -1.082,0.362 -1.61,0.984 -0.79581202,1.058365 0.21077405,1.964825 1.004,2.499 1.76,0.564 3.58,1.102 5.087,1.608 0.556,1.96 1.09,3.927 1.618,5.89 0.174,0.394 0.553,0.54 0.944,0.544 l -0.002,0.02 c 0,0 0.307,0.03 0.606,-0.042 0.3,-0.07 0.677,-0.244 1.02,-0.565 0.377,-0.354 1.4,-1.36 1.98,-1.928 l 4.37,3.226 0.035,0.02 c 0,0 0.484,0.34 1.192,0.388 0.354,0.024 0.82,-0.044 1.22,-0.337 0.403,-0.294 0.67,-0.767 0.795,-1.307 0.374,-1.63 2.853,-13.427 3.276,-15.38 L 23.676,4.725 C 23.972,3.625 23.863,2.617 23.18,2.02 22.838,1.723 22.444,1.593 22.05,1.576 Z"></path></svg></a>

+ 1 - 1
layouts/posts/single.html

@@ -9,7 +9,7 @@
 	<main class="site-main section-inner animated bounceInUp">
 		<article class="thin">
 			<header class="post-header">
-				<p class="post-meta">{{ .Date.Format .Site.Params.dateformSingle }} &#183; {{ .ReadingTime }} min read</p>
+				<div class="post-meta"><span>{{ .Date.Format .Site.Params.dateform }}</span></div>
 				<h1>{{ .Title }}</h1>
 			</header>
 			<div class="content">