Selaa lähdekoodia

Add custom lists for blogs & projects

I wanted to add individual intro panels for the projects and blog posts,
so I gave them their own lists.
Apis Necros 2 vuotta sitten
vanhempi
säilyke
69d345ad02
2 muutettua tiedostoa jossa 35 lisäystä ja 0 poistoa
  1. 17 0
      layouts/blog/list.html
  2. 18 0
      layouts/projects/list.html

+ 17 - 0
layouts/blog/list.html

@@ -0,0 +1,17 @@
+{{ 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 }}

+ 18 - 0
layouts/projects/list.html

@@ -0,0 +1,18 @@
+{{ 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 }}