Initial version of hugo-stack

This commit is contained in:
Alex Selimov 2026-08-13 16:31:11 -04:00
commit e19eb92b4b
28 changed files with 487 additions and 0 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
public/*

0
.hugo_build.lock Normal file
View file

7
README.md Normal file
View file

@ -0,0 +1,7 @@
# Hugo Stack
>Show off your cool full stack
This repo provides a Hugo partial and shortcode that generates a graphic that shows off your stack.

View file

View file

@ -0,0 +1,28 @@
- section: Code Editing
description: "Full stack tools for editing code"
items:
- name: ChocV
description: Sick keyboard. Super minimal keyboard with choc silver switches.
- name: 3-D Printed + Handwired Atreus
image: "/atreus.webp"
description: Homemade 36% keyboard with Glorious Panda switches and MT3 Dusk keycaps
- name: Nulea M505 Trackball Mouse
image: "/nulea.webp"
description: |
Smooth operation and long battery life
- name: Ghostty + Tmux + Neovim + Zenwritten theme
image: "/editor.webp"
description: Best stack for efficiently working on code. Monochromatic theme surprisingly helps with focus instead of staring at a rainbow all day.
- section: Building Tools
items:
- name: Macbook Pro M1 Max 64GB
image: "/macbook.webp"
description: "Was gifted this, really missing Linux but getting a high powered Linux laptop in 2026 seems unlikely"
- section: Fuel
description: "Human fuel to keep the code coming"
items:
- name: Warped Serie Gran Reserva 1988
image: "/warped.webp"
description: "Nice for improving focus during chill late night code sessions"
- name: Kalita Wave + Fellow Move
description: "Favorite pour-over coffee setup using the Scott Rao recipe"

6
exampleSite/hugo.toml Normal file
View file

@ -0,0 +1,6 @@
baseURL = 'http://localhost:1313/'
languageCode = 'en-us'
title = 'Stack Example'
[params]
accentColor = "#EF9F27"

View file

@ -0,0 +1,6 @@
<!-- https://github.com/jmooring/hugo-testing/blob/hugo-forum-topic-40998/layouts/_default/_markup/render-codeblock-katex.html -->
{{ .Page.Store.Set "hasCodeBlock" true }}
<!-- https://www.veriphor.com/articles/code-block-render-hooks/ -->
{{ $result := transform.HighlightCodeBlock . }}
{{ $result.Wrapped }}

View file

@ -0,0 +1,26 @@
<!DOCTYPE html>
<html lang="{{ with .Site.Language.Lang }}{{ . }}{{ else }}en-US{{ end }}">
<head>
<meta http-equiv="X-Clacks-Overhead" content="GNU Terry Pratchett" />
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
</head>
<body>
<style>
.container {
padding: 20%;
box-sizing: border-box
width: 100%;
}
</style>
<main id="main-content">
<div class="container">
{{- block "main" . }}{{- end }}
</div>
</main>
</body>
</html>

View file

@ -0,0 +1,36 @@
{{ define "main" }}
<content>
{{ if .Data.Singular }}
<h3 class="blog-filter">{{ i18n "filtering-for" }} "{{ .Title }}"</h3>
{{ end }}
<ul class="blog-posts">
{{ range .Pages }}
<li>
<span>
<i>
<time datetime='{{ .Date.Format "2006-01-02" }}' pubdate>
{{ .Date.Format (default "2006-01-02" .Site.Params.dateFormat) }}
</time>
</i>
</span>
{{ if .Params.link }}
<a href="{{ .Params.link }}" target="_blank">{{ .Title }} ↪</a>
{{ else }}
<a href="{{ .RelPermalink }}">{{ .Title }}</a>
{{ end }}
</li>
{{ else }}
<li>
{{ i18n "no-posts" }}
</li>
{{ end }}
</ul>
{{ if not .Data.Singular }}
<div>
{{ range .Site.Taxonomies.tags }}
<a class="blog-tags" href="{{ .Page.RelPermalink }}">#{{ lower .Page.Title }}</a>
{{ end }}
</div>
{{ end }}
</content>
{{ end }}

View file

@ -0,0 +1,64 @@
{{- $authorEmail := "" }}
{{- with site.Params.author }}
{{- if reflect.IsMap . }}
{{- with .email }}
{{- $authorEmail = . }}
{{- end }}
{{- end }}
{{- end }}
{{- $authorName := "" }}
{{- with site.Params.author }}
{{- if reflect.IsMap . }}
{{- with .name }}
{{- $authorName = . }}
{{- end }}
{{- else }}
{{- $authorName = . }}
{{- end }}
{{- end }}
{{- $pctx := . }}
{{- if .IsHome }}{{ $pctx = .Site }}{{ end }}
{{- $pages := slice }}
{{- if or $.IsHome $.IsSection }}
{{- $pages = $pctx.RegularPages }}
{{- else }}
{{- $pages = $pctx.Pages }}
{{- end }}
{{- $limit := .Site.Config.Services.RSS.Limit }}
{{- if ge $limit 1 }}
{{- $pages = $pages | first $limit }}
{{- end }}
{{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }}
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
<title>{{ if .IsHome }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{ . }} on {{ end }}{{ .Site.Title }}{{ end }}</title>
<link>{{ .Permalink }}</link>
<description>Recent content {{ if not .IsHome }}{{ with .Title }}in {{ . }} {{ end }}{{ end }}on {{ .Site.Title }}</description>
<generator>Hugo -- gohugo.io</generator>
{{ with site.Language.Lang }}
<language>{{ . }}</language>
{{ else }}
<language>en</language>
{{ end }}{{ with $authorEmail }}
<managingEditor>{{.}}{{ with $authorName }} ({{ . }}){{ end }}</managingEditor>{{ end }}{{ with $authorEmail }}
<webMaster>{{ . }}{{ with $authorName }} ({{ . }}){{ end }}</webMaster>{{ end }}{{ with .Site.Copyright }}
<copyright>{{ . }}</copyright>{{ end }}{{ if not .Date.IsZero }}
<lastBuildDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end }}
{{- with .OutputFormats.Get "RSS" }}
{{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }}
{{- end }}
{{- range $pages }}
<item>
<title>{{ .Title }}</title>
<link>{{ .Permalink }}</link>
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
{{- with $authorEmail }}<author>{{ . }}{{ with $authorName }} ({{ . }}){{ end }}</author>{{ end }}
<guid>{{ .Permalink }}</guid>
<description>{{ .Summary | transform.XMLEscape | safeHTML }}</description>
<content:encoded>{{ `<![CDATA[` | safeHTML }}{{ .Content | safeHTML }}{{ `]]>` | safeHTML }}</content:encoded>
</item>
{{- end }}
</channel>
</rss>

View file

@ -0,0 +1,40 @@
{{ define "main" }}
{{ if not .Params.menu }}
<h1>{{ .Title }}</h1>
{{ if not .Params.hideDate }}
<p class="byline">
<time datetime='{{ .Date.Format "2006-01-02" }}' pubdate>
{{ .Date.Format (default "2006-01-02" .Site.Params.dateFormat) }}
</time>
{{ with .Params.author }}· {{.}}{{ end }}
</p>
{{ end }}
{{ end }}
<content>
{{ .Content }}
</content>
<p>
{{ range (.GetTerms "tags") }}
<a class="blog-tags" href="{{ .RelPermalink }}">#{{ lower .LinkTitle }}</a>
{{ end }}
</p>
{{ if not .Params.hideReply }}
{{ with .Site.Params.author.email }}
<p>
<a href='mailto:{{ . }}?subject={{ i18n "email-subject" }}"{{ default $.Site.Title $.Page.Title }}"'>
{{ i18n "email-reply" }} ↪
</a>
</p>
{{ end }}
{{ end }}
{{ if and .Site.Params.upvotes (not .Params.hideUpvotes) }}
<div class="upvote">
<button id="upvote-btn" aria-label="Upvote">
<span id="upvote-chevron">&#8963;</span>
<span id="upvote-count"></span>
</button>
</div>
<script>window.UPVOTE_API = "{{ .Site.Params.upvoteApi }}";</script>
<script src="/upvote.js"></script>
{{ end }}
{{ end }}

View file

@ -0,0 +1,5 @@
{{ define "main" }}
{{ partial "stack.html" . }}
{{ end }}

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

View file

@ -0,0 +1,39 @@
<!DOCTYPE html>
<html lang="en">
<head><script src="/livereload.js?mindelay=10&amp;v=2&amp;port=1313&amp;path=livereload" data-no-instant defer></script>
<meta http-equiv="X-Clacks-Overhead" content="GNU Terry Pratchett" />
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
</head>
<body>
<style>
.container {
padding: 20%;
box-sizing: border-box
width: 100%;
}
</style>
<main id="main-content">
<div class="container">
<content>
<h3 class="blog-filter"> "Categories"</h3>
<ul class="blog-posts">
<li>
</li>
</ul>
</content>
</div>
</main>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

View file

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xhtml="http://www.w3.org/1999/xhtml">
<url>
<loc>http://localhost:1313/categories/</loc>
</url><url>
<loc>http://localhost:1313/</loc>
</url><url>
<loc>http://localhost:1313/tags/</loc>
</url>
</urlset>

View file

@ -0,0 +1,39 @@
<!DOCTYPE html>
<html lang="en">
<head><script src="/livereload.js?mindelay=10&amp;v=2&amp;port=1313&amp;path=livereload" data-no-instant defer></script>
<meta http-equiv="X-Clacks-Overhead" content="GNU Terry Pratchett" />
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
</head>
<body>
<style>
.container {
padding: 20%;
box-sizing: border-box
width: 100%;
}
</style>
<main id="main-content">
<div class="container">
<content>
<h3 class="blog-filter"> "Tags"</h3>
<ul class="blog-posts">
<li>
</li>
</ul>
</content>
</div>
</main>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 678 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 678 KiB

6
hugo.toml Normal file
View file

@ -0,0 +1,6 @@
baseURL = 'http://localhost:1313/'
languageCode = 'en-us'
title = 'Stack Example'
[params]
accentColor = "#EF9F27"

172
layouts/partials/stack.html Normal file
View file

@ -0,0 +1,172 @@
<style>
@media(min-width: 800px){
.stack_row{
position: relative;
display: flex;
margin-top: 30px;
flex-direction: column;
justify-content: flex-start;
}
.stack_item{
width: 34%;
margin: 5px;
}
.stack_item_wide{
width: 42%;
}
.stack_item_0{
transform: translateX(0%);
}
.stack_item_1{
transform: translateX(58%);
}
.stack_item_2{
transform: translateX(122%);
}
.stack_item_3{
transform: translateX(30%);
}
.stack_item_4{
transform: translateX(88%);
}
.stack_item_5{
transform: translateX(10%);
}
.stack_item_6{
transform: translateX(68%);
}
.stack_item_7{
transform: translateX(118%);
}
.stack_item_8{
transform: translateX(40%);
}
.stack_item_9{
transform: translateX(6%);
}
.stack_item_10{
transform: translateX(78%);
}
.stack_item_11{
transform: translateX(24%);
}
.stack_item_12{
transform: translateX(98%);
}
.stack_image{
width:100%;
padding: 20px;
}
.stack_item:not(:has(img)) {
width: fit-content;
min-width: 20%;
max-width: 32%;
}
.stack_item:nth-child(even of .stack_item):not(:has(img)) {
max-width: 38%;
}
}
.stack_row{
display: flex;
flex-direction: column;
position: relative;
}
.stack_image{
width:100%;
box-sizing: border-box;
padding: 0px;
align: center;
}
.stack_text{
width:100%;
padding: 0px 5px;
box-sizing: border-box;
border-left: 4px solid {{ .Site.Params.accentColor }};
position: relative;
}
.stack_item{
padding: 0px;
box-sizing: border-box;
margin: 10px;
}
.stack_row::before{
content: "";
position: absolute;
left: -25px;
top: 0;
bottom: -30px;
width: 1px;
background: {{ .Site.Params.accentColor }};
}
.stack_header{
position: relative;
padding: 0px;
margin: 0px;
}
.stack_header::before {
content: "";
position: absolute;
left: -24px;
top: 50%;
width: 15px;
height: 15px;
background: {{ .Site.Params.accentColor }};
border: 2px solid {{ .Site.Params.accentColor }};
border-radius: 20px;
transform: translate(-50%, -50%);
z-index: 1;
}
</style>
{{ $.Scratch.Set "counter" 0 }}
{{ range .Site.Data.stack }}
<div class = "stack_row">
<h2 class="stack_header"> {{ .section }} </h2>
<p style="margin: 0px;">{{.description}}</p>
{{ range .items }}
{{ $i := $.Scratch.Get "counter"}}
<div class='stack_item stack_item_{{mod $i 13}} {{ if mod $i 2}} stack_item_wide {{end}}'>
{{ with .image }}
<div class = "stack_image">
<img src={{.}} style="width:100%; align:center; display: block;"/>
</div>
{{end}}
<div class="stack_text">
<h3 style="margin: 0px;"> {{ .name }} </h3>
<p style="margin: 0px;">{{.description | markdownify}}</p>
</div>
{{ $.Scratch.Set "counter" (add ($.Scratch.Get "counter") 1) }}
</div>
{{ end }}
</div>
{{ end }}

View file

@ -0,0 +1 @@
{{ partial "stack.html" . }}