From 19e60630ae89bc0ea771932840f1341d3e3cc9ed Mon Sep 17 00:00:00 2001 From: "Yann Esposito (Yogsototh)" Date: Wed, 27 Nov 2019 19:06:42 +0100 Subject: [PATCH] optim html, minor changes --- mkrss.sh | 3 +++ optim-html.sh | 28 ++++++++++++++++++++++++++++ project.el | 6 ++++-- project.el.sig | Bin 586 -> 586 bytes src/about-me.org | 7 +++++++ src/css/min.css | 4 +++- src/css/mk.css | 4 +++- src/index.org | 4 ++-- src/posts/new-blog.org | 8 ++++---- src/slides.org | 7 +++++++ update-file-size.sh | 2 +- 11 files changed, 62 insertions(+), 11 deletions(-) create mode 100755 optim-html.sh diff --git a/mkrss.sh b/mkrss.sh index 0300467..865b17c 100755 --- a/mkrss.sh +++ b/mkrss.sh @@ -50,6 +50,9 @@ tmpdir=$(mktemp -d) typeset -a dates dates=( ) for fic in $postsdir/**/*.html; do + if echo $fic|egrep -- '-(mk|min|sci|modern).html$'>/dev/null; then + continue + fi postfile="$(echo "$fic"|sed 's#^'$postsdir'/##')" blogfile="$(echo "$fic"|sed 's#^'$webdir'/##')" printf "%-30s" $postfile diff --git a/optim-html.sh b/optim-html.sh new file mode 100755 index 0000000..b689a78 --- /dev/null +++ b/optim-html.sh @@ -0,0 +1,28 @@ +#!/usr/bin/env nix-shell +#!nix-shell -i zsh +#!nix-shell -I nixpkgs="https://github.com/NixOS/nixpkgs/archive/19.09.tar.gz" + +webdir="_site" + +debug () { + print -- $* >/dev/null +} + +type -a filelist +setopt extendedglob +if (($#>0)); then + filelist=( $* ) +else + filelist=( $webdir/**/*.html(.) ) +fi + +tmp=$(mktemp) + +for fic in $filelist; do + if echo $fic|egrep -- '-(mk|min|sci|modern).html$'>/dev/null; then + continue + fi + print -n -- "$fic " + cp $fic $tmp; minify --mime text/html $tmp > $fic + print "[OK]" +done diff --git a/project.el b/project.el index 2c189e5..05ddcfa 100644 --- a/project.el +++ b/project.el @@ -154,12 +154,14 @@ "#+AUTHOR: " author-name "\n" "#+EMAIL: " author-email "\n" "#+DESCRIPTION: " descr "\n" - "@@html:" + "" + "@@html:@@" + "\n\n" (mapconcat (lambda (li) (format "%s" (car li))) (seq-filter #'car (cdr list)) "\n"))) diff --git a/project.el.sig b/project.el.sig index f7513b0a4280b15bcaff69c8b370a6f7636f166b..7cc0736733d56dcdac28d094556b9dec57247a49 100644 GIT binary patch delta 533 zcmV+w0_y$B1j+=EBm%o8ktQI2`Rfn*0uNi<9vTF1FKJxdr3_-^`JVaB2?}|2prNubkQkO&y@?JW}g`f#=paEF_x^v!{v#Q$?@)A&he-tylXE54lG80ol0MWNIr>* z^SkH{ZMkG|D+j74I$~F`bUtbW`M9xiN-jzTJVuTG_tB;CPP&za0!(rcJd&>BH$f+x zUaE-nbM9q`Fk-kGeA@#z@|??}V#k&3fdb&Ej4Op@mRRl*vgF^y^+rD(OM!voXggtoF$Cv-0EV6{O!K$vK+vaG z1QR_nWjX6c&$IaJf5DQa0C{1^BN16o; delta 533 zcmV+w0_y$B1j+=EBm$jOktQI2i~ zWcybL=EW}}kDy{l>m>V>=*GdX4WY!fYew$9$(0=v8P=ks8Z(g_lM3R0N)X*mh!!$# zk{CzHw}O=dNJbwH0W(q=VHGp8>silTpfVA{?2+JUO5)*--FW2#7Op^_gGCaVB% zJWo{L;oGKe_}lvA(gfeN?mqGbBL=qNFPu<7?0P95@*P!K6hyPcS)xS-5IMm67JnJt z3YZhhnESym)jz7rNy8R@Mz8|WR+^+=v&?Nk!@G{UD$GkbFf%qON4|2q+{5rZ8V!BM z;BrTF1-t};XxEW?B;0sQ{~VleqJge2fY1H;i>^>L%%*#NzO7+ zxDv&5Y +Home | +Posts | +Slides | +About +@@ + #+INCLUDE: ../logo-svg.org #+begin_notes diff --git a/src/css/min.css b/src/css/min.css index f16a21b..0035c8d 100644 --- a/src/css/min.css +++ b/src/css/min.css @@ -238,6 +238,9 @@ figure, .figure { #h { float: left; } +.main { + padding-top: 1em; +} #labels { width: 100%; text-align: right; @@ -495,7 +498,6 @@ figure, .figure { body,.main { background: var(--bg); color: var(--fg); - min-height: 100vh; } ::selection, .main ::selection, ::-moz-selection, .main ::-moz-selection { diff --git a/src/css/mk.css b/src/css/mk.css index fb511fe..daa4d03 100644 --- a/src/css/mk.css +++ b/src/css/mk.css @@ -282,10 +282,12 @@ figure, .figure { #h { float: left; } +.main { + padding-top: 1em; +} #labels { width: 100%; text-align: right; - margin-bottom: 1em; } #labels label { text-decoration: underline; diff --git a/src/index.org b/src/index.org index 345d57e..e0eae29 100644 --- a/src/index.org +++ b/src/index.org @@ -8,12 +8,12 @@ #+OPTIONS: H:5 #+STARTUP: showeverything -@@html: +@@html:@@ #+INCLUDE: ../logo-svg.org diff --git a/src/posts/new-blog.org b/src/posts/new-blog.org index d5c85cf..403a2a7 100644 --- a/src/posts/new-blog.org +++ b/src/posts/new-blog.org @@ -354,7 +354,7 @@ date, etc... (defun menu (lst) "Blog menu" (concat - "" + "")) (defun get-from-info (info k) (let ((i (car (plist-get info k)))) @@ -570,7 +570,7 @@ Here is the full code: (defun menu (lst) "Blog menu" (concat - "" + "")) (defun get-from-info (info k) (let ((i (car (plist-get info k)))) diff --git a/src/slides.org b/src/slides.org index 7fee4bc..4573e22 100644 --- a/src/slides.org +++ b/src/slides.org @@ -8,6 +8,13 @@ #+OPTIONS: H:5 #+STARTUP: showeverything +@@html:@@ + * English - [2018-10-25 Thu] [[file:slides/git-project-manager.org][Git Project Manager]] is a talk I made for the "Commission Open Source" diff --git a/update-file-size.sh b/update-file-size.sh index e1cdc83..65171a2 100755 --- a/update-file-size.sh +++ b/update-file-size.sh @@ -57,6 +57,6 @@ for fic in $filelist; do total=$(( htmlsize + imgsize + csssize )) sizeinfos=$(print -- "Size: $(toh $total) (HTML: $(toh $htmlsize), CSS: $(toh $csssize), IMG: $(toh $imgsize))") print -- $sizeinfos - perl -pi -e 's#(
)[^<]*(
)#$1'"$sizeinfos"'$2#' $fic + perl -pi -e 's#(
)[^<]*(
)#$1'"$sizeinfos"'$2#' $fic done rm -rf $tmpdir