Code Monkey home page Code Monkey logo

Comments (6)

Keats avatar Keats commented on June 8, 2024

What's the usecase there? We are already serializing the front-matter

from zola.

clarfonthey avatar clarfonthey commented on June 8, 2024

Basically, the idea is to offer a way to get around some of the restrictions on hidden pages by offering a way to load a "page" in a limited capacity from an external file. Not the full parsing of a page, just the ability to parse the front matter correctly.

Right now I'm trying to switch from an existing jank, custom setup to using zola for generating my website, and one of the existing pages under that jank setup is my CV, which is made up of a bunch of sections that could be all included in one massive page file, but would probably be easier if split up. It would be nice to be able to colocate the metadata (front matter) in the files instead of having to load two files each time, and when I tried to make a macro for it, it didn't really work out well.

The thought is, adding proper ways to have "hidden" or "internal" pages seems way out of scope, but adding in a method to parse the front matter in templates feels like an okay compromise. It would also let you separate out some content pages into multiple files without having to create dedicated pages for them, since you could embed those parts using shortcodes.

from zola.

Keats avatar Keats commented on June 8, 2024

The thought is, adding proper ways to have "hidden" or "internal" pages seems way out of scope,

We do have render = false on sections currently exactly for that purpose

from zola.

clarfonthey avatar clarfonthey commented on June 8, 2024

Oh, I totally missed that, then. There isn't a render = false option for pages but I guess that making a page into a "section" that isn't rendered would probably work fine.

EDIT: Hmm, running off of master, it still seems to render index.html for sections even if I have render = false in their _index.md files. I'm not 100% sure how this is supposed to work, but at minimum the docs really aren't that clear.

from zola.

Keats avatar Keats commented on June 8, 2024

Yeah it's lacking in page right now.

Can you share an example? In the code, the template rendering is after the render check so it shouldn't happen

from zola.

clarfonthey avatar clarfonthey commented on June 8, 2024

I don't want to share my existing example because it's a mess, but I'll try to create a minimally reproducible version since it'll probably help resolve the confusion. I tried looking into the code but I didn't quite understand the one if statement that seems to be branching on this flag, and whether it would be enough to fully stop the rendering. I'd have to understand more about the code structure to really know if it's working properly.

EDIT: Okay, I see the issue. I thought I had cleaned the public folder multiple times after setting render = false but I actually hadn't, and it is working properly.

The only bug I can see is that it's still generating empty folders, which I guess isn't the worst, but maybe I'll look into the code later how it can be done. I'll also try and see if I can implement a version of render = false for pages, since that seems like the best path forward.

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.