Compare commits

..

2 commits

Author SHA1 Message Date
e59b755090 Blog: enhance layout 2024-04-10 15:43:52 +02:00
de415ad907 First tentative version of a blog 2024-04-01 20:18:16 +02:00
12 changed files with 260 additions and 3 deletions

View file

@ -9,8 +9,7 @@ params:
siteLicenseName: "GNU GPLv3"
taxonomies:
category: categories
tag: tags
blog_tag: 'blog/tags'
privacy:
disqus:

15
content/blog/_index.md Normal file
View file

@ -0,0 +1,15 @@
---
title: "Blog"
date: 2024-04-01
draft: false
type: blog
menu:
main:
weight: 150
---
This blog is an eclectic collection of things I thought deserved to be written
up and recorded. It may (or may never) include the way I set up some services
for system administration, things I struggled to find, cool dev tricks, or
whatever crosses my mind (and, hopefully, was helpful).

10
content/blog/test01.md Normal file
View file

@ -0,0 +1,10 @@
---
title: Test 1
date: 2023-04-01
draft: true
"blog/tags":
- test
- misc
---
Bonjour, ceci est un test.

10
content/blog/test02.md Normal file
View file

@ -0,0 +1,10 @@
---
title: Test 2
date: 2023-05-02
draft: true
"blog/tags":
- test
- second
---
Bonjour, ceci est également un test.

View file

@ -0,0 +1,9 @@
---
title: Ceci, par rapport aux autres, est un test avec un titre d'une longueur fort surprenante.
date: 2023-05-12
draft: true
"blog/tags":
- test
---
Bonjour, ceci est également un test.

View file

@ -31,7 +31,7 @@
{{ partial "menu" . }}
</div>
<div id="content">
<div id="content" class="{{ block "contentclass" . }}{{ end }}">
{{ block "pagename" . }}
{{ end }}

15
layouts/blog/list.html Normal file
View file

@ -0,0 +1,15 @@
{{ define "profilepic" }}<div class="nopic"></div>{{ end }}
{{ define "pagename" }}
<h1>{{ .Title }}</h1>
{{ end }}
{{ define "main" }}
{{ .Content }}
<div id="entries">
{{ range .Pages }}
{{ partial "blog/entry_list.html" . }}
{{ end }}
</div>
{{ end }}

20
layouts/blog/single.html Normal file
View file

@ -0,0 +1,20 @@
{{ define "profilepic" }}<div class="nopic"></div>{{ end }}
{{ define "contentclass" }}blog{{ end }}
{{ define "pagename" }}
<div id="post_head">
<div id="post_date">{{ .Date | time.Format ":date_medium" }}</div>
{{ with .GetTerms "blog/tags" }}
<ul id="post_tags">
{{ range . -}}
<li class="tag"><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></li>
{{- end }}
</ul>
{{ end }}
<h1>{{ .Title }}</h1>
</div>
{{ end }}
{{ define "main" }}
{{ .Content }}
{{ end }}

View file

@ -0,0 +1,13 @@
<div class="blog_entry">
<div class="blog_entry_meta">
{{ with .GetTerms "blog/tags" }}
<ul class="blog_entry_tags">
{{ range . -}}
<li class="tag"><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></li>
{{- end }}
</ul>
{{ end }}
<span class="blog_entry_date">{{ .Date | time.Format ":date_medium" }}</span>
</div>
<a href="{{ .Permalink }}" class="blog_entry_title">{{ .Title }}</a>
</div>

98
scss/_blog.scss Normal file
View file

@ -0,0 +1,98 @@
// vim: tabstop=2 shiftwidth=2 expandtab
@import 'params';
#entries {
.blog_entry {
padding: 15px 0;
.blog_entry_title {
display: block;
font-size: 1.1em;
text-align: left;
}
.blog_entry_meta {
display: flex;
justify-content: flex-end;
align-items: center;
column-gap: 10px;
font-style: italic;
font-size: 0.9em;
color: $fg_color_light;
}
.blog_entry_date {
display: block;
align-self: flex-start;
}
.blog_entry_tags {
list-style: none;
padding-left: 0;
margin: 0;
li {
display: inline;
}
li ~ li::before {
content: ", ";
}
&::before {
content: "Tags:"
}
}
}
}
#post_head {
margin: 20px 0;
h1 {
margin: 5px 0;
}
#post_date {
text-align: right;
font-style: italic;
}
#post_tags {
display: flex;
justify-content: flex-end;
list-style: none;
padding-left: 0;
margin: 5px 0;
&::before {
content: "Tags: ";
font-style: italic;
padding-right: 1em;
}
li {
font-style: italic;
}
li ~ li::before {
content: ", ";
}
}
}
.blog {
.highlight>pre {
padding: 10px;
border-radius: 10px;
}
img {
display: block;
margin: 10px auto;
max-width: 80%;
max-height: 60vh;
border-radius: 10px;
}
blockquote {
font-style: italic;
border-left: 3px solid #8b8bbd;
padding-left: 15px;
margin-left: 25px;
}
}

View file

@ -2,6 +2,7 @@
@import url('fonts.css');
@import 'params';
@import 'blog';
html {
background-color: $bg_color;

View file

@ -1,5 +1,72 @@
@charset "UTF-8";
@import url("fonts.css");
#entries .blog_entry {
padding: 15px 0; }
#entries .blog_entry .blog_entry_title {
display: block;
font-size: 1.1em;
text-align: left; }
#entries .blog_entry .blog_entry_meta {
display: flex;
justify-content: flex-end;
align-items: center;
column-gap: 10px;
font-style: italic;
font-size: 0.9em;
color: #555555bb; }
#entries .blog_entry .blog_entry_date {
display: block;
align-self: flex-start; }
#entries .blog_entry .blog_entry_tags {
list-style: none;
padding-left: 0;
margin: 0; }
#entries .blog_entry .blog_entry_tags li {
display: inline; }
#entries .blog_entry .blog_entry_tags li ~ li::before {
content: ", "; }
#entries .blog_entry .blog_entry_tags::before {
content: "Tags:"; }
#post_head {
margin: 20px 0; }
#post_head h1 {
margin: 5px 0; }
#post_head #post_date {
text-align: right;
font-style: italic; }
#post_head #post_tags {
display: flex;
justify-content: flex-end;
list-style: none;
padding-left: 0;
margin: 5px 0; }
#post_head #post_tags::before {
content: "Tags: ";
font-style: italic;
padding-right: 1em; }
#post_head #post_tags li {
font-style: italic; }
#post_head #post_tags li ~ li::before {
content: ", "; }
.blog .highlight > pre {
padding: 10px;
border-radius: 10px; }
.blog img {
display: block;
margin: 10px auto;
max-width: 80%;
max-height: 60vh;
border-radius: 10px; }
.blog blockquote {
font-style: italic;
border-left: 3px solid #8b8bbd;
padding-left: 15px;
margin-left: 25px; }
html {
background-color: white; }