GithubHelp home page GithubHelp logo

Comments (4)

Keats avatar Keats commented on July 17, 2024

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.

Keats avatar Keats commented on July 17, 2024

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.

pka avatar pka commented on July 17, 2024

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.

Keats avatar Keats commented on July 17, 2024

I agree! the get_section will probably be in the next version and maybe sorting for sections as well

from zola.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.