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>
|
||||
|
||||
Reference in New Issue
Block a user