Cleanup code and fixed dates
This commit is contained in:
parent
327bc89991
commit
43492d5f8d
31
project.el
31
project.el
|
@ -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
|
||||
|
|
BIN
project.el.sig
BIN
project.el.sig
Binary file not shown.
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue