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

Question: how to generate non-index.html html files? #2271

Open
Jared-Sprague opened this issue Aug 14, 2023 · 2 comments
Open

Question: how to generate non-index.html html files? #2271

Jared-Sprague opened this issue Aug 14, 2023 · 2 comments

Comments

@Jared-Sprague
Copy link

Jared-Sprague commented Aug 14, 2023

Hello!

Is there a way to generate files that are not named "index.html"? I want to generate a file at /includes/head.html instead zola generates a file at: /includes/head.html/index.html Is there a way to tell zola to generate a file at a specific path and name it something other than index.html?

Here is what is in my content/ directory:

content/
├── includes
│   └── head.md

And the markdown for head.md looks like this:

+++
title = '''Head'''
path = "/includes/head.html"
template = "includes/head.html"
[extra]
noindex="true"
+++

CONTENT

And the end result after the site has been generated in public/ looks like this:

includes
└── head.html
    └── index.html

I want it to look like this:

includes
└── head.html

Thanks!

@mwcz
Copy link
Contributor

mwcz commented Aug 14, 2023

Related: #840

@Jared-Sprague
Copy link
Author

Jared-Sprague commented Aug 14, 2023

NOTE: the use case for this is for an SSI include e.g.:

<!--#include virtual="/includes/head.html" -->

Which to me looks cleaner than:

<!--#include virtual="/includes/head/index.html" -->

Especially since this is never ment to be accessed directly in a browser, so the "clean" url concept does not apply here. In fact I would argue that in code it's actually cleaner to not use the index.html in the include tag.

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

2 participants