How to control the production of /output/index.html

77 views
Skip to first unread message

François-Régis Chalaoux

unread,
Jul 19, 2020, 1:47:35 PM7/19/20
to nikola-discuss
Hi All,

I'm trying to produce a site not a blog. I followed https://getnikola.com/creating-a-site-not-a-blog-with-nikola.html recipe but I have a problem, the root file (root index.html of this site is not the one I'm trying to produce), an other one is created in /output/index.html and is 'empty', only the menu


I tried to create an index.html with a index.rst with :

.. title: index
.. hidetitle: True
.. slug: index
.. date: 2020-03-18 15:32:37 UTC+01:00
.. tags: 
.. category:
.. link: 
.. description: 
.. type: text

blablabla ...

But this created a /output/pages/index.html not a /output.index.html

I can't resolve to how to edit a index.rst and produce /output/index.html file. This file seems created automatically in output directory.

Help are welcome !


François-Régis


conf.py

Martin McCallion

unread,
Jul 19, 2020, 3:09:41 PM7/19/20
to nikola-discuss

Hi François-Régis,

You said:

But this created a /output/pages/index.html not a /output.index.html

I think this is because of one of the settings in PAGES in your conf.py. My pages deploy into my site's root, and my PAGES looks like this:

PAGES = (
    ("pages/*.md", "", "page.tmpl"),
    ("pages/*.rst", "", "page.tmpl"),
    ("pages/*.txt", "", "page.tmpl"),
    ("pages/*.html", "", "page.tmpl"),
)

I think it's because the second value in each case is set to the empty string, "". You probably have "pages" in there, which is why your HTML files end up in /output/pages.

HTH.

Cheers,

Martin
--
Martin McCallion
https://devilgate.org/blog/
@devilgate (Micro.blog and Twitter)

--
You received this message because you are subscribed to the Google Groups "nikola-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nikola-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nikola-discuss/73469c68-a5e8-4dbf-880a-b2f45e16503bo%40googlegroups.com.
Message has been deleted
Message has been deleted

Roberto Alsina

unread,
Jul 20, 2020, 4:34:42 AM7/20/20
to Nikola—Discuss
You still can do that. Just add more rows to PAGES

On Mon, Jul 20, 2020 at 5:33 AM chala...@gmail.com <chala...@gmail.com> wrote:
It works ! Thanks.
I loved the capabilities to separate output in Pages but that's life.

FR.

Roberto Alsina

unread,
Jul 20, 2020, 4:35:31 AM7/20/20
to Nikola—Discuss
Or not even, just do a tree structure inside pages/

So, if you have pages/ producing out put in /, pages/pages will output in /pages :-)

chala...@gmail.com

unread,
Jul 20, 2020, 4:39:29 AM7/20/20
to nikola-discuss
It works ! Thanks.
I loved the capabilities to separate output in Pages but that's life for the moment. It is possible however since Website of Nikola do it. But how ????

FR.

Le dimanche 19 juillet 2020 à 21:09:41 UTC+2, Martin McCallion a écrit :
Message has been deleted

chala...@gmail.com

unread,
Jul 20, 2020, 4:43:44 AM7/20/20
to nikola-discuss
Ok, but how concretely do it ?

Roberto Alsina

unread,
Jul 20, 2020, 4:56:04 AM7/20/20
to Nikola—Discuss
On Mon, Jul 20, 2020 at 5:43 AM chala...@gmail.com <chala...@gmail.com> wrote:
Ok, but how concretely do it ?


Exactly as described. Just create a tree structure inside pages. it will be reflected in the output.

So, if this works:

pages/foo.md => output/foo/index.html

This also works:

pages/pages/foo.md => output/pages/foo/index.html
 
 
Reply all
Reply to author
Forward
0 new messages