feat: lists & post templates

This commit is contained in:
ae 2024-12-09 21:23:07 +02:00
parent 8d47065573
commit 7aea7e0135
Signed by: ae
GPG Key ID: 995EFD5C1B532B3E
8 changed files with 113 additions and 15 deletions

4
.gitignore vendored
View File

@ -13,5 +13,7 @@ hugo.linux
# Temporary lock file while building
/.hugo_build.lock
# Configs (testing)
# Configs, site contents (for testing)
hugo.yaml
content/
static/

View File

@ -2,4 +2,6 @@
title = '{{ replace .File.ContentBaseName "-" " " | title }}'
date = {{ .Date }}
draft = true
tags = []
categories = []
+++

View File

@ -1,5 +1,6 @@
:root {
--background: #0a0a0a;
--code: #222222;
--highlight: #fdc500;
--text: #a9d6e5;
}
@ -15,10 +16,12 @@ body {
align-items: center;
min-height: 100vh;
}
.main-content {
max-width: 1000px;
padding: 20px;
}
.ascii-art {
white-space: pre;
font-size: 14px;
@ -27,20 +30,31 @@ body {
color: var(--highlight);
margin-bottom: 20px;
}
.links {
text-align: center;
margin-top: 20px;
}
.links a {
a {
color: var(--text);
text-decoration: none;
margin: 0 10px;
transition: color 0.3s ease;
display: inline-block;
}
.links a:hover {
a:hover {
color: var(--highlight);
}
.content a {
text-decoration: underline;
}
.links a {
margin: 0 10px;
display: inline-block;
}
.separator {
content: "•";
display: block;
@ -48,9 +62,11 @@ body {
margin: 15px auto;
color: var(--highlight);
}
h1 {
color: var(--highlight);
}
.date {
font-style: italic;
color: var(--highlight);
@ -63,3 +79,61 @@ h1 {
margin-top: 20px;
font-size: 1.2em;
}
.content img {
display: block;
max-width: 80%;
max-height: 500px;
width: auto;
height: auto;
margin: 20px auto;
object-fit: contain;
object-position: center;
}
/* code snippets */
.content pre {
padding: 1rem;
border-radius: 0.3rem;
line-height: 1.5;
overflow-x: auto;
}
.content code {
font-size: 0.8rem;
}
.content > p > code {
background-color: var(--code);
border-radius: 0.15rem;
padding: 0.02rem 0.2rem;
white-space: normal;
word-break: break-word;
}
.metadata {
margin-bottom: 20px;
}
.categories, .tags {
font-size: 0.9em;
color: var(--text);
opacity: 0.8;
margin: 5px 0;
}
.categories a, .tags a {
margin-right: 10px;
text-decoration: underline;
}
.content ul,
.content ol {
line-height: 1.3;
padding-left: 30px;
}
.content ul li,
.content ol li {
margin-bottom: 8px;
}

View File

@ -7,8 +7,5 @@
<main>
{{ block "main" . }}{{ end }}
</main>
<footer>
{{ partial "footer.html" . }}
</footer>
</body>
</html>

View File

@ -1,8 +1,32 @@
{{ define "main" }}
<div class="main-content">
<h1>{{ .Title }}</h1>
<div class="metadata">
<p class="date">{{ .Date.Format "January 02, 2006" }}</p>
{{ with .Params.categories }}
<p class="categories">
Categories:
{{ range . }}
<a href="{{ "/categories/" | relLangURL }}{{ . | urlize }}">{{ . }}</a>
{{ end }}
</p>
{{ end }}
{{ with .Params.tags }}
<p class="tags">
Tags:
{{ $maxTags := 3 }}
{{ range first $maxTags . }}
<a href="{{ "/tags/" | relLangURL }}{{ . | urlize }}">{{ . }}</a>
{{ end }}
{{ if gt (len .) $maxTags }}
...
{{ end }}
</p>
{{ end }}
</div>
{{ with .Params.originalPost }}
<p><em>Originally posted on <a href="{{ .url }}">{{ .source }}</a></em></p>
{{ end }}

View File

@ -31,19 +31,19 @@
</p>
<div class="links">
{{ range .Site.Params.services }}
<a href="{{ .url }}" title="{{ .name }}">{{ .name }}</a>
<a href="{{ .url }}" target="_blank" rel="noopener noreferrer" title="{{ .name }}">{{ .name }}</a>
{{ end }}
</div>
<div class="separator">•••</div>
<div class="links">
{{ range .Site.Params.contacts }}
<a href="{{ .url }}" title="{{ .display }}">{{ .name }}</a>
<a href="{{ .url }}" target="_blank" rel="noopener noreferrer" title="{{ .display }}">{{ .name }}</a>
{{ end }}
</div>
<div class="separator">•••</div>
<div class="links">
{{ range .Site.Params.others }}
<a href="{{ .url }}" title="{{ .display }}">{{ .name }}</a>
<a href="{{ .url }}" target="_blank" rel="noopener noreferrer" title="{{ .display }}">{{ .name }}</a>
{{ end }}
</div>
</div>

View File

@ -1 +0,0 @@
<p>Copyright {{ now.Year }}. All rights reserved.</p>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB