From e9383423398b1dda9a3d5be45c7a029d200f1d87 Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Thu, 24 Jun 2021 18:40:21 +1000 Subject: Adding post-processing script and fix image size - post-process.sh: fix paths - image size: max width not exceeding div --- Makefile | 1 + css/default.css | 5 +++++ post-process.sh | 11 +++++++++++ 3 files changed, 17 insertions(+) create mode 100755 post-process.sh diff --git a/Makefile b/Makefile index 4f025ab..6ee852c 100644 --- a/Makefile +++ b/Makefile @@ -7,6 +7,7 @@ all: publish publish: publish.el @echo "Publishing... with current Emacs configurations." emacs --batch --load publish.el --funcall org-publish-all + ./post-process.sh python rss.py publish_no_init: publish.el diff --git a/css/default.css b/css/default.css index 672d469..705e792 100644 --- a/css/default.css +++ b/css/default.css @@ -93,3 +93,8 @@ footer center { margin: auto; line-height: 1.6; } + +img { + max-width: 100%; + height: auto; +} diff --git a/post-process.sh b/post-process.sh new file mode 100755 index 0000000..57b7a9a --- /dev/null +++ b/post-process.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +for post in $(ls site/posts); do + sed -i 's/src="file:\/\//src="/g' site/posts/$post + sed -i 's/href="file:\/\//href="/g' site/posts/$post +done + +for page in $(ls site/pages); do + sed -i 's/src="file:\/\//src="/g' site/pages/$page + sed -i 's/href="file:\/\//href="/g' site/pages/$page +done -- cgit v1.2.3