浏览代码

Tweak design & fix git repo link

Track3 6 年之前
父节点
当前提交
4a60cbf1bd
共有 4 个文件被更改,包括 21 次插入22 次删除
  1. 17 20
      assets/scss/style.scss
  2. 2 0
      config.toml
  3. 1 1
      layouts/_default/list.html
  4. 1 1
      layouts/posts/single.html

+ 17 - 20
assets/scss/style.scss

@@ -349,22 +349,28 @@ p.img-404 {
 #home-social {
   font-size: 1.4em;
   text-align: center;
+  opacity: .8;
 
   a {
     margin: 0 .2em;
   }
 }
 
-#home-nav a {
-  display: block;
-  text-align: center;
-  margin-top: .5em;
+#home-nav {
+  opacity: .8;
+
+  a {
+    display: block;
+    text-align: center;
+    margin-top: .5em;
+  }
 }
 
 #home-footer {
   text-align: center;
   font-size: .6em;
   line-height: normal;
+  @include dimmed;
 
   p {
     margin-top: 0;
@@ -375,38 +381,32 @@ p.img-404 {
 //
 .posts-group {
   display: flex;
+  margin-bottom: 1.9em;
+  line-height: normal;
 
   .post-year {
+    padding-top: 6px;
+    margin-right: 1.8em;
     font-size: 1.6em;
-    margin: 0.4em 2em 1em 0;
     @include dimmed;
   }
 
   .posts-list {
     flex-grow: 1;
-    margin: 16px 0;
+    margin: 0;
     padding: 0;
     list-style: none;
 
   }
 
   .post-item {
-    margin-bottom: 10px;
-    padding: 2px 4px;
-    border-radius: 3px;
     border-bottom: 1px $highlight-grey dashed;
-    transition-property: background-color;
-    transition-duration: .5s;
-    transition-timing-function: ease-out;
 
     a {
       display: flex;
       justify-content: space-between;
       align-items: baseline;
-    }
-
-    &:hover {
-      background-color: $highlight-grey;
+      padding: 12px 0;
     }
   }
 
@@ -699,12 +699,9 @@ a.footnote-return {
 
   .posts-group {
     display: block;
-    margin-bottom: 2.5em;
 
     .post-year {
-      margin-right: 0;
-      margin-bottom: 8px;
-      border-bottom: 2px dashed;
+      margin: -6px 0 4px;
     }
   }
 

+ 2 - 0
config.toml

@@ -25,6 +25,8 @@ copyright = "This work is licensed under a Creative Commons Attribution-NonComme
   dateformNum     = "2006-01-02"
   dateformNumTime = "2006-01-02 15:04"
 
+  gitUrl = "https://github.com/Track3/blog/commit/"
+
   [[params.social]]
     name = "twitter"
     url = "https://twitter.com/ThatTrack3"

+ 1 - 1
layouts/_default/list.html

@@ -12,7 +12,7 @@
 		{{- end }}
 		{{- range .Data.Pages.GroupByDate "2006" }}
 		<div class="posts-group">
-			<p class="post-year">{{ .Key }}</p>
+			<div class="post-year">{{ .Key }}</div>
 			<ul class="posts-list">
 				{{- range .Pages }}
 				<li class="post-item">

+ 1 - 1
layouts/posts/single.html

@@ -28,7 +28,7 @@
 				<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="https://github.com/Track3/my-hugo-blog/commit/{{ .GitInfo.Hash }}" target="_blank" rel="noopener">{{ .GitInfo.AbbreviatedHash }}</a> @ {{ dateFormat .Site.Params.dateformNum .GitInfo.AuthorDate.Local }}</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-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>