Browse Source

Consolidate list template

I was able to mek the list template reusable enough that I don't need
separate ones for the blog and the projects. Consolidated them both to
use _defaults' list template.
Apis Necros 2 năm trước cách đây
mục cha
commit
eb4a3c759f
3 tập tin đã thay đổi với 4 bổ sung37 xóa
  1. 4 2
      layouts/_default/list.html
  2. 0 17
      layouts/blog/list.html
  3. 0 18
      layouts/projects/list.html

+ 4 - 2
layouts/_default/list.html

@@ -1,8 +1,10 @@
 {{ define "main" }}
-	<h1>{{ .Title }}</h1>
+	<div class="panel space-y-2">
+		{{ .Content }}
+	</div>
 	{{ range .Pages.ByPublishDate.Reverse }}
 	<div class="panel my-2">
-		<h2><a href="{{ .Permalink }}">{{ .Title }}</a></h2>
+		<h2 id="{{ .Section }}-{{ .File.BaseFileName }}"><a href="{{ .Permalink }}">{{ .Title }}</a></h2>
 		<div class="flex flex-row flex-wrap md:flex-nowrap mt-2">
 			<span class="image-wrapper w-full h-32 md:w-32 md:h-32">
 				<img srcset="/imgs/no-image-new.webp" src="/imgs/no-image-new.png" alt="Filler" />

+ 0 - 17
layouts/blog/list.html

@@ -1,17 +0,0 @@
-{{ define "main" }}
-    <div class="panel space-y-2">
-        <h1>Blog Posts</h1>
-        <p>Here is an archive of articles I've written over the years. Some will be technical, and some will be more personal.</p>
-    </div>
-	{{ range .Pages.ByPublishDate.Reverse }}
-	<div class="panel my-2">
-		<h2><a href="{{ .Permalink }}">{{ .Title }}</a></h2>
-		<div class="flex flex-row flex-wrap md:flex-nowrap mt-2">
-			<span class="image-wrapper w-full h-32 md:w-32 md:h-32">
-				<img srcset="/imgs/no-image-new.webp" src="/imgs/no-image-new.png" alt="Filler" />
-			</span>
-			<p class="m-2 flex-1">{{ .Params.Intro | markdownify }}</p>
-		</div>
-	</div>
-	{{ end }}
-{{ end }}

+ 0 - 18
layouts/projects/list.html

@@ -1,18 +0,0 @@
-{{ define "main" }}
-    <div class="panel space-y-2">
-        <h1>Projects</h1>
-        <p>What follows is a list of all the various projects I've worked on over the years, as well as a short blurb about them. Not all of them are complete, or even functioning. I think that's fine though. They're still something I worked on, and something I learned from. Most of them have more info about them once you click through.</p>
-        <p>With all my projects, I encourage you to checkout the source code.</p>
-    </div>
-	{{ range .Pages.ByPublishDate.Reverse }}
-	<div class="panel my-2">
-		<h2><a href="{{ .Permalink }}">{{ .Title }}</a></h2>
-		<div class="flex flex-row flex-wrap md:flex-nowrap mt-2">
-			<span class="image-wrapper w-full h-32 md:w-32 md:h-32">
-				<img srcset="/imgs/no-image-new.webp" src="/imgs/no-image-new.png" alt="Filler" />
-			</span>
-			<p class="m-2 flex-1">{{ .Params.Intro | markdownify }}</p>
-		</div>
-	</div>
-	{{ end }}
-{{ end }}