Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add section option to exclude it from URL #608

Closed
jonblack opened this issue Feb 3, 2019 · 5 comments
Closed

Add section option to exclude it from URL #608

jonblack opened this issue Feb 3, 2019 · 5 comments

Comments

@jonblack
Copy link

jonblack commented Feb 3, 2019

I like to organise my content on disk using folders for different year and month. I don't need this in the URL. It would be nice to add a section front-page-matter option such as include_in_url (true/false) to denote whether it's part of the URL.

@Keats
Copy link
Collaborator

Keats commented Feb 4, 2019

Hmm I'm not sure I want to add that, it makes generating URLs harder with more potential conflicts for a pretty niche usecase.

Leaving it open to get more feedback

@backwardspy
Copy link

I am looking at using Zola for a webcomic project. I would like to store the comic's chapters inside their own directories, and I would like to avoid having these directories appear in the URL.

My reasons for wanting this are twofold:

  1. I can generate a chapter list by looking at subsections of the chapters directory, and a page list by looking at pages in each chapter directory.
  2. From an organisational standpoint it seems tidier than having the pages at the top level.

Example (omitting _index.md files)

content
^-- comicname
    ^-- ch1
        ^-- 1.1.md      -> comicname.com/1.1
        ^-- 1.2.md      -> comicname.com/1.2
    ^-- ch2
        ^-- 2.1.md      -> comicname.com/2.1
^-- archive.md          -> comicname.com/archive

From reading the documentation and #413 I thought transparent = true in the section front matter would give me this behaviour. Setting the comicname and ch1/ch2 sections as transparent seems to make it treat them as top-level sections/pages, however the URLs for each page remain the same (/comicname/ch1/1.1 et cetera.)

The remaining option would be setting the path in each page's front matter. This isn't too much trouble, but I would certainly prefer an automated solution if possible.

@Keats
Copy link
Collaborator

Keats commented Feb 5, 2019

transparent solves a different issue: when you have your blog posts in a blog/ folder for example but still want to paginate/show them on the homepage. In that case you do want to keep the section path sometimes so it cannot replace a new potential option.
Having this option would mean that a page needs to have access to all its ancestors section (since this option could be at any level) to make a link. Not a blocker, just a bit annoying.

@Keats
Copy link
Collaborator

Keats commented Jul 19, 2021

Not a lot of support for that feature, closing.

@Keats Keats closed this as completed Jul 19, 2021
@patmaddox
Copy link

Hi there, I wonder if you will re-consider this. For me, this is one of the big missing features from static site generators (I realize if they're all missing it, it's a "me" thing :) I want to have most/all of my pages have top-level URLs, but I don't want a single content/ dir with tons of files.

I group similar files in dirs, either by theme or by how I'm working with them (e.g. seed, develop, solid to represent different stages of development). This feature would let me do that with zola.

The closest approach I have right now is to keep a separate dir of files organized how I want, and then use a Makefile to dump them all into content/.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants