Created build script for creating pages with templates
This commit is contained in:
12
blog.sh
12
blog.sh
@@ -2,7 +2,7 @@
|
||||
|
||||
# Site specific settings
|
||||
DOMAIN="https://iiogama.0x212.com"
|
||||
TITLE="Just some dude creating things"
|
||||
TITLE="Some dude doing stuff"
|
||||
DESCRIPTION="iiogama@0x212.com"
|
||||
COPYRIGHT="Copyright $(date +%Y), Thai Noodles"
|
||||
AUTHOR="Thai Noodles, (iiogama@0x212.com)"
|
||||
@@ -41,19 +41,19 @@ function build_feed() {
|
||||
<copyright>$COPYRIGHT</copyright>
|
||||
<ttl>$TTL</ttl>" >> "$OUTPUT_DIR/$FEED_FILE"
|
||||
find $OUTPUT_DIR/$BLOG_DIR -type f -name "*.html" | while read file; do
|
||||
POST_DATE="$(date -d "$(sed -n 's|^<p class="date">\([^<]*\)</p>$|\1|p' $file)" +"%a, %d %b %Y %H:%M:%S")"
|
||||
CAT_DATE="$(date -d "$(sed -n 's|^<p class="date">\([^<]*\)</p>$|\1|p' $file)" +"%Y/%m/%d/%u")"
|
||||
POST_TITLE="$(sed -n 's|^<h1 class="title">\([^<]*\)</h1>$|\1|p' $file)"
|
||||
POST_DATE="$(date -d "$(sed -n 's|<p class="date">\([^<]*\)</p>$|\1|p' $file)" +"%a, %d %b %Y %H:%M:%S")"
|
||||
CAT_DATE="$(date -d "$(sed -n 's|<p class="date">\([^<]*\)</p>$|\1|p' $file)" +"%Y/%m/%d/%u")"
|
||||
POST_TITLE="$(sed -n 's|<h1 class="title">\([^<]*\)</h1>$|\1|p' $file)"
|
||||
POST_CONTENT="$(sed -n '/<article>/,/<\/article>/p' $file | sed -e '1s/.*<article>//' -e '$s/<\/article>.*//')"
|
||||
echo "
|
||||
<item>
|
||||
<pubDate>$POST_DATE PST</pubDate>
|
||||
<category>$CAT_DATE</category>
|
||||
<title>$POST_TITLE</title>
|
||||
<link>$DOMAIN/$BLOG_DIR$(basename ${file})</link>
|
||||
<link>$DOMAIN/$BLOG_DIR/$(basename ${file})</link>
|
||||
<description><![CDATA[$POST_CONTENT]]></description>
|
||||
<author>$AUTHOR</author>
|
||||
<guid>$DOMAIN/$BLOG_DIR$(basename ${file})</guid>
|
||||
<guid>$DOMAIN/$BLOG_DIR/$(basename ${file})</guid>
|
||||
</item>" >> "$OUTPUT_DIR/$FEED_FILE"
|
||||
done
|
||||
echo "</channel>
|
||||
|
||||
4
justfile
4
justfile
@@ -4,7 +4,7 @@ default: project-name
|
||||
project-name:
|
||||
@echo "iiogama.0x212.com Website"
|
||||
|
||||
build:
|
||||
build:
|
||||
sh ./blog.sh build
|
||||
|
||||
serve:
|
||||
@@ -14,4 +14,4 @@ deploy:
|
||||
rclone sync ./_output/ iiogama.0x212.com:public/
|
||||
|
||||
clean:
|
||||
rm -r _output/* && rmdir _output/
|
||||
mkdir -p _output/ && rm -r _output/* && rmdir _output/
|
||||
|
||||
Reference in New Issue
Block a user