Big changes!
- Fixed typo in pinned git repos - Add new pinned repo (wallheaven) - Switch blog generation to php - remove useless symlink in blog/
This commit is contained in:
@ -25,11 +25,18 @@
|
||||
</header>
|
||||
<hr style="color: #f7f7f7;">
|
||||
<p id="bloglist">
|
||||
<!-- b script marker blog -->
|
||||
<a href="/blog/librex-and-dots"> librex and dots</a><span>2023/06/27</span><br>
|
||||
<a href="/blog/It's-Alive!"> It's Alive!</a><span>2023/05/01</span><br>
|
||||
<a href="/blog/state-of-the-site"> state of the site</a><span>2023/03/11</span><br>
|
||||
<!-- e script marker blog -->
|
||||
<?php
|
||||
$path = "blog";
|
||||
$files = scandir($path."/");
|
||||
foreach ($files as $file) {
|
||||
if (preg_match("/.+?(?=\.html|\.php)/", $file, $matches)) {
|
||||
$tags = get_meta_tags($path.'/'.$file);
|
||||
printf('<a href='.$path.'/%s>%s</a><span>%s</span><br>',
|
||||
$matches[0], str_replace("-", " ", $matches[0]),
|
||||
$tags["date"] ? $tags["date"] : "¯\_(ツ)_/¯");
|
||||
}
|
||||
}
|
||||
?>
|
||||
</p>
|
||||
<h2 id="font" style="text-align: center; margin-top: 0;">
|
||||
<a href="/blog/rss.xml", title="rss">subscribe</a>
|
@ -1,6 +1,6 @@
|
||||
<meta name="date" content="2023/05/01">
|
||||
<title>It's Alive!</title>
|
||||
<link rel=stylesheet href=style.css>
|
||||
<link rel=stylesheet href='/style.css'>
|
||||
<body style="background-color: #161617;">
|
||||
<p>
|
||||
Cloning via http(s) now works!
|
||||
|
@ -1,6 +1,6 @@
|
||||
<meta name="date" content="2023/06/27">
|
||||
<title>librex and dots</title>
|
||||
<link rel=stylesheet href=style.css>
|
||||
<link rel=stylesheet href='/style.css'>
|
||||
<body style="background-color: #161617;">
|
||||
<p>
|
||||
Hello!
|
||||
|
@ -11,7 +11,7 @@ filename="$(echo $name | sed 's/ /-/g').html"
|
||||
printf '<!DOCTYPE HTML>
|
||||
<html lang="en">
|
||||
<meta name="date" content="2023/07/15"><title>'$name'</title>
|
||||
<link rel=stylesheet href=style.css>
|
||||
<link rel="stylesheet" href="/style.css">
|
||||
<body style="background-color: #161617;">
|
||||
<p>
|
||||
</p>
|
||||
|
@ -1,6 +1,6 @@
|
||||
<meta name="date" content="2023/03/11">
|
||||
<title>state of the site</title>
|
||||
<link rel="stylesheet" href="style.css">
|
||||
<link rel="stylesheet" href="/style.css">
|
||||
<body style="background-color: #161617;">
|
||||
<p>
|
||||
Hello o/, and welcome to my website!<br>
|
||||
|
@ -1 +0,0 @@
|
||||
../style.css
|
51
genblog
51
genblog
@ -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
|
@ -38,9 +38,13 @@
|
||||
</hgroup>
|
||||
<p>My best repos are</p>
|
||||
<ul>
|
||||
<li><a href="https://git.squi.bid/wallheaven">Wallheaven</a> -
|
||||
A private frontend for wallhaven written in
|
||||
<a href="https://php.net">php</a>!
|
||||
</li>
|
||||
<li><a href="https://git.squi.bid/eat-it">eat it</a> -
|
||||
Eat It is a <a href="https://mpv.io", title="Mpv's Website">Mpv</a>
|
||||
package manager writter in <a href="https://lua.org",
|
||||
package manager written in <a href="https://lua.org",
|
||||
title="Lua's Website">Lua</a> with the intent of making Mpv
|
||||
scripts easier to update and use.</li>
|
||||
<li><a href="https://git.squi.bid/coreutils">coreutils</a> -
|
||||
@ -60,9 +64,22 @@
|
||||
</p>
|
||||
</hgroup>
|
||||
<p id="blogpreview">
|
||||
<!-- b script marker blog -->
|
||||
If this is here I forgot to generate the blog list.
|
||||
<!-- e script marker blog -->
|
||||
<?php
|
||||
$path = "blog";
|
||||
$files = scandir($path."/");
|
||||
$i = 0;
|
||||
foreach ($files as $file) {
|
||||
if (preg_match("/.+?(?=\.html|\.php)/", $file, $matches)) {
|
||||
if ($i > 4)
|
||||
break;
|
||||
$tags = get_meta_tags($path.'/'.$file);
|
||||
printf('<a href='.$path.'/%s>%s</a><span>%s</span><br>',
|
||||
$matches[0], str_replace("-", " ", $matches[0]),
|
||||
$tags["date"] ? $tags["date"] : "¯\_(ツ)_/¯");
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
?>
|
||||
</p>
|
||||
<a href="/blog">more...</a>
|
||||
</div>
|
Reference in New Issue
Block a user