aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVitali64 <vitali64pmemail@protonmail.com>2021-12-23 19:32:45 +0100
committerVitali64 <vitali64pmemail@protonmail.com>2021-12-23 19:32:45 +0100
commit21270e6fd0890d3f2400d7112381187abd243568 (patch)
tree187ac846a12122a8e59165dd9b72e4a45bc0d239
parent5f1f59214ddafe12906d76ee68a980505e3f69b4 (diff)
downloadseen-21270e6fd0890d3f2400d7112381187abd243568.tar.gz
seen-21270e6fd0890d3f2400d7112381187abd243568.zip
less verbose, please
-rwxr-xr-xrs.sh4
-rwxr-xr-xseen.sh15
2 files changed, 0 insertions, 19 deletions
diff --git a/rs.sh b/rs.sh
index 19255fd..7b5f29a 100755
--- a/rs.sh
+++ b/rs.sh
@@ -37,7 +37,6 @@ rssBlogTitle="blog"
rssBlogDescription="It's a blog"
. "./rss.cfg" # Override the defaults
# Header of the RSS XML file
-echo "-> [$(date +%R)] Inserting XML header ..."
printf '%s\n' '<rss version="2.0">' > "www/rss.xml"
printf '%s\n' '<channel>' >> "www/rss.xml"
printf '%s\n' "<title>${rssBlogTitle}</title>" >> "www/rss.xml"
@@ -56,8 +55,5 @@ do
done
# Footer of the RSS XML file
-echo "-> [$(date +%R)] Inserting XML footer ..."
printf '%s\n' '</channel>' >> "www/rss.xml"
printf '%s\n' '</rss>' >> "www/rss.xml"
-
-echo "-> [$(date +%R)] RSS generation done!"
diff --git a/seen.sh b/seen.sh
index 16bc980..1683bc4 100755
--- a/seen.sh
+++ b/seen.sh
@@ -69,42 +69,30 @@ else
usage
exit 1
fi
-
echo "Copyright (C) 2021 Vitali64 <vitali64pmemail@protonmail.com>"
echo "This program comes with ABSOLUTELY NO WARRANTY."
echo "This is free software, and you are welcome to modify it,"
echo "use it where you see fit, and redistribute it"
echo "under certain conditions; type './seen.sh --license' for details."
-
# Create the www/ folder if removed
mkdir -p "www" || die "Cannot create www/ directory: mkdir -p returns an error!"
-
# Erase www/index.html and insert the header
-echo "-> [$(date +%R)] Inserting the header ..."
cat "templates/header.html" > www/index.html || die "Cannot insert header into index.html!"
-
# Detect articles
-echo "-> [$(date +%R)] Detecting articles' markdown file ..."
articles="$(find articles/*.md|sed -e 's@.md@@g' -e 's@articles/@@g')" || die "Unknown error"
-
# Set the defaults
name="(!) no name (!)"
desc="(!) no description (!)"
date="1st January 1970"
-
# In the 'for' loop
for line in ${articles}
do
. "articles/${line}.cfg" || die "Cannot read ${line}.cfg file!" # Override the defaults
mkdir "www/articles" -p
- echo "-> [$(date +%R)] Inserting header to ${line}.html ..."
cat "templates/header.html" > "www/articles/${line}.html" || die "Cannot insert header into ${line}.html!" # Erase <article>.html and insert the header
- echo "-> [$(date +%R)] Converting ${line}.md to html ..."
markdown "articles/${line}.md" >> "www/articles/${line}.html" || hoedown "articles/${line}.md" >> "www/articles/${line}.html" || die "Cannot convert ${line}.md to html!" # Convert the markdown text to html
- echo "-> [$(date +%R)] Inserting footer to ${line}.html ..."
cat "templates/footer.html" >> "www/articles/${line}.html" || die "Cannot insert footer into ${line}.html!" # Insert the footer into the article page
cp -r templates/*.css www/. # Add css files if present
-
# Add an entry in index.html
echo "-> [$(date +%R)] Adding ${line} entry to index.html ..."
sed \
@@ -116,7 +104,4 @@ do
done
# Insert the footer into the index.html
-echo "-> [$(date +%R)] Inserting the footer ..."
cat "templates/footer.html" >> "www/index.html"
-echo "-> [$(date +%R)] Generation made successfully!"
-echo "Enjoy your blog. Exiting ..."