christianermann.dev-hugo

The Hugo source for my website
git clone git://git.christianermann.dev/christianermann.dev-hugo
Log | Files | Refs | Submodules | README

commit 717fdfc94a49e449fecb7ec2364b97f3b2e3a644
parent c9f76038080e2337b0fa632544ed76b741b7c9ea
Author: Christian Ermann <christianermann@gmail.com>
Date:   Thu, 14 Nov 2024 10:40:42 -0800

Change theme to 'Bear Cub'

Diffstat:
M.gitmodules | 6+++---
Mconfig.toml | 41+++++++++++++++++++++++++----------------
Mcontent/_index.md | 2+-
Alayouts/index.html | 7+++++++
Alayouts/partials/custom_head.html | 3+++
Mlayouts/partials/footer.html | 3++-
Mlayouts/partials/header.html | 10+++-------
Alayouts/partials/math.html | 4++++
Alayouts/partials/nav.html | 22++++++++++++++++++++++
Alayouts/partials/summary.html | 15+++++++++++++++
Athemes/hugo-bearcub | 1+
Dthemes/simple | 1-
12 files changed, 86 insertions(+), 29 deletions(-)

diff --git a/.gitmodules b/.gitmodules @@ -1,3 +1,3 @@ -[submodule "themes/simple"] - path = themes/simple - url = https://github.com/c2000e/simple_hugo.git +[submodule "themes/hugo-bearcub"] + path = themes/hugo-bearcub + url = https://github.com/clente/hugo-bearcub diff --git a/config.toml b/config.toml @@ -1,19 +1,34 @@ baseURL = "https://www.christianermann.dev" -languageCode = "en-us" -title = "Christian Ermann" +theme = "hugo-bearcub" +defaultContentLanguage = "en" -theme = "simple" - -pagination = 20 summaryLength = 25 +enableRobotsTXT = true [markup] [markup.highlight] - style = 'monokailight' - tabWidth = 4 + lineNos = true + lineNumbersInTable = false + noClasses = false + +[languages] + [languages.en] + title = "Christian Ermann" + languageName = "en-US" + LanguageCode = "en-US" + contentDir = "content" [params] - author = "Christian Ermann" + title = "Christian Ermann" + description = "Stuff I'm working on." + dateFormat = "2006-01-02" + themeStyle = "herman" + hideUntranslated = false + madeWith = "Made with [Bear Cub](https://github.com/clente/hugo-bearcub)" + + [params.author] + name = "Christian Ermann" + email = "christianermann@gmail.com" [menu] [[menu.main]] @@ -29,22 +44,16 @@ summaryLength = 25 weight = 2 [[menu.main]] - identifier = "tags" - name = "Tags" - url = "/tags/" - weight = 3 - - [[menu.main]] identifier = "code" name = "Code" url = "https://git.christianermann.dev" - weight = 4 + weight = 3 [[menu.main]] identifier = "resume" name = "Resume" url = "/resume.pdf" - weight = 5 + weight = 4 [[menu.footer]] name = "Github" diff --git a/content/_index.md b/content/_index.md @@ -1,5 +1,5 @@ --- title: "christianermann.dev" -date: "2021-25-08" +date: "2021-08-25" draft: "false" --- diff --git a/layouts/index.html b/layouts/index.html @@ -0,0 +1,7 @@ +{{ define "main" }} + {{ .Content }} + {{ range first 2 site.RegularPages }} + {{ partial "summary.html" . }} + {{ end }} + <h2><a href='{{ absURL "/posts/" }}'>View Older Posts</a></h2> +{{ end }} diff --git a/layouts/partials/custom_head.html b/layouts/partials/custom_head.html @@ -0,0 +1,3 @@ +{{ if or .Params.math .Site.Params.math }} +{{ partial "math.html" . }} +{{ end }} diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html @@ -2,5 +2,6 @@ {{ range .Site.Menus.footer }} <a href="{{ .URL }}">{{ .Name }}</a>. {{ end }} - <p>Copyright &copy; {{ now.Year }} {{ .Site.Params.author }}.</p> + <a href='{{ absURL "index.xml" }}'>RSS</a>. + <p>Copyright &copy; {{ now.Year }} {{ .Site.Params.author.name }}. | {{ markdownify .Site.Params.madeWith }}</p> </footer> diff --git a/layouts/partials/header.html b/layouts/partials/header.html @@ -1,7 +1,3 @@ -<header> - <nav> - {{ range .Site.Menus.main }} - <a href="{{ .URL | relURL }}">{{ .Name }}</a>. - {{ end }} - </nav> -</header> +<a class="skip-link" href="#main-content">{{ i18n "skip-link" }}</a> + +<nav>{{- partial "nav.html" . -}}</nav> diff --git a/layouts/partials/math.html b/layouts/partials/math.html @@ -0,0 +1,4 @@ +<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/katex.min.css" integrity="sha384-nB0miv6/jRmo5UMMR1wu3Gz6NLsoTkbqJghGIsx//Rlm+ZU03BU6SQNC66uf4l5+" crossorigin="anonymous"> +<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/katex.min.js" integrity="sha384-7zkQWkzuo3B5mTepMUcHkMB5jZaolc2xDwL6VFqjFALcbeS9Ggm/Yr2r3Dy4lfFg" crossorigin="anonymous"></script> +<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/contrib/auto-render.min.js" integrity="sha384-43gviWU0YVjaDtb/GhzOouOXtZMP/7XUzwPTstBeZFe/+rCMvRwr4yROQP43s0Xk" crossorigin="anonymous" + onload="renderMathInElement(document.body);"></script> diff --git a/layouts/partials/nav.html b/layouts/partials/nav.html @@ -0,0 +1,22 @@ +{{ range .Site.Menus.main.ByWeight }} + <a href="{{ .URL }}">{{ .Name }}</a> +{{ end }} + +<!-- Convert this page's translations into a dict --> +{{ $translations := dict }} +{{ range .Translations }} + {{ $translations = merge $translations (dict .Language.Lang .) }} +{{ end }} + +<!-- Create a link to every translation --> +{{ range where .Site.Languages "Lang" "!=" .Page.Lang }} + {{ with (index $translations .Lang) }} + <a href="{{ .RelPermalink }}">{{ .Language.LanguageName }}</a> + {{ else }} + <!-- The complicated setup was necessary to make a grayed out link --> + {{ if not .Params.hideUntranslated }} + <a class="disabled" role="link" aria-disabled="true">{{ .LanguageName }}</a> + {{ end }} + {{ end }} +{{ end }} + diff --git a/layouts/partials/summary.html b/layouts/partials/summary.html @@ -0,0 +1,15 @@ +<div class="summary"> + <h2><a href="{{ .Permalink }}">{{ .Title }}</a></h2> + <div class="summary_metadata"> + <time>{{ .Date.Format "2006-01-02" }}</time> + {{ range .Params.tags }} + <a href="{{ "/tags/" | relLangURL }}{{ . | urlize }}">{{ . }}</a>. + {{ end }} + </div> + <div class="summary_body"> + {{ .Summary }} + </div> + {{ if .Truncated }} + <a href="{{ .Permalink }}">Read more...</a> + {{ end }} +</div> diff --git a/themes/hugo-bearcub b/themes/hugo-bearcub @@ -0,0 +1 @@ +Subproject commit 7cc146b13f3b4f5a7ceb87ed5ce094c4cf6a365d diff --git a/themes/simple b/themes/simple @@ -1 +0,0 @@ -Subproject commit ed1da7d7f6e5dc2c3da7782b35e0fe23bc4bef18