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] Page as homepage, but keep site as blog #3524

Closed
varna9000 opened this issue Mar 9, 2021 · 6 comments
Closed

[Question] Page as homepage, but keep site as blog #3524

varna9000 opened this issue Mar 9, 2021 · 6 comments

Comments

@varna9000
Copy link

Hi, I'm struggling to find a solution to this. I'm building a blog, but I want my homepage to be one of the pages, not the list of blog posts. If I follow the instructions here I can have a page show as a homepage (index) but I don't know how I can keep the posts on the website as well. If I leave in conflict.py:

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

)

Then the blog posts are loading as homepage. Can you suggest a solution to this?

@varna9000
Copy link
Author

I should read the documentation page to the bottom! The answer is there. Sorry about that!

@varna9000
Copy link
Author

varna9000 commented Mar 9, 2021

Ok I have to reopen this, as building the website keeps routing the blog posts as homepage. I follow the examples exactly as mentioned in the link above but can't make a page be set as homepage.

@varna9000 varna9000 reopened this Mar 9, 2021
@Kwpolska
Copy link
Member

Kwpolska commented Mar 9, 2021

What is your INDEX_PATH set to in conf.py?

@varna9000
Copy link
Author

just as in the example - it's INDEX_PATH = "blog"

Then I have:

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

and have created a page with nikola new_page containing :

.. title: index
.. slug: index
.. date: 2021-03-09 17:21:45 UTC+02:00


test page

@Kwpolska
Copy link
Member

Kwpolska commented Mar 9, 2021 via email

@varna9000
Copy link
Author

Thank you! That works exactly as I expect!

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