aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVitali64 <vitali64pmemail@protonmail.com>2021-12-23 19:56:10 +0100
committerVitali64 <vitali64pmemail@protonmail.com>2021-12-23 19:56:10 +0100
commit1c8799a5dc7635fdeea9ea2b17c3a45ecb5c538f (patch)
tree8712709444cc5c9d234b1ab49b55507a2e039ff0
parent4a97fe1d54100b43a0bea4354d8731dcd161322f (diff)
downloadseen-1c8799a5dc7635fdeea9ea2b17c3a45ecb5c538f.tar.gz
seen-1c8799a5dc7635fdeea9ea2b17c3a45ecb5c538f.zip
Remove unnecessary newlines
-rwxr-xr-xrs.sh8
-rwxr-xr-xseen.sh5
2 files changed, 0 insertions, 13 deletions
diff --git a/rs.sh b/rs.sh
index e3b3f33..d037cc8 100755
--- a/rs.sh
+++ b/rs.sh
@@ -1,6 +1,5 @@
#!/bin/sh
# Seen, a simple static blog generator
-#
# Copyright (C) 2021 Vitali64 <vitali64pmemail@protonmail.com>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -12,19 +11,14 @@
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
-
die() {
echo "-> [$(date +%R)] (!) ERROR: Unexpected error, please report : $1 (!)"
exit 1
}
-
# Articles
articles="$(find articles/*.md|sed -e 's@.md@@g' -e 's@articles/@@g')" || die "Unknown error"
-
echo "-> [$(date +%R)] Generating RSS feed ..."
-
touch "www/rss.xml"
-
# Set the defaults
rssBlogTitle="blog"
rssBlogDescription="It's a blog"
@@ -35,7 +29,6 @@ printf '%s\n' '<channel>' >> "www/rss.xml"
printf '%s\n' "<title>${rssBlogTitle}</title>" >> "www/rss.xml"
printf '%s\n' "<link>BLANK</link>" >> "www/rss.xml"
printf '%s\n' "<description>$rssBlogDescription</description>" >> "www/rss.xml"
-
# Items
for line in ${articles}
do
@@ -46,7 +39,6 @@ do
printf '%s\n' "<description>$(cat articles/${line}.md)</description>" >> "www/rss.xml"
printf '%s\n' '</item>' >> "www/rss.xml"
done
-
# Footer of the RSS XML file
printf '%s\n' '</channel>' >> "www/rss.xml"
printf '%s\n' '</rss>' >> "www/rss.xml"
diff --git a/seen.sh b/seen.sh
index d2bf94c..5653dd7 100755
--- a/seen.sh
+++ b/seen.sh
@@ -11,7 +11,6 @@
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
-
usage() {
echo "Usage : ./seen [OPTIONS]"
echo "--help : Print this help message"
@@ -19,14 +18,11 @@ usage() {
echo "--license : Show license"
echo "--rss : Create an RSS feed (runs ./rs.sh)"
}
-
die() {
echo "-> [$(date +%R)] (!) ERROR: Unexpected error, please report : $1 (!)"
exit 1
}
-
echo "Seen, a simple static blog generator"
-
if [ "$1" = "--clear" ]; then
echo "-> [$(date +%R)] Deleting generated blog ..."
rm -Rf www/* || die "Cannot delete generated blog!"
@@ -77,6 +73,5 @@ do
-e "s@description-of-article@${desc}@" \
"templates/article.html">> "www/index.html" || die "Cannot add entry to index.html!"
done
-
# Insert the footer into the index.html
cat "templates/footer.html" >> "www/index.html"