Summary Files Commits Branches @commit @diff @stats
diff options
context:
space:
mode:
Commitc58be73d744d6bb8727858cf89a436d9c2a9f24a (patch)
Author
 Syndamia <kamen.d.mladenov@protonmail.com>
2021-06-19 12:17:17 +0300
Committer
 Syndamia <kamen.d.mladenov@protonmail.com>
2021-06-19 12:17:17 +0300
Files389604285bd73fdb6aa9b04a76a7be1f005a8886
syndamia.com-c58be73d744d6bb8727858cf89a436d9c2a9f24a.tar
syndamia.com-c58be73d744d6bb8727858cf89a436d9c2a9f24a.tar.gz
syndamia.com-c58be73d744d6bb8727858cf89a436d9c2a9f24a.zip
Parent48df2e3f4577d1f33768790ace58c51188091c92 (diff)
Updated make-description script to now always add three dots at the end
1 files changed, 4 insertions, 2 deletions
-rwxr-xr-xmake-descriptions.sh6
diff --git a/make-descriptions.sh b/make-descriptions.sh
index 90e34e2..49417f5 100755
--- a/make-descriptions.sh
+++ b/make-descriptions.sh
@@ -13,8 +13,10 @@ for file in $(find "$1" -type f -name "*.html"); do
# take all lines that aren't blank
description=$(egrep -o "p>(.+)<\/p" $file | sed "s/p>\|<\/p//g" | sed "s/<.*//g" | grep .)
- # Get the first 200 characters
- description="${description::200}..."
+ # Get the first 200 characters only when it's longer than 200 characters
+ if [ ${#description} -gt 200 ]; then
+ description="${description::200}..."
+ fi
# Escape all non-acceptable characters (thanks https://www.unix.com/302989284-post3.html)
description=$(echo $description | sed 's/[^a-zA-Z 0-9]/\\&/g')