hscc

Soure code of <https://hugo.soucy.cc>.
git clone git://soucy.cc/hscc.git
Log | Files | Refs

commit 2c1583ec6648732007a0268a2cc333468ec5e3c6
parent 56ddefca3c861dbbc20f4d3eb5446fe1cc19dfcb
Author: Hugo Soucy <hugo@soucy.cc>
Date:   Thu, 17 Mar 2022 15:43:26 -0400

Add a while loop for modular css

Diffstat:
Msrc/css/css.sh | 26+++++++++++++++++---------
1 file changed, 17 insertions(+), 9 deletions(-)

diff --git a/src/css/css.sh b/src/css/css.sh @@ -4,7 +4,7 @@ dst="../../public_html/css/" -# Top bundle +# Top bundle loop # Return top.min.css in $dst while read -r line; do [ -n "$line" ] && cat "./$line" @@ -27,7 +27,7 @@ modules/hentry.css modules/xfn.css EOF -# Bottom bundle +# Bottom bundle loop # Return bottom.min.css in $dst while read -r line; do [ -n "$line" ] && cat "./$line" @@ -37,12 +37,20 @@ modules/nav.css modules/footer-banner.css EOF -# Modular -cssmin modules/hcard.css > "${dst}hcard.min.css" -cssmin modules/hfeed.css > "${dst}hfeed.min.css" -cssmin modules/hresume.css > "${dst}hresume.min.css" -cssmin modules/archives.css > "${dst}archives.min.css" -cssmin modules/tags.css > "${dst}tags.min.css" -cssmin print.css > "${dst}print.min.css" +# Modular loop +# Return minified CSS separately +while read -r line; do + dstname=$(basename "$line" .css) # basename without the .css extension + + [ -n "$line" ] && cssmin "./$line" > "${dst}$dstname.min.css" +done <<-EOF +modules/hcard.css +modules/hfeed.css +modules/nav-pagination.css +modules/hresume.css +modules/archives.css +modules/tags.css +print.css +EOF echo "CSS builded! @ $(date +"%Y-%m-%d %T")"