aboutsummaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorCem Keylan <cem@ckyln.com>2020-04-13 02:24:42 +0300
committerCem Keylan <cem@ckyln.com>2020-04-13 02:24:42 +0300
commit14d6f10d8a795db06c2b74b655f287dfdb35e8b7 (patch)
treea9175c49a76ee47b955c34d15e1d53d564121b2c /build
parentdc325ab967af67851a6abc5f13aabf69c2850033 (diff)
downloadwebsite-14d6f10d8a795db06c2b74b655f287dfdb35e8b7.tar.gz
update
Diffstat (limited to 'build')
-rwxr-xr-xbuild10
1 files changed, 7 insertions, 3 deletions
diff --git a/build b/build
index bf2e458..8b6c882 100755
--- a/build
+++ b/build
@@ -90,12 +90,16 @@ EOF
site_index() {
cp index/index.md src/index.md
- find index -name '*.news' | sort -r | sed 3q | while read -r news ; do
+ :> src/news.md
+ # find index -name '*.news' | sort -r | sed 3q | while read -r news ; do
+ # shellcheck disable=2046
+ set -- $(find index -name '*.news' | sort -r)
+ for news in "$1" "$2" "$3" ; do
newsdate="${news##*/}" ; newsdate="${newsdate%.news}"
- printf '\n%s\n-----------\n\n' "$(date --date="$newsdate" +%b\ %d\ %Y)" >> src/index.md
+ printf '\n### %s\n\n' "$(date --date="$newsdate" +%b\ %d\ %Y)" >> src/index.md
cat "$news" >> src/index.md
done
- find index -name '*.news' | sort -r | while read -r news ; do
+ for news; do
newsdate="${news##*/}" ; newsdate="${newsdate%.news}"
printf '\n%s\n-----------\n\n' "$(date --date="$newsdate" +%b\ %d\ %Y)" >> src/news.md
cat "$news" >> src/news.md