From 4b70db61856dc644f06baf01771d829aeba79b13 Mon Sep 17 00:00:00 2001 From: dongdigua Date: Sun, 24 Nov 2024 20:12:52 +0800 Subject: [PATCH] add page size calculation I want to add https://www.websitecarbon.com/badge/ but I don't want js. --- org/Makefile | 5 ++++- org/publish_config.el | 4 ++-- quotes.txt | 1 + 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/org/Makefile b/org/Makefile index e3b461b..36513c0 100644 --- a/org/Makefile +++ b/org/Makefile @@ -4,7 +4,7 @@ TARGET=ls ../*.html* | grep -v "index\|xmr\|404.html" EMACS_OPTS=--script $(ORG_CONFIG_FILE) -f myweb-publish -all: html +all: html size html: @echo "Generating HTML..." @@ -15,3 +15,6 @@ clean: - rm ~/.org-timestamps/org-pages.cache - $(TARGET) | xargs -I {} rm {} - rm ../feed.xml* + +size: + $(TARGET) | xargs -I {} sh -c 'sed -i "s/PAGE_SIZE/$$(du -h {} | cut -f1)/g" {}' diff --git a/org/publish_config.el b/org/publish_config.el index 37cc28a..17cb8e5 100644 --- a/org/publish_config.el +++ b/org/publish_config.el @@ -23,9 +23,9 @@ '(("en" "

dongdigua CC BY-NC-SA 禁止转载到私域(公众号,非自己托管的博客等)

-

Date: %d Build: %T

-

Proudly made with Emacs Org mode

Email me to add comment

+

Proudly made with Emacs Org mode

+

Date: %d Build: %T Size: PAGE_SIZE

"))) (setq org-html-home/up-format " diff --git a/quotes.txt b/quotes.txt index bc6b425..db6f13a 100644 --- a/quotes.txt +++ b/quotes.txt @@ -57,3 +57,4 @@ Someone tell Vedal there's a problem with my AI man!(Volt can I set?) 豌豆的花语是 9331 l(a\nle\naf\nfa\nll\ns)\none\nl\niness +If the Internet was a country, it would be the 4th largest polluter