diff options
author | Squibid <me@zacharyscheiman.com> | 2023-09-26 16:55:27 -0400 |
---|---|---|
committer | Squibid <me@zacharyscheiman.com> | 2023-09-26 16:55:27 -0400 |
commit | 13561786a746131091e791187d4793432d2984ad (patch) | |
tree | 5a70b65ef22a11617c85e83f0700d7cf2373cbdb /gen | |
parent | 48475ae4abd6c7103a1871235a4fcab5dc1b6177 (diff) | |
download | site-13561786a746131091e791187d4793432d2984ad.tar.gz site-13561786a746131091e791187d4793432d2984ad.tar.bz2 site-13561786a746131091e791187d4793432d2984ad.zip |
Big changes!
- Fixed typo in pinned git repos
- Add new pinned repo (wallheaven)
- Switch blog generation to php
- remove useless symlink in blog/
Diffstat (limited to '')
-rwxr-xr-x | genblog | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/genblog b/genblog deleted file mode 100755 index 12bb7fe..0000000 --- a/genblog +++ /dev/null @@ -1,51 +0,0 @@ -#!/bin/sh -# -# genblog is a script to take data from my blogs and format it into html for -# my website -# -# by: Squibid -# - -# -# Helper variables and functions -# -bloglist=$(ls -t1 blog/*.html | grep -oP '(?<=\/).*?(?=\.)') -top5=$(printf "$bloglist\n" | head -5) - -blogdate() { - grep -oP '(?<=\<meta name="date" content=").*(?="\>)' "blog/$1.html" -} -blogtitle() { grep -oP '(?<=\<title\>).*(?=\<\/title\>)' "blog/$1.html"; } -htmlline() { - printf "<a href=\"/blog/$1\">\ $(blogtitle $1)</a>\ -<span>$(blogdate $1)</span><br>\n" -} - -# set file dates properly -for i in $bloglist; do - if $(touch -cd "$(blogdate $i)T00:00:00" /tmp/file); then - touch -amt "$(blogdate $i | sed 's/\///g')0000" "blog/$i.html" - fi -done - -# -# Start modifing our files -# - -# delete old bloglist -sed -i -n '1,/.*<!-- b script marker blog -->/p;/.*<!-- e script marker blog -->/,$p' index.html -sed -i -n '1,/.*<!-- b script marker blog -->/p;/.*<!-- e script marker blog -->/,$p' blog.html - -# top 5 blogs -for i in $top5; do - line=$(htmlline $i) - # add new bloglist - sed -i "/.*<!-- e script marker blog -->/i $line" index.html -done - -# generate the full blog list -for i in $bloglist; do - line=$(htmlline $i) - # add new bloglist - sed -i "/.*<!-- e script marker blog -->/i $line" blog.html -done |