compress CSS

This commit is contained in:
Yann Esposito (Yogsototh) 2019-10-20 21:56:27 +02:00
parent 060fa9fa2a
commit 7622bd555a
Signed by untrusted user who does not match committer: yogsototh
GPG key ID: 7B19A4C650D59646
5 changed files with 76 additions and 56 deletions

6
compresscss.sh Executable file
View file

@ -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

View file

@ -1,5 +1,6 @@
#!/usr/bin/env nix-shell #!/usr/bin/env nix-shell
#!nix-shell -i zsh #!nix-shell -i zsh
#!nix-shell -I nixpkgs="https://github.com/NixOS/nixpkgs/archive/19.09.tar.gz"
# Directory # Directory
webdir="_site" webdir="_site"

View file

@ -1,8 +1,9 @@
;; sign it with ;; sign it with
;; gpg --local-user yann@esposito.host --output project.el.sig --detach-sign project.el ;; gpg --local-user yann@esposito.host --output project.el.sig --detach-sign project.el
(defvar domainname "https://her.esy.fun") (defvar domainname "https://her.esy.fun")
(defvar base-dir (concat (projectile-project-root) "src")) (defvar root-dir (projectile-project-root))
(defvar publish-dir (concat (projectile-project-root) "_site")) (defvar base-dir (concat root-dir "src"))
(defvar publish-dir (concat root-dir "_site"))
(defvar assets-dir (concat base-dir "/")) (defvar assets-dir (concat base-dir "/"))
(defvar publish-assets-dir (concat publish-dir "/")) (defvar publish-assets-dir (concat publish-dir "/"))
(defvar posts-dir (concat base-dir "/posts")) (defvar posts-dir (concat base-dir "/posts"))
@ -215,11 +216,13 @@ Return output file name."
(or (equal (expand-file-name (file-name-directory filename)) (or (equal (expand-file-name (file-name-directory filename))
(file-name-as-directory (expand-file-name pub-dir))) (file-name-as-directory (expand-file-name pub-dir)))
(let ((dst-file (expand-file-name (file-name-nondirectory filename) pub-dir))) (let ((dst-file (expand-file-name (file-name-nondirectory filename) pub-dir)))
(if (string-match-p ".*\\.\\(png\\|jpg\\|gif\\)$" filename) (cond ((string-match-p ".*\\.\\(png\\|jpg\\|gif\\)$" filename)
(shell-command (format "~/.nix-profile/bin/convert %s -resize 800x800\\> +dither -colors 16 -depth 4 %s" (shell-command (format "~/.nix-profile/bin/convert %s -resize 800x800\\> +dither -colors 16 -depth 4 %s"
filename filename
dst-file)) dst-file)))
(copy-file filename dst-file t))))) ((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 (defalias 'org-blog-posts-sitemap-fn
(apply-partially 'org-blog-sitemap-fn-descr posts-descr)) (apply-partially 'org-blog-sitemap-fn-descr posts-descr))

Binary file not shown.

View file

@ -333,6 +333,21 @@ navigation > a {
font-style: italic; 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 */ /* Dark theme selected */
input#dark:checked ~ .main , input#dark:checked ~ .main ,
input#dark:target ~ .main { input#dark:target ~ .main {
@ -352,7 +367,13 @@ input#dark:target ~ .main {
--color-h6: var(--reveal-foreground); --color-h6: var(--reveal-foreground);
--color-link: var(--green); --color-link: var(--green);
} }
input#dark:checked ~ #labels ,
input#dark:target ~ #labels {
background: var(--base03);
color: var(--base0);
}
/* --------------------------------------------------------------------------- */
/* Light theme selected */ /* Light theme selected */
input#light:checked ~ .main , input#light:checked ~ .main ,
input#light:target ~ .main { input#light:target ~ .main {
@ -378,24 +399,7 @@ input#light:target ~ #labels {
color: var(--base00); 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 */ /* Light simple theme selected */
input#simple:checked ~ .main , input#simple:checked ~ .main ,
input#simple:target ~ .main { input#simple:target ~ .main {
@ -443,6 +447,41 @@ input#simple:target ~ .main pre
{ {
font-family: monospace; 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 */ /* Light modern theme selected */
input#modern:checked ~ .main , input#modern:checked ~ .main ,
input#modern:target ~ .main { input#modern:target ~ .main {
@ -597,6 +636,7 @@ input#modern:target ~ #labels .content {
margin: 0 auto; margin: 0 auto;
} }
/* --------------------------------------------------------------------------- */
/* Dark simple theme selected */ /* Dark simple theme selected */
input#darksimple:checked ~ .main , input#darksimple:checked ~ .main ,
input#darksimple:target ~ .main { input#darksimple:target ~ .main {
@ -646,37 +686,7 @@ input#darksimple:target ~ .main #content {
margin: 0 auto; 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 */ /* Default color theme */
body,.main { body,.main {
background: var(--main-background); background: var(--main-background);