Browse Source

Update figure style & fix gallery post navigation

Track3 1 year ago
parent
commit
60416a2731
2 changed files with 8 additions and 5 deletions
  1. 5 2
      assets/scss/style.scss
  2. 3 3
      layouts/gallery/single.html

+ 5 - 2
assets/scss/style.scss

@@ -322,13 +322,15 @@ textarea {
   figure.left {
     float: left;
     margin-right: 1em;
-    max-width: 50%;
+    max-width: 40%;
+    text-align: left;
   }
 
   figure.right {
     float: right;
     margin-left: 1em;
-    max-width: 50%;
+    max-width: 40%;
+    text-align: right;
   }
 
   img {
@@ -341,6 +343,7 @@ textarea {
   video,
   iframe {
     max-width: 100%;
+    height: auto;
   }
 }
 

+ 3 - 3
layouts/gallery/single.html

@@ -23,11 +23,11 @@
 			{{- with .Params.tags }}
 			<li>标&emsp;签:{{- range . -}}<a href="{{ "tags/" | relURL }}{{ . | urlize }}" class="post-tag">{{.}}</a>{{ end }}</li>
 			{{- end }}
-			<li></li>
-			{{- with .PrevInSection }}
+			{{- $list := (where site.RegularPages "Type" "in" "gallery") }}
+			{{- with ($list.ByParam "shot_date").Reverse.Prev . }}
 			<li>上一篇:<a href="{{ .RelPermalink }}">{{ .Title }}</a></li>
 			{{- end }}
-			{{- with .NextInSection }}
+			{{- with ($list.ByParam "shot_date").Reverse.Next . }}
 			<li>下一篇:<a href="{{ .RelPermalink }}">{{ .Title }}</a></li>
 			{{- end }}
 		</ul>