Fix date, add nav/footer to blogindex
This commit is contained in:
parent
dcaad8d30a
commit
fa38cb5144
|
@ -15,8 +15,8 @@ HTML_LANG="en_US" # Your document (HTML) language setting
|
||||||
TOC=true
|
TOC=true
|
||||||
SYNTAX=true
|
SYNTAX=true
|
||||||
POSTS_DIR="posts/"
|
POSTS_DIR="posts/"
|
||||||
POSTS=$(find $POSTS_DIR -type f -name *.md)
|
POSTS=$(find $POSTS_DIR -type f)
|
||||||
WEB_HTML="blog/"
|
WEB_HTML="blog/"
|
||||||
OUTPUT="_output/"
|
OUTPUT="_output/"
|
||||||
TIME=$(date +"%T %Z")
|
TIME=$(date -u +"%T %z")
|
||||||
TTL="60"
|
TTL="60"
|
||||||
|
|
3
makefile
3
makefile
|
@ -2,8 +2,11 @@
|
||||||
|
|
||||||
.PHONY: build
|
.PHONY: build
|
||||||
build:
|
build:
|
||||||
|
rm -rf _output
|
||||||
|
mkdir -p _output/blog
|
||||||
bash pblog.sh > _output/blog/feed.xml
|
bash pblog.sh > _output/blog/feed.xml
|
||||||
xsltproc _output/blog/feed.xml > _output/blog/index.html
|
xsltproc _output/blog/feed.xml > _output/blog/index.html
|
||||||
|
bash sed.sh
|
||||||
|
|
||||||
serve: build
|
serve: build
|
||||||
python3 -m http.server --directory _output/
|
python3 -m http.server --directory _output/
|
||||||
|
|
7
pblog.sh
7
pblog.sh
|
@ -1,7 +1,6 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
source _config.sh
|
source _config.sh
|
||||||
|
|
||||||
###################################################################################
|
###################################################################################
|
||||||
# !WARNING!
|
# !WARNING!
|
||||||
# You probably don't need to tweak anything below this line. Edit at your own risk!
|
# You probably don't need to tweak anything below this line. Edit at your own risk!
|
||||||
|
@ -31,8 +30,6 @@ rsync $POSTS_DIR*.html $OUTPUT$WEB_HTML;
|
||||||
rm $POSTS_DIR*.html
|
rm $POSTS_DIR*.html
|
||||||
|
|
||||||
|
|
||||||
# Remove the default blog index to avoid pulling into the XML feed
|
|
||||||
rm $OUTPUT$WEB_HTML/index.html
|
|
||||||
echo "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>
|
echo "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>
|
||||||
<?xml-stylesheet href=\"rss.xsl\" type=\"text/xsl\"?>
|
<?xml-stylesheet href=\"rss.xsl\" type=\"text/xsl\"?>
|
||||||
<rss version=\"2.0\" xmlns:atom=\"http://www.w3.org/2005/Atom\">
|
<rss version=\"2.0\" xmlns:atom=\"http://www.w3.org/2005/Atom\">
|
||||||
|
@ -55,8 +52,8 @@ then
|
||||||
CAT_DATE=$(gdate -d "$(sed -n 's|^<p class="date">\([^<]*\)</p>$|\1|p' $file)" +"%Y/%m/%d/%u")
|
CAT_DATE=$(gdate -d "$(sed -n 's|^<p class="date">\([^<]*\)</p>$|\1|p' $file)" +"%Y/%m/%d/%u")
|
||||||
POST_DATE=$(gdate -d "$(sed -n 's|^<p class="date">\([^<]*\)</p>$|\1|p' $file)" +"%a, %d %b %Y")
|
POST_DATE=$(gdate -d "$(sed -n 's|^<p class="date">\([^<]*\)</p>$|\1|p' $file)" +"%a, %d %b %Y")
|
||||||
else
|
else
|
||||||
CAT_DATE=$(date -d "$(sed -n 's|^<p class="date">\([^<]*\)</p>$|\1|p' $file)" +"%Y/%m/%d/%u")
|
CAT_DATE=$(date -u -d "$(sed -n 's|^<p class="date">\([^<]*\)</p>$|\1|p' $file)" +"%Y/%m/%d/%u")
|
||||||
POST_DATE=$(date -d "$(sed -n 's|^<p class="date">\([^<]*\)</p>$|\1|p' $file)" +"%a, %d %b %Y")
|
POST_DATE=$(date -u -d "$(sed -n 's|^<p class="date">\([^<]*\)</p>$|\1|p' $file)" +"%a, %d %b %Y")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "<item>
|
echo "<item>
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
sed -i -e 's/<header>//' -e 's/<\/header>//' -e 's/<body>/<body>\n<\!--#include file=\"\/nav\"-->\n/' -e 's/<\/body>/<\/body>\n<!--#include file=\"\/footer\"-->\n/' -e 's/..\/..\/style.css/\/blog\/style.css/' _output/blog/index.html
|
||||||
|
sed -i -n '1,/<style>/p;/<\/style>/,$p' _output/blog/index.html
|
||||||
|
|
Loading…
Reference in New Issue