Cleanup code and fixed dates

This commit is contained in:
Yann Esposito (Yogsototh) 2020-05-03 14:15:35 +02:00
parent 327bc89991
commit 43492d5f8d
Signed by untrusted user who does not match committer: yogsototh
GPG key ID: 7B19A4C650D59646
4 changed files with 29 additions and 6 deletions

View file

@ -259,6 +259,31 @@
(kill-buffer)) (kill-buffer))
file-path)) file-path))
(defun compress-image (filename dst-file)
"Compress images using imagemagick"
(shell-command
(format
(concat
"~/.nix-profile/bin/convert"
" %s" ;; source
" -sampling-factor 4:2:0"
" -strip"
" -resize 400x400\\>"
" -interlace Place"
" -gaussian-blur 0.05"
" -quality 85"
" -colorspace Gray"
" -ordered-dither o8x8,8"
"%s" ;; dest
)
filename
dst-file)))
(defun compress-css (root-dir filename dst-file)
"Compress CSS usin compresscss.sh script"
(shell-command
(format "%s/engine/compresscss.sh %s %s" root-dir filename dst-file)))
(defun org-blog-publish-attachment (plist filename pub-dir) (defun org-blog-publish-attachment (plist filename pub-dir)
"Publish a file with no transformation of any kind. "Publish a file with no transformation of any kind.
FILENAME is the filename of the Org file to be published. PLIST FILENAME is the filename of the Org file to be published. PLIST
@ -272,11 +297,9 @@ Return output file name."
(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)))
(cond ((string-match-p ".*\\.\\(png\\|jpg\\|gif\\)$" filename) (cond ((string-match-p ".*\\.\\(png\\|jpg\\|gif\\)$" filename)
(shell-command (format "~/.nix-profile/bin/convert %s -resize 400x400\\> -colorspace Gray -ordered-dither o8x8,8 %s" (compress-image filename dst-file))
filename
dst-file)))
((string-match-p ".*\\.css$" filename) ((string-match-p ".*\\.css$" filename)
(shell-command (format "%s/engine/compresscss.sh %s %s" root-dir filename dst-file))) (compress-css root-dir filename dst-file))
(t (copy-file filename dst-file t)))))) (t (copy-file filename dst-file t))))))
(defalias 'org-blog-posts-sitemap-fn (defalias 'org-blog-posts-sitemap-fn

Binary file not shown.

View file

@ -2,7 +2,7 @@
#+SUBTITLE: Meta Post (not really related to Donald Knuth) #+SUBTITLE: Meta Post (not really related to Donald Knuth)
#+AUTHOR: Yann Esposito #+AUTHOR: Yann Esposito
#+EMAIL: yann@esposito.host #+EMAIL: yann@esposito.host
#+DATE: [2019-08-17 Sat] #+DATE: [2019-08-17 Sat 16:00]
#+KEYWORDS: programming, blog, org-mode, web, css #+KEYWORDS: programming, blog, org-mode, web, css
#+DESCRIPTION: Meta article about how I generate this blog. #+DESCRIPTION: Meta article about how I generate this blog.
#+OPTIONS: auto-id:t #+OPTIONS: auto-id:t

View file

@ -2,7 +2,7 @@
#+Subtitle: How a terrible movie can be entertaining #+Subtitle: How a terrible movie can be entertaining
#+Author: Yann Esposito #+Author: Yann Esposito
#+Email: yann@esposito.host #+Email: yann@esposito.host
#+Date: [2019-08-17 Sat] #+Date: [2019-08-17 Sat 20:00]
#+KEYWORDS: movie #+KEYWORDS: movie
#+DESCRIPTION: I watched what may be the worse movie of all time and I still enjoyed greatly the show. #+DESCRIPTION: I watched what may be the worse movie of all time and I still enjoyed greatly the show.
#+LANGUAGE: en #+LANGUAGE: en