rewrite site and stop using iframes

This commit is contained in:
2023-03-11 12:41:48 -05:00
parent 53ba59c39d
commit 721630bec0
13 changed files with 102 additions and 32 deletions

29
blog.html Normal file
View File

@ -0,0 +1,29 @@
<!DOCTYPE HTML>
<html lang="en">
<head>
<title>Squibid's Blog</title>
<link rel="stylesheet" href="style.css">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<style type="text/css">
p {
font-size: 2.5vw;
}
#date {
font-size: 1.5vw;
float: right;
color: white;
}
</style>
<body>
<div class="master">
<header>
<h1 id="font"><span style="color: #ED8182;">Squibid's</span> Blog</h1>
</header>
<hr style="color: #f7f7f7;">
<p> <!-- script marker blog -->
</p> <!-- script marker blog -->
</div>
</body>
</html>

View File

View File

@ -5,3 +5,16 @@ html {
font-size: 2vh; font-size: 2vh;
color: white; color: white;
} }
a:link, a:visited {
background-color: #f44336;
color: white;
padding: 1px 1px;
text-align: center;
text-decoration: none;
display: inline-block;
}
a:hover, a:active {
background-color: red;
}

View File

@ -1,3 +0,0 @@
<p style="font-family: sans-serif; color: white;">
2023 Mar 10 - <a href="https://squi.bid/blog/state-of-the-site.html" target="top" id="link">state-of-the-site</a><br>
</p>

4
gen Executable file
View File

@ -0,0 +1,4 @@
#!/bin/sh
./scripts/gengit
./scripts/genblog

15
genblog
View File

@ -1,15 +0,0 @@
#!/bin/sh
blogs=$(ls -ct1 blog/*.html)
date() {
ls -ct1l --time-style=+'%Y %b %d' $1 | cut -d ' ' -f 6-8
}
[ -f bloglist.html ] && rm bloglist.html
echo '<p style="font-family: sans-serif; color: white;">' >> bloglist.html
[ "$blogs" ] || echo "No blogs yet :)" >> bloglist.html
for i in $blogs; do
name=$(echo $i | sed 's/blog\///' | sed 's/\..*//')
echo $(date $i)" - <a href=\"https://squi.bid/$i\" target=\"top\" id=\"link\">$name</a><br>" >> bloglist.html
done
echo '</p>' >> bloglist.html

View File

@ -9,7 +9,7 @@
<body> <body>
<div class="master"> <div class="master">
<header> <header>
<h1 id="font">Squibid's<br>Website!</h1> <h1 id="font"><span style="color: #ED8182;">Squibid's</span> Website</h1>
</header> </header>
<hr style="color: #f7f7f7;"> <hr style="color: #f7f7f7;">
<div id="left"> <div id="left">
@ -19,12 +19,15 @@
interesting along with some of my personal interesting along with some of my personal
projects and a blog. </p> projects and a blog. </p>
<h2 id="font">🌐 Git Repos</h2> <h2 id="font">🌐 Git Repos</h2>
<a href="https://git.squi.bid">git site</a> <p> <!-- script marker git -->
<object type="text/html" data="gitlist.html"></object> </p> <!-- script marker git -->
<a href="https://git.squi.bid">more...</a>
</div> </div>
<div id="right"> <div id="right">
<h2 id="font">📖 My Blog</h2> <h2 id="font">📚 My Blog</h2>
<object type="text/html" data="bloglist.html"></object> <p> <!-- script marker blog -->
</p> <!-- script marker blog -->
<a href="blog">more...</a>
</div> </div>
</div> </div>
</body> </body>

BIN
pics/globe.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

BIN
pics/open-book.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

BIN
pics/waving.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

25
scripts/genblog Executable file
View File

@ -0,0 +1,25 @@
#!/bin/sh
blogs=$(ls -ct1 blog/*.html)
blogs5=$(ls -ct1 blog/*.html | head -5)
date() {
ls -ct1l --time-style=+'%Y %b %d' $1 | cut -d ' ' -f 6-8
}
# delete old bloglist
sed -i -n '1,/ <p> <!-- script marker blog -->/p;/ <\/p> <!-- script marker blog -->/,$p' index.html
sed -i -n '1,/ <p> <!-- script marker blog -->/p;/ <\/p> <!-- script marker blog -->/,$p' blog.html
# top 5 blogs
for i in $blogs5; do
name=$(echo $i | sed 's/blog\///' | sed 's/\..*//' | sed 's/-/ /g')
line="<a href=\"https://squi.bid/$(echo $i | sed 's/\.html//')\">$name</a> [$(date $i)]<br>"
# add new bloglist
sed -i "/\ <\/p> <!-- script marker blog -->/i $line" index.html
done
# full blog
for i in $blogs; do
name=$(echo $i | sed 's/blog\///' | sed 's/\..*//' | sed 's/-/ /g')
line="<a href=\"https://squi.bid/$(echo $i | sed 's/\.html//')\">$name<span id=\"date\">$(date $i)</span></a><br>"
# add new bloglist
sed -i "/ <\/p> <!-- script marker blog -->/i $line" blog.html
done

13
scripts/gengit Executable file
View File

@ -0,0 +1,13 @@
#!/bin/sh
repos=$(ls -1 /var/git | grep -o '.*\.git' | head -5)
# delete old list
sed -i -n '1,/ <p> <!-- script marker git -->/p;/ <\/p> <!-- script marker git -->/,$p' index.html
for i in $repos ; do
name=$(echo $i | sed 's/\.git//')
line="<a href=\"https://git.squi.bid/$name\" target=\"top\" id=\"link\">$name</a><br>"
# add new repo
sed -i "/ <\/p> <!-- script marker git -->/i $line" index.html
done

View File

@ -1,18 +1,15 @@
html, body { html, body {
background-color: #A9454A; background-color: #141414;
display: flex; display: flex;
justify-content: center; justify-content: center;
} }
.master { .master {
background-color: #141414;
border: 1vw solid #141414;
position: absolute; position: absolute;
width: 50%; width: 50%;
height: 100vh;
} }
header { header {
text-align: center; text-align: center;
font-size: 1.7vw; font-size: 3.5vh;
} }
#profile { #profile {
vertical-align: middle; vertical-align: middle;
@ -22,10 +19,6 @@ header {
font-family: sans-serif; font-family: sans-serif;
color: white; color: white;
} }
#link {
font-family: sans-serif;
color: white;
}
#left { #left {
float: left; float: left;
text-align: left; text-align: left;
@ -36,3 +29,11 @@ header {
text-align: right; text-align: right;
width: 50%; width: 50%;
} }
a {
font-family: sans-serif;
text-decoration: none;
color: #ED8182;
}
a:hover, a:active {
font-style: italic;
}