Skip to main content

pelican-css-cache-bust

A Pelican plugin to append a cache buster query string to your CSS_FILE.

Set up

  • Define CSS_FILE in pelicanconf.py
  • CSS_FILE can be a filename or partial path
  • CSS_FILE should be findable in any of THEME_STATIC_PATHS

Use in templates

  • Use {{ CSS_FILE }}{{ CSS_FILE_CACHE_BUST }} in your templates
  • CSS_FILE_CACHE_BUST already includes a query prefix: ?

Example

# pelicanconf.py
CSS_FILE = "css/main.css"
THEME = "custom_theme"
THEME_STATIC_PATHS = ["static", "other"]
# You can explicitly enable this plugin. Note this disables auto discovery
# PLUGINS = ["css_cache_bust"]

Pelican will resolve THEME to a full path and the plugin will search for:

(resolved-path)/custom_theme/static/css/main.css
(resolved-path)/custom_theme/other/css/main.css

Any template can use the generated setting like:

<link rel="stylesheet" href="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/{{ CSS_FILE }}{{ CSS_FILE_CACHE_BUST }}" />

Adjust as necessary for your specific theme.

Metadata

Release files for pelican-css-cache-bust 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pelican-css-cache-bust 0.2.0
File Size Uploaded
pelican_css_cache_bust-0.2.0.tar.gz 15.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pelican-css-cache-bust 0.2.0
File Interpreter ABI Platform
pelican_css_cache_bust-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 32.5 kB

Release files / pelican_css_cache_bust-0.2.0.tar.gz

Download URL pelican_css_cache_bust-0.2.0.tar.gz
Size 15.8 kB
Tags Source
SHA-256 checksum
How to use checksums
37a504421f6e64f79735c943e39fcef9dea2c7948c8c70c43aea72093e58e434
BLAKE2b-256 checksum
How to use checksums
5478e5ab6e0040c95e157f845425ce2d17acf0729f7de2abd07ddfeb0deaf979
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.0 CPython/3.12.4

Release files / pelican_css_cache_bust-0.2.0-py3-none-any.whl

Download URL pelican_css_cache_bust-0.2.0-py3-none-any.whl
Size 16.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9aa39b80dbff0ae4f04aaa23f693e210ab1689160331d802c79814a71569ec09
BLAKE2b-256 checksum
How to use checksums
33730ec1b9a83b1830aae37efcb3e620ab1f3b322ef65d2d2881e152de688014
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.0 CPython/3.12.4

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page