getpelican / pelican-themes

Themes for Pelican
https://getpelican.com/
2.13k stars 1.09k forks source link

gum: Add optional extra CSS and JS resources #752

Open slinkp opened 1 year ago

slinkp commented 1 year ago

With this change, the gum theme can be tweaked for style and behavior without forking it:

  1. Create a static css or js file, eg "content/static/foo.css" and "content/static/foo.js" in your site tree.

  2. In pelicanconf.py, make sure the directory containing your file is included in STATIC_PATHS.

  3. Add to pelicanconf.py:

    
    THEME = 'gum'
    CUSTOM_CSS_FILES = ['static/foo.css']
    CUSTOM_JS_FILES = ['static/foo.js']


These will be loaded after the default Gum styles and scripts.

Remotely hosted assets can be supported as well, via `CUSTOM_CSS_URLS` and `CUSTOM_JS_URLS`.

I'm using this on my own website to eg override a few colors and tag cloud text styles:
https://slinkp.com/
slinkp commented 6 months ago

@justinmayer Thanks for the feedback! All done and squashed to a single commit.