hscc

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

commit 202b36b9b2be65a471d858eeb9c2453d4c6b0cf2
parent ac98c52002f56abc334895c538153c3814334614
Author: Hugo Soucy <hugo@soucy.cc>
Date:   Tue,  8 Feb 2022 20:02:13 -0500

A CSS shell script test

Diffstat:
Asrc/css/css_test.sh | 66++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 66 insertions(+), 0 deletions(-)

diff --git a/src/css/css_test.sh b/src/css/css_test.sh @@ -0,0 +1,66 @@ +#!/bin/sh +# You can use it with entr to rebuild on change: +# find . | entr -d ./css.sh + +# CSS destination path +dst="../../public_html/css/" + +# Global CSS +while read -r line; do + [ -n "$line" ] && cat "./$line" +done <<-EOF | cat #> "${dst}global.css" +global/tokens/typography.css +global/tokens/colors.css +global/tokens/grid.css +global/base.css +global/a11y.css + +atoms/typography/titles.css +atoms/typography/quotes.css +atoms/buttons/button.css +EOF + +# Top CSS +while read -r line; do + [ -n "$line" ] && cat "./$line" +done <<-EOF > "${dst}top.css" +modules/header-banner.css +modules/go-to.css +modules/hcard.css +EOF + +# Middle CSS +while read -r line; do + [ -n "$line" ] && cat "./$line" +done <<-EOF > "${dst}middle.css" +modules/main.css +modules/hentry.css +modules/webmentions.css +EOF + +# Bottom CSS +while read -r line; do + [ -n "$line" ] && cat "./$line" +done <<-EOF > "${dst}bottom.css" +modules/nav.css +modules/footer-banner.css +EOF + +# Page specific CSS +while read -r line; do + [ -n "$line" ] && cp "./$line" "$dst" +done <<-EOF +modules/hfeed.css +modules/archives.css +modules/hresume.css +modules/xfn.css +modules/tags.css +print.css +EOF + +# Minified all CSS +#find "$dst" -type f \( -name "*.css" \! -name "*.min.css" \) | while IFS="" read -r CSS; do echo "$CSS" done +# cssmin "${dst}index.css" > "${dst}index.min.css" +# cssmin "${dst}print.css" > "${dst}print.min.css" + +echo "CSS builded! @ $(date +"%Y-%m-%d %T")"