Comments (3)
Hey @stevenroose and @Jieiku,
Thank you both for your suggestions and input on this issue!
I've implemented the feature to allow dynamic loading of extra stylesheets in #118. You can now specify additional stylesheets both in the config.toml
file and in individual page metadata in the [extra]
section of the front matter.
How to Use
-
Site-wide: Add the stylesheet names to the
stylesheets
field inconfig.toml
like this:[extra] stylesheets = ["extra1.css", "path/extra2.css"]
-
Individual pages: Specify the additional stylesheets in the
[extra]
section in the front matter of the post like so:+++ title = "My Page" [extra] stylesheets = "individual.css" # Use an array for more than one file. +++
Note: If you're working with .sass
or .scss
files, remember to specify the processed .css
filenames, as Zola renders these into .css
files in the public
folder (docs). For example:
[extra]
stylesheets = ["extra.css"] # Corresponding to `sass/extra.scss`
The feature has been documented in the config.toml
and in the PR.
Have a fantastic weekend :)
from tabi.
stylesheets could be defined in config.toml like this:
stylesheets = ["main.css","extra.css"]
You could then load any extra stylesheets via a loop.
{%- set stylesheets=config.extra.stylesheets | default(value=[ "main.css" ]) -%}
{%- if stylesheets %}{%- for i in stylesheets %}
<link rel="stylesheet" href="{{ get_url(path=i, trailing_slash=false, cachebust=true) | safe }}" />
{%- endfor %}{%- endif %}
from tabi.
Hey Steven!
Thanks for the feature request. Funnily enough, this was an undocumented feature until I removed it when adding skins (#105).
I'll bring it back! And better than ever.
Along with loading CSS files from config.toml
, like Jieiku showed (thanks), I will allow loading files for individual posts as well, in the [extra]
section of the post's front matter.
from tabi.
Related Issues (20)
- Blog and Projects on homepage HOT 7
- "All posts ->" in main page links to "blog/" is hardcoded, so dead link if other section was chosen for main page HOT 3
- Wrong history url for gitlab and codeberge
- Change Language icon not showing HOT 11
- Umami analytics blocked unless CSP is modified HOT 1
- Misaligned posts when showing latest projects HOT 3
- Projects in RSS Feed HOT 4
- Too little spacing between projects (at the top) and posts HOT 2
- Allow fetching code blocks from external source, display reference in code block title HOT 14
- Umami analytics broken by CSP
- Project on archive page HOT 2
- E-mail icon dissapears when all social icons are off HOT 1
- Add OSM map (Leaflet) to Tabi HOT 4
- Add inline image in text HOT 6
- Turn off (disable or hide) "blog" section on the main page HOT 10
- nani_logo.webp cannot be read HOT 2
- author in page.html HOT 5
- non-css syntax highlighting doesn't work (and is fixed to one theme) HOT 6
- <h2> renders (almost?) the same size as <h1> HOT 3
- Possible performance issues
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tabi.