The main content of my blog mcol.xyz
git clone https://mcol.xyz/code/mcol.xyz
Log | Files | Refs

commit 774add95b109b7b5ab0240eb971fdf40690041f0
parent 4e6ef578b7f496cb78626b6ca3c1af0beb6b8af4
Author: mcol <mcol@posteo.net>
Date:   Fri,  2 Oct 2020 23:37:18 +0100

add screenshots page and configuration, and only copy static files as hardlinks

Diffstat:
M.gitignore | 1+
Acontent/pages/screenshots.rst | 5+++++
Mmakefile | 2+-
Mpelicanconf.py | 11+++++++++--
4 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/.gitignore b/.gitignore @@ -2,3 +2,4 @@ __pycache__ drafts fontawesome-* output +content/screenshots diff --git a/content/pages/screenshots.rst b/content/pages/screenshots.rst @@ -0,0 +1,5 @@ +screenshots +=========== + +:save_as: screenshots.html +:template: screenshots diff --git a/makefile b/makefile @@ -80,7 +80,7 @@ ssh_upload: publish scp -P $(SSH_PORT) -r $(OUTPUTDIR)/* $(SSH_USER)@$(SSH_HOST):$(SSH_TARGET_DIR) rsync_upload: publish - rsync -e "ssh -p $(SSH_PORT)" -P -rczz --cvs-exclude --delete --chmod=D755,F644 \ + rsync -e "ssh -p $(SSH_PORT)" -P -rczz --cvs-exclude --delete --chmod=D755,F644 --copy-dirlinks \ $(OUTPUTDIR)/ $(SSH_USER)@$(SSH_HOST):$(SSH_TARGET_DIR) diff --git a/pelicanconf.py b/pelicanconf.py @@ -18,7 +18,8 @@ THEME = '/home/mcol/git/mini-theme' PAGE_PATHS = ['pages',] ARTICLE_PATHS = ['posts',] DEFAULT_DATE_FORMAT = '%Y-%m-%d' -STATIC_PATHS = ['static', 'favicon.png', 'icons', 'avatar.png'] +STATIC_PATHS = ['static', 'favicon.png', 'icons', 'avatar.png', 'screenshots'] +STATIC_CREATE_LINKS = True PLUGIN_PATHS = ["/home/mcol/git", "/home/mcol/git/pelican-plugins"] PLUGINS = [] RELATIVE_URLS = True @@ -50,7 +51,8 @@ ABOUT = """ <p>Welcome to my blog!</p> <p>I'm Matt and I write about open source software that I stumble across surfing the web.</p> <p>Some of my main interests are self-hosting, privacy tools, and anything -to do with <a href=https://wiki.installgentoo.com/wiki/GNU/Linux_ricing>ricing</a>.</p> +to do with <a href=https://wiki.installgentoo.com/wiki/GNU/Linux_ricing>ricing</a> (see +mine <a href="/screenshots.html">here</a>).</p> """ AVATAR = "/avatar.png" @@ -59,6 +61,11 @@ HOME2 = "Welcome" EXTRAHEAD = "<link rel=stylesheet href=/theme/css/fa.css />" EXTRATAIL = "<script data-goatcounter=https://goat.mcol.xyz/count async src=//goat.mcol.xyz/count.js></script>" +import html +SCREENSHOTS = os.listdir('content/screenshots') +SCREENSHOTS = [html.escape(i) for i in SCREENSHOTS] +SCREENSHOTS.sort(reverse=True) + # minify-fontawesome PLUGINS.append("pelican-minify-fontawesome") MINIFY_FONTAWESOME = '/home/mcol/git/mcol.xyz/fontawesome-free-5.11.2-web'