diff options
author | Patryk Niedźwiedziński <pniedzwiedzinski19@gmail.com> | 2021-03-15 17:01:38 +0100 |
---|---|---|
committer | Patryk Niedźwiedziński <pniedzwiedzinski19@gmail.com> | 2021-03-15 17:01:38 +0100 |
commit | 6b920781f70c88a6927532db9403538467d20f92 (patch) | |
tree | 1e7545e2e29c5ac3a0f75317c8bba71d18d70c98 /gen | |
parent | 44c504fe7c804a4c7b21b8a4fa53f211ba4a0b8e (diff) | |
download | kronika-6b920781f70c88a6927532db9403538467d20f92.tar.gz kronika-6b920781f70c88a6927532db9403538467d20f92.zip |
Add latest posts on index.html.raw
Diffstat (limited to 'gen')
-rwxr-xr-x | gen | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/gen b/gen index 8934f2d..7b7c2ba 100755 --- a/gen +++ b/gen @@ -72,6 +72,13 @@ cat > dest/kronika/rss.xml << EOF <lastBuildDate>$(date -R)</lastBuildDate> EOF +cp wpisy/index.html.raw wpisy/index.html +cat >> wpisy/index.html << EOF +<link href="/kronika.css" rel="stylesheet"> +<h2>Ostatnie wpisy z kroniki</h2> +<div class="content post-list"> +EOF + i=0 for f in `find wpisy/kronika/20* -name '*.md' | sort -r`; do path=`echo $f | sed 's/wpisy//;s/.md//'` @@ -83,12 +90,15 @@ for f in `find wpisy/kronika/20* -name '*.md' | sort -r`; do post_link "$path" "$title" "$photo" "$description" >> wpisy/kronika.html [ $i -lt 20 ] && \ post_rss "$path" "$title" "$photo" "$description" "$f" >> dest/kronika/rss.xml - # [ $i -lt 4 ] && \ - # post_link "$path" "$title" "$photo" "$description" >> wpisy/index.md && \ + [ $i -lt 4 ] && \ + post_link "$path" "$title" "$photo" "$description" >> wpisy/index.html && \ i=$(($i+1)) done echo "</div>" >> wpisy/kronika.html +echo "</div><a href=\"/kronika\">Czytaj więcej...</a>" >> wpisy/index.html echo "</channel></rss>" >> dest/kronika/rss.xml ./ssg5 wpisy dest "$TITLE" "$URL" +rm wpisy/index.html +rm dest/index.html.raw cp -r static/* dest |