Comments (4)
Oh, I see that it is already provided as an [extra]
field, but not documented :)
Then maybe change this in an issue to move the field to the top-level front-matter because it seems that Zola supports this field natively.
You could support both I guess. Maybe I can fix that.
from tabi.
Wait, I'm confused, I see this line
51: {% if page.extra.toc | default(value=false) and page.toc %}
What does that do/mean exactly? I thought the top-level toc
field was a boolean too (because the page I linked does if page.toc {
but I guess that check just checks if the variable is provided.
So the extra.toc
boolean is necessary and we can't use the top-level toc fields?
from tabi.
Hey Steven!
-
page.extra.toc
is tabi's own boolean value to enable the ToC at the top of the page. -
page.toc
is an array ofHeader
objects that Zola generates automatically based on the headings in the markdown content. EachHeader
object has a few fields.
The line of code you shared is checking whether two conditions are met:
page.extra.toc = true
: the ToC should be rendered at the top of the article (defaults tofalse
)page.toc
: the page actually has a ToC (the array ofHeader
). It will evaluate tofalse
if it doesn't.
It's important to check the second part because not all pages have ToCs. For example, this page has no headers in the article, so it doesn't get a page.toc
.
Zola doesn't actually have a built-in ToC. The page you linked simply shows an example as to how it could be implemented. In tabi, the ToC is built by the table_of_contents.html
macro.
I'm glad you found the documentation on the theme's demo. In the future, I plan on adding a long page explaining all of tabi's features (both in config.toml
and within the [extra]
section of post's front matter).
from tabi.
The guide to all of tabi's settings is live! Check it out: Mastering tabi Settings: A Comprehensive Guide
from tabi.
Related Issues (20)
- 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 7
- <h2> renders (almost?) the same size as <h1> HOT 3
- Possible performance issues HOT 3
- Show "updated date" instead of creation date HOT 8
- Long build times - what could be the reason? HOT 56
- Footnote backlinks are not working HOT 3
- Add language support for search engine HOT 2
- Feature Request: add Bluesky SVG to social icons HOT 10
- Option for Fediverse (Mastodon) comments? HOT 4
- footer template doesn't handle changed feed config of new 0.19.0 version of Zola HOT 3
- Icons for "info" and "note" admonitions should be the other way around HOT 3
- Feat: make tubi work with Zola 0.19 HOT 6
- Archives template: years ordered descending but posts not ordered at all HOT 3
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.