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))
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)
"Publish a file with no transformation of any kind.
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)))
(let ((dst-file (expand-file-name (file-name-nondirectory filename) pub-dir)))
(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"
filename
dst-file)))
(compress-image filename dst-file))
((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))))))
(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)
#+AUTHOR: Yann Esposito
#+EMAIL: yann@esposito.host
#+DATE: [2019-08-17 Sat]
#+DATE: [2019-08-17 Sat 16:00]
#+KEYWORDS: programming, blog, org-mode, web, css
#+DESCRIPTION: Meta article about how I generate this blog.
#+OPTIONS: auto-id:t

View file

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