Skip to content

Commit

Permalink
improve current entry count check, add tasks to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
doneforaiur committed Jul 27, 2023
1 parent 1f470d3 commit 7ec715a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ You can setup `cron` for running `compile.sh` and `rsync` commands which will ge
- [ ] `Recent` section should include only 10 most recent entries. For now it's handled by checking the line count of the generated HTML, which is not ideal.
- [x] `Current` section includes entries based on `_` prefix of the Markdown file, also not good. (done in [fce9acc](https://github.com/doneforaiur/yamb/commit/fce9acca2fa2cbdce26c03b269a52d3e1208eec6))
- [x] Generate pages that are not shown as entries, but standalone articles. `books.html`, `podcasts.html`, etc.
- [ ] `ls -t` and `stat` commands are not ideal since it sorts by modification time, not creation time. `--time=birth` is not available on *all* unix systems. Sorting the files based on the first line of the file which will include the desired date is a better solution. If date not present, take modification time.
- [ ] RSS.
5 changes: 4 additions & 1 deletion compile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ for file in $(ls -t ./entries/standalone/*.md); do
done

# recent and archive entries
index=0
for file in $(ls -tr ./entries/recent/*.md); do
basefilename="$(basename $file)"

Expand All @@ -73,7 +74,7 @@ for file in $(ls -tr ./entries/recent/*.md); do
rm ./tmp/archive_table.html


if [ "$(wc -l < ./tmp/recent.html)" -gt 60 ]; then
if [ $index -gt 9 ]; then
continue
fi

Expand All @@ -84,6 +85,8 @@ for file in $(ls -tr ./entries/recent/*.md); do
sed -i "${insert_line}r ./tmp/recent_table.html" "./tmp/recent.html"

rm ./tmp/recent_table.html

index=$((index+1))
done

for file in $(ls -t ./entries/soon/*.md); do
Expand Down

0 comments on commit 7ec715a

Please sign in to comment.