rewrite site and stop using iframes
This commit is contained in:
25
scripts/genblog
Executable file
25
scripts/genblog
Executable 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
13
scripts/gengit
Executable 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
|
Reference in New Issue
Block a user