Browse Source

Adjust gallery page style

Track3 2 years ago
parent
commit
ecd245adea

+ 4 - 1
archetypes/gallery.md

@@ -3,8 +3,11 @@ title: "{{ replace .Name "-" " " | title }}"
 date: {{ .Date }}
 lastmod: {{ .Date }}
 location:
-shot_on:
+shot_date:
+shot_with:
 description:
 draft: true
 images:
 ---
+
+{{< photo src="" alt="" caption="" >}}

+ 10 - 10
assets/scss/partials/_list.scss

@@ -38,8 +38,8 @@
 // Gallery Page
 //
 .album {
-  margin-top: 1em;
-  margin-bottom: 2.5em;
+  margin-top: 2.5em;
+  margin-bottom: 1em;
 }
 
 .album-title {
@@ -60,17 +60,17 @@
 .album-row {
   display: flex;
   flex-wrap: wrap;
-  gap: 1em;
-  border: none;
-  &::after {
-    content: '';
-    display: block;
-    flex-grow: 10;
-  }
+  gap: .5em;
+  border: none!important;
+  // &::after {
+  //   content: '';
+  //   display: block;
+  //   flex-grow: 10;
+  // }
 }
 .img-tile {
   height: 100px;
-  flex: 1;
+  // flex: 1;
   & > img {
     max-height: 100%;
     min-width: 100%;

+ 1 - 1
assets/scss/partials/_single.scss

@@ -270,7 +270,7 @@ hr.post-end {
       font-size: 1rem;
     }
     > .feather {
-      margin-right: 1em;
+      margin-right: .5em;
     }
   }
 }

+ 2 - 2
layouts/gallery/list.html

@@ -13,13 +13,13 @@
 			{{ .Content }}
 		</div>
 		{{- end }}
-		{{- range .Pages }}
+		{{- range (.Pages.ByParam "shot_date").Reverse}}
 		<div class="album">
 			<h2 class="album-title">
 				{{ $abulmLink := .Permalink -}}
 				<a href="{{ $abulmLink }}">{{.Title}}</a>
 			</h2>
-			<p class="album-date">{{ .Date.Format .Site.Params.dateform }}</p>
+			<p class="album-date">{{ time.Format .Site.Params.dateform .Params.shot_date }}</p>
 			<a href="{{ $abulmLink }}" class="album-row">
 				{{- range .Params.images -}}
 				<div class="img-tile"><img src="{{. | absURL}}" loading="lazy"></div>

+ 1 - 1
layouts/gallery/single.html

@@ -17,7 +17,7 @@
 				{{ with .Params.location -}}
 				<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-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><b>{{ . }}</b></p>
 				{{ end -}}
-				<p>on {{ dateFormat .Site.Params.dateform .Date }}</p>
+				<p>on {{time.Format .Site.Params.dateform .Params.shot_date}}</p>
 				{{ with .Params.shot_with -}}
 				<p>with {{ . }}</p>
 				{{ end -}}

+ 1 - 2
layouts/index.html

@@ -21,8 +21,7 @@
 		<div id="recent-posts">
 			<div>Recent Posts</div>
 			<ul class="recent-posts-list">
-				{{ $articleList := (sort ( where site.RegularPages "Type" "in" "writing" ) "Date" "desc") -}}
-				{{ range first 3 $articleList -}}
+				{{ range first 3 (where site.RegularPages "Type" "in" "writing") -}}
 				<li>
 					<span>{{ .Date.Format .Site.Params.dateformNum }} </span>
 					<a href="{{.Permalink}}">{{.Title}}</a>