Add build script for gemlog.

This commit is contained in:
chmod777 2021-02-27 00:22:53 +00:00
parent fec9b2af29
commit 19b071ffd5
4 changed files with 104 additions and 0 deletions

31
.article_template.html Normal file
View File

@ -0,0 +1,31 @@
<html>
<head>
<meta charset="utf-8">
<title>chmod777's tilde</title>
<meta name="description" content="">
<meta name="author" content="chmod777">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="css/styles.css">
</head>
<body>
<header>
<h1>~chmod777</h1>
<nav>
<ul>
<li>
<a href="/">home</a>
</li>
<ul>
</header>
<main>
<h2></h2>
<p></p>
</main>
<footer>
</footer>
</body>
</html>

40
index.gmi Normal file
View File

@ -0,0 +1,40 @@
# ~chmod777
## Introductions
Hello!
Around the web I mostly go by chmod777. Feel free to ask me anything.
I am a recent computer science graduate with no clue what they are doing in life.
I just set this up so ther is more to add.
## Contact info
* fediverse/mastodon: @chmod777@linuxrocks.online
* irc.tilde.chat: chmodrwx
* gitea: tildegit.org/chmod777
## What you will find here
Blog posts about
* Software dev
* Hardware dev
* Aluminium casting
* Gardening
* Baking
* Other hobby projects
* Ramblings
You can find the web version of my blog at
=> http://tilde.club/~chmod777 ~chmod777
I just started working on a .html to .gmi converter for the posts in this gemlog so that my content on my blog will also be available here. Some features of the converter are still missing so if it looks like something is missing from one of these posts it might be but it also might be that I gave up writing halfway through.
=> https://tildegit.org/chmod777/html2gemini_rs html2gemini_rs
## Posts

33
update_gemlog.sh Executable file
View File

@ -0,0 +1,33 @@
#!/bin/bash
SOURCE_DIR=~/blog_source
ASSETS_DIR=$SOURCE_DIR/assets
GEM_DIR=~/public_gemini
rm -r $GEM_DIR/*
cp $SOURCE_DIR/index.gmi $SOURCE_DIR/index.gmi.temp
LINE=`grep -Fn 'Posts' $SOURCE_DIR/index.gmi | cut -d : -f 1`
LINE=$(($LINE+1))
for FILE in `ls -tr $SOURCE_DIR/posts | grep -v /`
do
NAME=${FILE%.html}
echo "source: ${FILE}"
OUT="$GEM_DIR/$NAME.gmi"
echo "out: $OUT"
~/bin/html2gemini_rs "${SOURCE_DIR}/posts/${FILE}" > "${OUT}"
SPACES=`tr -s '_' ' ' <<< "$NAME"`
ENTRY="posts/${FILE}"
TIME_MODIFIED=`stat -c %y ${ENTRY} | grep -oE "\w{4}-\w{2}-\w{2} \w{2}:\w{2}:\w{2}"`
sed -i "$LINE i => ${NAME}.gmi ${SPACES} ${TIME_MODIFIED} UTC" $SOURCE_DIR/index.gmi.temp
done
cp $SOURCE_DIR/index.gmi.temp $GEM_DIR/index.gmi
rm $SOURCE_DIR/index.gmi.temp