removed .html at end of posts urls

This patch removes the ugly urls that were generated previously, now you
can generate nice urls that don't end with the fileformat, so it looks
kinda nice!
This commit is contained in:
joelchrono12 2022-01-14 20:03:47 -06:00
parent 883f94892c
commit b1858ac38f
1 changed files with 2 additions and 2 deletions

4
blop
View File

@ -20,7 +20,7 @@ max_posts="10" # number of posts to list on the blog index, posts beyond this wi
group_by_date=false # whether to group the main listing on the blog's index by dates group_by_date=false # whether to group the main listing on the blog's index by dates
date_format="%B %-d, %Y" date_format="%B %-d, %Y"
short_date_format="%B, %Y" # format for date grouping in the archive and optionally on the index (see group_by_date above) short_date_format="%B, %Y" # format for date grouping in the archive and optionally on the index (see group_by_date above)
listing_format="<a href=\"posts/<!--title-nospaces-->./\"><!--title--></a> by <!--author--> on <!--date-->" # rejig this and/or remove elements to taste. You may need to change delimeter when sed is used on this later if any of the fields contain slashes listing_format="<a href=\"posts/<!--title-nospaces-->/\"><!--title--></a> by <!--author--> on <!--date-->" # rejig this and/or remove elements to taste. You may need to change delimeter when sed is used on this later if any of the fields contain slashes
####################### #######################
@ -147,7 +147,7 @@ for file in $(ls -t1 "$blogdir/markdown/"*.md); do
archivelist="$archivelist<li>$listitem</li>\n" archivelist="$archivelist<li>$listitem</li>\n"
old_short_date=$short_date old_short_date=$short_date
sed -e "/<!--post-->/r $temp/post" -e '/<!--post-->/d' -e "s/<!--author-->/$author/g" -e "s/<!--date-->/$date/g" -e "s/<!--title-->/$title/g" "$blogdir/post_template.html" > "$blogdir/posts/$title_nospaces.html" sed -e "/<!--post-->/r $temp/post" -e '/<!--post-->/d' -e "s/<!--author-->/$author/g" -e "s/<!--date-->/$date/g" -e "s/<!--title-->/$title/g" "$blogdir/post_template.html" > "$blogdir/posts/$title_nospaces/index.html"
# prepare rss # prepare rss
echo -e "<item>\n<title>$title</title>\n<guid>$url/posts/$title_nospaces/</guid>\n<pubDate>$rssdate</pubDate><description><![CDATA[$(cat $temp/post)]]></description>\n</item>\n\n" >> $temp/rss echo -e "<item>\n<title>$title</title>\n<guid>$url/posts/$title_nospaces/</guid>\n<pubDate>$rssdate</pubDate><description><![CDATA[$(cat $temp/post)]]></description>\n</item>\n\n" >> $temp/rss
done done