Comments (4)
I actually want to do a site very similar to the rocket guide you linked for Tera.
My approach was to do the sidebar manually in the template like so:
<aside>
<ul>
<li><a href="/introduction">Introduction</a></li>
</ul>
<ul>
<li><a href="/getting-started">Getting started</a></li>
</ul>
...
</aside>
With the hardcoded links replaced by a get_url
(#67). This is little bit manual since you have to update the template if you change a section but in practice it doesn't happen very often.
Using this approach we can do something like:
<aside>
<ul>
<li><a href="{{ get_url(page="./doc/configuration.md) }}">Configuration</a></li>
<ul>
<li><a href="{{ get_url(page="./doc/configuration.md#basic) }}">Basic</a></li>
<li><a href="{{ get_url(page="./doc/configuration.md#advanced) }}">Advanced</a></li>
</ul>
</ul>
<ul>
<li><a href="/getting-started">Getting started</a></li>
</ul>
...
</aside>
which gives you exactly the rocket design (I put both basic and advanced part of configuration.md, it might be incorrect in your case though).
You also should get the direct subsections of doc
as section.subsections
in its template
For the previous/next sections, that implies sorting sections as well somehow and that's a very good usecase! I'll think about it
from zola.
I actually just realised that to do the same layout as rocket, it's already possible as each "section" in the rocket guide is a page.
Do you know if the rocket site repo is publicly accessible? I'm curious how it's set up
from zola.
In the meantime I've also switched from sections to pages and added this to the template:
{% set toc = get_page(path="/toc.md") %}
{{ toc.content | safe }}
I still think that sections should have more page functionality like get_section and previous/
next.
The rocket doc content is at https://github.com/SergioBenitez/Rocket/tree/master/site, but the HTML generation code seems not be public.
from zola.
I agree! the get_section
will probably be in the next version and maybe sorting for sections as well
from zola.
Related Issues (20)
- Slow build HOT 7
- GitLab CI/CD gets stuck HOT 3
- Build fails if there is a mistake in commened out template code HOT 3
- Question about taxonomy and sections HOT 1
- Question: How to organize news feed items?
- Zola theme not working HOT 1
- Vertical bar inside of table creates new cell HOT 1
- Would you merge support for plugins? HOT 3
- [Feature Request] About Atomic CSS Engine HOT 1
- Unnecessary rebuilds HOT 3
- Paginated pages should be absent from sitemap.xml HOT 6
- 1.5 Years Since Last Release HOT 1
- [Question] use data/variable in markdown HOT 5
- `get_url` with @ only finds Markdown files HOT 5
- get_section - merge missing translations from other languages HOT 3
- Compilation failure: `ahash`: unknown feature `stdsimd` HOT 4
- Can't build on v0.19.0: Read-only file system HOT 3
- Zola 0.19 no longer builds/serves if I enable feeds. HOT 2
- Zola 0.19 does not detect changes anymore HOT 19
- Zola 0.19 config.generate_feeds not accessible from template files. HOT 2
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 zola.