add main script for generating sites
add html parts, output and assets
This commit is contained in:
parent
eda36e1b38
commit
86a74d1020
14 changed files with 423 additions and 0 deletions
BIN
assets/favicon.ico
Normal file
BIN
assets/favicon.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.1 KiB |
BIN
assets/gibone-CV.pdf
Normal file
BIN
assets/gibone-CV.pdf
Normal file
Binary file not shown.
166
gmirator.sh
Executable file
166
gmirator.sh
Executable file
|
@ -0,0 +1,166 @@
|
|||
#! /usr/bin/env bash
|
||||
|
||||
source ./gmirator.conf
|
||||
|
||||
COMMAND=$1
|
||||
PARAM=$2
|
||||
|
||||
make_gemlogs_index() {
|
||||
|
||||
rm articles.gmi.temp
|
||||
|
||||
echo "generating articles.gmi.temp"
|
||||
ls $LGMI/gemlog | grep -v 'index' | sort -r \
|
||||
| while read fname; do
|
||||
local date=$(echo "$fname" | sed "s/_.*//")
|
||||
local title=$(head -1 $LGMI/gemlog/$fname | sed "s/# //")
|
||||
echo "=> gemlog/$fname $date - $title" >> $WORKDIR/articles.gmi.temp
|
||||
done
|
||||
|
||||
echo "generating gemlog/index.gmi"
|
||||
sed -i -e "/^## logs/,//{
|
||||
/^#/!d
|
||||
}" -e "/^## logs/{
|
||||
a
|
||||
r $WORKDIR/articles.gmi.temp
|
||||
}" $LGMI/gemlog/index.gmi
|
||||
|
||||
echo "generating index.gmi"
|
||||
printf '
|
||||
=> tinylog.gmi tinylogs go here
|
||||
=> gemlog/index.gmi full gemlogs here\n\n%s' "$(head $WORKDIR/articles.gmi.temp)" \
|
||||
| cat $WORKDIR/in.gmi - > $LGMI/index.gmi
|
||||
echo "" >> $LGMI/index.gmi
|
||||
|
||||
echo "DONE :)"
|
||||
}
|
||||
|
||||
gmi2html() {
|
||||
local in_list=no
|
||||
local in_preformated=no
|
||||
|
||||
while read -r line; do
|
||||
if [[ "$in_list" == yes ]]; then
|
||||
if [[ "$line" == '* '* ]]; then
|
||||
printf "<li>%s</li>\n" "${line/\* /}"
|
||||
continue
|
||||
else
|
||||
in_list=no
|
||||
printf "</ul>\n"
|
||||
fi
|
||||
elif [[ "$in_preformated" == yes ]]; then
|
||||
if [[ "$line" == '```'* ]]; then
|
||||
in_preformated=no
|
||||
printf "</pre>\n"
|
||||
else
|
||||
printf "%s\n" "$line"
|
||||
fi
|
||||
continue
|
||||
fi
|
||||
|
||||
# this next condition allows for adding extra line breaks
|
||||
# with 2 empty lines in a row
|
||||
if [[ $line == '' ]]; then
|
||||
if [[ $prev_line_empty == 1 ]]; then
|
||||
printf "<br>\n"
|
||||
prev_line_empty=0
|
||||
else
|
||||
prev_line_empty=1
|
||||
fi
|
||||
continue
|
||||
elif [[ $prev_line_empty == 1 ]]; then
|
||||
prev_line_empty=0
|
||||
fi
|
||||
|
||||
case "$line" in
|
||||
'* '*)
|
||||
in_list=yes
|
||||
printf "<ul>\n<li>%s</li>\n" "${line/\* }"
|
||||
;;
|
||||
'# '*)
|
||||
printf "<h1>%s</h1>\n" "$line"
|
||||
;;
|
||||
'## '*)
|
||||
printf "<h2>%s</h2>\n" "$line"
|
||||
;;
|
||||
'### '*)
|
||||
printf "<h3>%s</h3>\n" "$line"
|
||||
;;
|
||||
'=> '*)
|
||||
fname=$(echo "$line" | sed 's/=> \([^ ]*\).*/\1/')
|
||||
fname=${fname/.gmi/.html}
|
||||
desc=$(echo "$line" | sed 's/=> [^ ]* \(.*\)/=> \1/')
|
||||
printf "<a href=\"%s\">%s</a><br>\n" "$fname" "$desc"
|
||||
;;
|
||||
'```'*)
|
||||
in_preformated=yes
|
||||
printf "<pre>\n"
|
||||
;;
|
||||
*)
|
||||
printf "<p>%s</p>\n" "$line"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
||||
make_html() {
|
||||
while read -r file; do
|
||||
local dest=${file/.gmi/.html}
|
||||
dest=${dest/\/content\//\/html-output\/}
|
||||
|
||||
printf "... %s\n" $dest
|
||||
cat $HTML_HEADER > $dest
|
||||
gmi2html < "$file" >> $dest
|
||||
cat $HTML_FOOTER >> $dest
|
||||
done < <(find $LGMI -type f -name \*.gmi)
|
||||
echo "Done generating HTML"
|
||||
echo "Copying statis assets"
|
||||
cp $ASSETS/* $LHTML
|
||||
}
|
||||
|
||||
synchronise() {
|
||||
if [[ $PARAM == "html" ]]; then
|
||||
echo "Synchronising HTML content with remote"
|
||||
rsync -aP -e "ssh -p 1312" $LHTML $RHTML
|
||||
elif [[ $PARAM == "gmi" ]]; then
|
||||
echo "Synchtonising GMI content with remote"
|
||||
rsync -aP -e "ssh -p 1312" $LGMI $RGMI
|
||||
fi
|
||||
}
|
||||
|
||||
generate() {
|
||||
case $1 in
|
||||
gmi)
|
||||
make_gemlogs_index
|
||||
;;
|
||||
html)
|
||||
make_html
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
usage() {
|
||||
echo "\
|
||||
Usage: $0 <COMMAND>
|
||||
|
||||
Commands:
|
||||
gen generates output
|
||||
sync synchronises files with server with rsync
|
||||
"
|
||||
}
|
||||
|
||||
main() {
|
||||
case $COMMAND in
|
||||
gen)
|
||||
generate $PARAM
|
||||
;;
|
||||
sync)
|
||||
synchronise
|
||||
;;
|
||||
*)
|
||||
usage
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
main
|
BIN
html-output/favicon.ico
Normal file
BIN
html-output/favicon.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.1 KiB |
20
html-output/gemlog/2021-05-01_windowssucks.html
Normal file
20
html-output/gemlog/2021-05-01_windowssucks.html
Normal file
|
@ -0,0 +1,20 @@
|
|||
<!DOCTYPE HTML>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>stevengibone.com</title>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="icon" href="/favicon.ico" type="image/x-icon">
|
||||
<link rel="stylesheet" href="/style.css" type="text/css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1># I hate Microsoft</h1>
|
||||
<p>Yep, like a lot of people I hate Microsoft so I'll try to be a little specific.</p>
|
||||
<p>First of all, the only reason I still have Windows on my desktop is for gaming reasons and only that, most of what I do happens on GNU+Linux on my laptop which is not powerfull to play something more advanced than OSRS. I hadn't played on that desktop for a very long time because I no longer had a GPU but I found a very, very old GT240 at my parent's house to put in there so I started using it again... It was my first use of Windows in about two years and it was a pain!</p>
|
||||
<p>I discovered that back in 2018 I tried to prevent MS from spying on me by disabling every telemetry I could... so that was a mistake because now Windows just refuses to update. I know it was my fault but it feels so wrong that if I don't want my pc to send MS data about what I do on my computer I also have to give up having Windows updates.</p>
|
||||
<p>All this was so I could play Minecraft with my SO. I had not played Minecraft in many years, Mojang had not been bought by MS last time I played. I was so angry when I learnt about the bedrock edition and that I had to buy it even though I already had the java edition (I don't intend to play the bedrock edition but the fact that you have to pay twice to have both is infuriating to me). The worst part is that by the end of the year if I want to continue playing I have to use a MS account with Minecraft instead of my Mojang account and that also pisses my off very much.</p>
|
||||
<p>Unfortunately these are not the only reasons I hate MS, they were just new reasons that added to the others.</p>
|
||||
</body>
|
||||
</html>
|
16
html-output/gemlog/2021-05-04_networking_school.html
Normal file
16
html-output/gemlog/2021-05-04_networking_school.html
Normal file
|
@ -0,0 +1,16 @@
|
|||
<!DOCTYPE HTML>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>stevengibone.com</title>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="icon" href="/favicon.ico" type="image/x-icon">
|
||||
<link rel="stylesheet" href="/style.css" type="text/css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1># I'm learning networking</h1>
|
||||
<p>I'm currently learning networking stuff to become a sysadmin on my own waiting for the formation to start. I'm looking at a free Coursera course and videos on Youtube and I'm having a blast learning all this but it makes me want to buy all kind of things that would be way overkill both for my wallet and for my home network...</p>
|
||||
</body>
|
||||
</html>
|
40
html-output/gemlog/index.html
Normal file
40
html-output/gemlog/index.html
Normal file
|
@ -0,0 +1,40 @@
|
|||
<!DOCTYPE HTML>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>stevengibone.com</title>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="icon" href="/favicon.ico" type="image/x-icon">
|
||||
<link rel="stylesheet" href="/style.css" type="text/css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1># log index</h1>
|
||||
<p>Here will live gemlog posts about nothing and everything, I will rant a lot I thing, I could I not, you deserve entertainment!</p>
|
||||
<p>there's a list of ideas:</p>
|
||||
<ul>
|
||||
<li>the fashion industry</li>
|
||||
<li>how I buy clothes</li>
|
||||
<li>what clothes do I like?</li>
|
||||
</ul>
|
||||
<ul>
|
||||
<li>my journey into linux</li>
|
||||
<li>my love for tech minimalism</li>
|
||||
<li>my use of free software</li>
|
||||
<li>my self hosting journey</li>
|
||||
<li>how I kind of broke my system but I managed to fix it (._.')</li>
|
||||
</ul>
|
||||
<ul>
|
||||
<li>something about maths</li>
|
||||
</ul>
|
||||
<ul>
|
||||
<li>politics</li>
|
||||
<li>free money (as in freedom, not free beer), the case of june/G1</li>
|
||||
<li>universal wage (salaire à vie in french), which is not UBI</li>
|
||||
</ul>
|
||||
<h2>## logs</h2>
|
||||
<a href="gemlog/2021-05-04_networking_school.html">=> 2021-05-04 - I'm learning networking</a><br>
|
||||
<a href="gemlog/2021-05-01_windowssucks.html">=> 2021-05-01 - I hate Microsoft</a><br>
|
||||
</body>
|
||||
</html>
|
BIN
html-output/gibone-CV.pdf
Normal file
BIN
html-output/gibone-CV.pdf
Normal file
Binary file not shown.
86
html-output/index.html
Normal file
86
html-output/index.html
Normal file
|
@ -0,0 +1,86 @@
|
|||
<!DOCTYPE HTML>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>stevengibone.com</title>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="icon" href="/favicon.ico" type="image/x-icon">
|
||||
<link rel="stylesheet" href="/style.css" type="text/css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<pre>
|
||||
▄▀▀ ▄▀ █ ██▄ ▄▀▄ █▄ █ ██▀
|
||||
▄██ ▄ ▀▄█ █ █▄█ ▀▄▀ █ ▀█ █▄▄
|
||||
Est. 17th of February 2021.
|
||||
</pre>
|
||||
<h1># stevengibone.com</h1>
|
||||
<a href="gibone-CV.pdf">=> my resume (in french)</a><br>
|
||||
<a href="mailto:steven.gibone@zaclys.net">=> mailto:steven.gibone@zaclys.net</a><br>
|
||||
<p>Hello, my name is Steven Gibone and welcome to my gemini capsule. I used to study mathematics but quit due to me realizing I don't want to teach to an entire class. The public education system is far too broken for me and I really cannot accept to work in these conditions.</p>
|
||||
<p>I have both a *website* and a *gemini capsule*:</p>
|
||||
<a href="gemini://stevengibone.com">=> gemini://stevengibone.com</a><br>
|
||||
<a href="https://stevengibone.com">=> https://stevengibone.com</a><br>
|
||||
<p>If you don't know about the *gemini* protocol and care about a more simple internet, I strongly encourage you to learn more about it:</p>
|
||||
<a href="https://gemini.circumlunar.space/">=> https://gemini.circumlunar.space/</a><br>
|
||||
<p>I take interest in:</p>
|
||||
<ul>
|
||||
<li>coffee, I love coffee</li>
|
||||
<li>free/libre software</li>
|
||||
<li>maker/hacker culture</li>
|
||||
<li>mathematics</li>
|
||||
<li>philosophy</li>
|
||||
<li>politics</li>
|
||||
<li>video games</li>
|
||||
</ul>
|
||||
<p>And sportswise:</p>
|
||||
<ul>
|
||||
<li>fencing (I'm not a fencer anymore but really loved it)</li>
|
||||
<li>rock climbing (mostly bouldering in Arkose)</li>
|
||||
<li>rollerblading</li>
|
||||
</ul>
|
||||
<h2>## finished projects</h2>
|
||||
<h3>### 2021</h3>
|
||||
<ul>
|
||||
<li>built my website using PicoCMS</li>
|
||||
<li>installed Pi-Hole on my Raspberry Pi</li>
|
||||
<li>installed Gogs on my Raspberry Pi now with remote access</li>
|
||||
<li>bought a domain name for my website.</li>
|
||||
<li>migrated from Gogs to Gitea because it was easy and Gitea has a mobile UI contrary to Gogs. Lives at the same address.</li>
|
||||
<li>installed agate to serve this gemini capsule :)</li>
|
||||
<li>migrate website from PicoCMS to 11ty</li>
|
||||
</ul>
|
||||
<h3>### 2022</h3>
|
||||
<ul>
|
||||
<li>multiple things of which I didn't keep records</li>
|
||||
<li>a lot of testing of different minecraft servers and frontend to manage them. I finaly dicided to keep it simple by using cronjobs and tmux. I found that web dashboards are to cumbersome and not flexible enough.</li>
|
||||
<li>tried *gitolite* and *cgit* replacement of *Gitea*</li>
|
||||
<li>settle to *Onedev*</li>
|
||||
</ul>
|
||||
<h3>### 2023</h3>
|
||||
<ul>
|
||||
<li>resuscitate my gemini capsule again after reading an article by Ploum</li>
|
||||
</ul>
|
||||
<a href="gemini://ploum.net/2022-12-04-fin-du-blog-et-derniere-version.html">=> gemini://ploum.net/2022-12-04-fin-du-blog-et-derniere-version.gmi</a><br>
|
||||
<h2>## what I'm reading</h2>
|
||||
<ul>
|
||||
<li>~~The Lord of the Rings: The Two Towers, J.R.R. Tolkien~~</li>
|
||||
<li>~~Clit Révolution, Sarah Constantin & Elvire Duvelle-Charles~~</li>
|
||||
<li>En Travail, Bernard Friot et Frédéric Lordon</li>
|
||||
<li>Sortir de l'hétérosexualité, Juliet Drouart</li>
|
||||
</ul>
|
||||
<h2>## what I'm playing</h2>
|
||||
<ul>
|
||||
<li>Skul: The Hero Slayer</li>
|
||||
<li>Hades</li>
|
||||
<li>PokeMon: Shining Pearl</li>
|
||||
</ul>
|
||||
<h2>## logs</h2>
|
||||
<a href="tinylog.html">=> tinylogs go here</a><br>
|
||||
<a href="gemlog/index.html">=> full gemlogs here</a><br>
|
||||
<br>
|
||||
<a href="gemlog/2021-05-04_networking_school.html">=> 2021-05-04 - I'm learning networking</a><br>
|
||||
<a href="gemlog/2021-05-01_windowssucks.html">=> 2021-05-01 - I hate Microsoft</a><br>
|
||||
</body>
|
||||
</html>
|
34
html-output/style.css
Normal file
34
html-output/style.css
Normal file
|
@ -0,0 +1,34 @@
|
|||
body {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
max-width: 750px;
|
||||
margin: auto;
|
||||
background: black;
|
||||
color: lime;
|
||||
border: solid 2px;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
a {
|
||||
color: orange;
|
||||
}
|
||||
a:visited {
|
||||
color: chocolate;
|
||||
}
|
||||
|
||||
h1,h2,h3 {
|
||||
border-bottom: dashed 1px;
|
||||
}
|
||||
|
||||
p {
|
||||
margin: 1em 0em 1em;
|
||||
}
|
||||
|
||||
pre {
|
||||
border: solid 2px;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
ul {
|
||||
margin: initial;
|
||||
}
|
15
html-output/tinylog.html
Normal file
15
html-output/tinylog.html
Normal file
|
@ -0,0 +1,15 @@
|
|||
<!DOCTYPE HTML>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>stevengibone.com</title>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="icon" href="/favicon.ico" type="image/x-icon">
|
||||
<link rel="stylesheet" href="/style.css" type="text/css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<p>---</p>
|
||||
</body>
|
||||
</html>
|
2
html-parts/footer-part.html
Normal file
2
html-parts/footer-part.html
Normal file
|
@ -0,0 +1,2 @@
|
|||
</body>
|
||||
</html>
|
12
html-parts/header-part.html
Normal file
12
html-parts/header-part.html
Normal file
|
@ -0,0 +1,12 @@
|
|||
<!DOCTYPE HTML>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>stevengibone.com</title>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="icon" href="/favicon.ico" type="image/x-icon">
|
||||
<link rel="stylesheet" href="/style.css" type="text/css">
|
||||
</head>
|
||||
|
||||
<body>
|
32
html-parts/style.css
Normal file
32
html-parts/style.css
Normal file
|
@ -0,0 +1,32 @@
|
|||
body {
|
||||
max-width: 750px;
|
||||
margin: auto;
|
||||
background: black;
|
||||
color: lime;
|
||||
border: solid 2px;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
a {
|
||||
color: orange;
|
||||
}
|
||||
a:visited {
|
||||
color: chocolate;
|
||||
}
|
||||
|
||||
h1,h2,h3 {
|
||||
border-bottom: dashed 1px;
|
||||
}
|
||||
|
||||
p {
|
||||
margin: 1em 0em 1em;
|
||||
}
|
||||
|
||||
pre {
|
||||
border: solid 2px;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
ul {
|
||||
margin: initial;
|
||||
}
|
Loading…
Reference in a new issue