diff --git a/engine/update-file-size.sh b/engine/update-file-size.sh index b0ce241..341ea88 100755 --- a/engine/update-file-size.sh +++ b/engine/update-file-size.sh @@ -31,6 +31,9 @@ for fic in $filelist; do htmlsize=$(sizeof $fic) debug HTML: $htmlsize + + gzhtmlsize=$( gzip -c $fic|wc -c ) + debug GZHTML: $gzhtmlsize xfic=$tmpdir/$fic mkdir -p $(dirname $xfic) @@ -49,21 +52,29 @@ for fic in $filelist; do css=( $( < $xfic hxselect -i -c -s '\n' 'link[rel=stylesheet]::attr(href)')) csssize=0 + gzcsssize=0 for i in $css; do isize=$( sizeof $webdir/$i ) + gzisize=$( gzip -c $webdir/$i | wc -c ) debug $i '=>' $isize (( csssize += isize )) + (( gzcsssize += gzisize )) done debug CSS: $csssize + debug GZCSS: $gzcsssize total=$(( htmlsize + imgsize + csssize )) + gztotal=$(( gzhtmlsize + imgsize + gzcsssize )) # the space is important before the toh total sizeinfos=$(print -- " $(toh $total) (html $(toh $htmlsize), css $(toh $csssize)") + gzsizeinfos=$(print -- " $(toh $gztotal) (html $(toh $gzhtmlsize), css $(toh $gzcsssize)") if ((imgsize>0)); then sizeinfos="$sizeinfos, img $(toh $imgsize))" + gzsizeinfos="$gzsizeinfos, img $(toh $imgsize))" else sizeinfos="$sizeinfos)" + gzsizeinfos="$gzsizeinfos)" fi print -- $sizeinfos - perl -pi -e 's#(
)[^<]*(
)#$1'"$sizeinfos"'$2#' $fic + perl -pi -e 's#(
)[^<]*(
)#$1'"$sizeinfos"'$2#;s#(
)[^<]*(
)#$1'"$gzsizeinfos"'$2#' $fic done rm -rf $tmpdir diff --git a/project.el b/project.el index 34d55e1..b9a2a8e 100644 --- a/project.el +++ b/project.el @@ -171,7 +171,9 @@ (format "
%s
" (format-time-string "%Y-%m-%d %H:%M:%S"))) (size - "
XXK (HTML: XXK, CSS: XXK, IMG: XXK)
") + "
XXK (html XXK, css XXK, img XXK)
") + (gzsize + "
XXK (html XXK, css XXK, img XXK)
") (generated-with (format (concat "
" "Emacs %s, " @@ -195,6 +197,7 @@ ("tags" . ,keywords) ("rss" . ,rss) ("size" . ,size) + ("gz" . ,gzsize) ("gen-date" . ,generated-date) ("get-with" . ,generated-with) ("src" . ,website-code) diff --git a/project.el.sig b/project.el.sig index 5b4f1b2..b1d3f50 100644 Binary files a/project.el.sig and b/project.el.sig differ