diff --git a/compresscss.sh b/compresscss.sh new file mode 100755 index 0000000..1e29259 --- /dev/null +++ b/compresscss.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env nix-shell +#!nix-shell -i zsh +#!nix-shell -I nixpkgs="https://github.com/NixOS/nixpkgs/archive/19.09.tar.gz" +#!nix-shell -p minify + +minify $1 > $2 diff --git a/mkrss.sh b/mkrss.sh index 8507107..0300467 100755 --- a/mkrss.sh +++ b/mkrss.sh @@ -1,5 +1,6 @@ #!/usr/bin/env nix-shell #!nix-shell -i zsh +#!nix-shell -I nixpkgs="https://github.com/NixOS/nixpkgs/archive/19.09.tar.gz" # Directory webdir="_site" diff --git a/project.el b/project.el index b9da87d..838b4a1 100644 --- a/project.el +++ b/project.el @@ -1,8 +1,9 @@ ;; sign it with ;; gpg --local-user yann@esposito.host --output project.el.sig --detach-sign project.el (defvar domainname "https://her.esy.fun") -(defvar base-dir (concat (projectile-project-root) "src")) -(defvar publish-dir (concat (projectile-project-root) "_site")) +(defvar root-dir (projectile-project-root)) +(defvar base-dir (concat root-dir "src")) +(defvar publish-dir (concat root-dir "_site")) (defvar assets-dir (concat base-dir "/")) (defvar publish-assets-dir (concat publish-dir "/")) (defvar posts-dir (concat base-dir "/posts")) @@ -215,11 +216,13 @@ Return output file name." (or (equal (expand-file-name (file-name-directory filename)) (file-name-as-directory (expand-file-name pub-dir))) (let ((dst-file (expand-file-name (file-name-nondirectory filename) pub-dir))) - (if (string-match-p ".*\\.\\(png\\|jpg\\|gif\\)$" filename) - (shell-command (format "~/.nix-profile/bin/convert %s -resize 800x800\\> +dither -colors 16 -depth 4 %s" - filename - dst-file)) - (copy-file filename dst-file t))))) + (cond ((string-match-p ".*\\.\\(png\\|jpg\\|gif\\)$" filename) + (shell-command (format "~/.nix-profile/bin/convert %s -resize 800x800\\> +dither -colors 16 -depth 4 %s" + filename + dst-file))) + ((string-match-p ".*\\.css$" filename) + (shell-command (format "%s/compresscss.sh %s %s" root-dir filename dst-file))) + (t (copy-file filename dst-file t)))))) (defalias 'org-blog-posts-sitemap-fn (apply-partially 'org-blog-sitemap-fn-descr posts-descr)) diff --git a/project.el.sig b/project.el.sig index 2fd27c4..e91dd64 100644 Binary files a/project.el.sig and b/project.el.sig differ diff --git a/src/css/minimalist.css b/src/css/minimalist.css index fd92941..7072fe7 100644 --- a/src/css/minimalist.css +++ b/src/css/minimalist.css @@ -333,6 +333,21 @@ navigation > a { font-style: italic; } +/* Dark themes soften and darken images */ +img { + filter: saturate(0.8) brightness(0.8); +} +/* Light themes does not soften and darken images */ +input#light:checked ~ .main img, +input#light:target ~ .main img, +input#simple:checked ~ .main img, +input#simple:target ~ .main img, +input#modern:checked ~ .main img, +input#modern:target ~ .main img { + filter: none; +} + +/* --------------------------------------------------------------------------- */ /* Dark theme selected */ input#dark:checked ~ .main , input#dark:target ~ .main { @@ -352,7 +367,13 @@ input#dark:target ~ .main { --color-h6: var(--reveal-foreground); --color-link: var(--green); } +input#dark:checked ~ #labels , +input#dark:target ~ #labels { + background: var(--base03); + color: var(--base0); +} +/* --------------------------------------------------------------------------- */ /* Light theme selected */ input#light:checked ~ .main , input#light:target ~ .main { @@ -378,24 +399,7 @@ input#light:target ~ #labels { color: var(--base00); } -/* Dark theme selected */ -input#dark:checked ~ .main , -input#dark:target ~ .main { - --main-background: var(--base03); - --main-foreground: var(--base0); - --second-foreground: var(--base01); - --reveal-foreground: var(--base1); - --reveal-background: var(--base02); - --soft-foreground: var(--base01); - --border-color: var(--base02); - --todo-txt: #000; -} -input#dark:checked ~ #labels , -input#dark:target ~ #labels { - background: var(--base03); - color: var(--base0); -} - +/* --------------------------------------------------------------------------- */ /* Light simple theme selected */ input#simple:checked ~ .main , input#simple:target ~ .main { @@ -443,6 +447,41 @@ input#simple:target ~ .main pre { font-family: monospace; } + +/* --------------------------------------------------------------------------- */ +/* Dark matrix theme selected */ +input#matrix:checked ~ .main , +input#matrix:target ~ .main { + --main-background: #000; + --main-foreground: #0b0; + --second-foreground: #080; + --reveal-foreground: #0f0; + --reveal-background: #000; + --soft-foreground: #080; + --border-color: #080; + --todo-txt: #0b0; + --color-h1: #0b0; + --color-h2: #0b0; + --color-h3: #0b0; + --color-h4: #0b0; + --color-h5: #0b0; + --color-h6: #0b0; + --color-link: #080; + font-family: monospace; +} +input#matrix:checked ~ #labels , +input#matrix:target ~ #labels { + background: #000; + color: #0b0; +} +input#matrix:checked ~ .main code, +input#matrix:target ~ .main code, +input#matrix:checked ~ .main pre , +input#matrix:target ~ .main pre { + font-family: monospace; +} + +/* --------------------------------------------------------------------------- */ /* Light modern theme selected */ input#modern:checked ~ .main , input#modern:target ~ .main { @@ -597,6 +636,7 @@ input#modern:target ~ #labels .content { margin: 0 auto; } +/* --------------------------------------------------------------------------- */ /* Dark simple theme selected */ input#darksimple:checked ~ .main , input#darksimple:target ~ .main { @@ -646,37 +686,7 @@ input#darksimple:target ~ .main #content { margin: 0 auto; } -/* Dark matrix theme selected */ -input#matrix:checked ~ .main , -input#matrix:target ~ .main { - --main-background: #000; - --main-foreground: #0b0; - --second-foreground: #080; - --reveal-foreground: #0f0; - --reveal-background: #000; - --soft-foreground: #080; - --border-color: #080; - --todo-txt: #0b0; - --color-h1: #0b0; - --color-h2: #0b0; - --color-h3: #0b0; - --color-h4: #0b0; - --color-h5: #0b0; - --color-h6: #0b0; - --color-link: #080; - font-family: monospace; -} -input#matrix:checked ~ #labels , -input#matrix:target ~ #labels { - background: #000; - color: #0b0; -} -input#matrix:checked ~ .main code, -input#matrix:target ~ .main code, -input#matrix:checked ~ .main pre , -input#matrix:target ~ .main pre { - font-family: monospace; -} +/* --------------------------------------------------------------------------- */ /* Default color theme */ body,.main { background: var(--main-background);