Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to show my posts in the first page and not in the "/blog" and maintaining other sub folders working like "/about" and "/projects"

Tags:

lektor

I'm trying to use Lektor as my blog platform, but I am running into a few issues.

Following the guide I can make everything work. My problem begin when I try to make the blog the first page, without the "/blog".

If I query in the page template the blogs children, the pagination don't work.

If I make the blog-post children of the page using "replaced_with = site.query('/blog')" the initial page renders fine, but if I try to access any page, appears a Not Found message.

My goal is show my posts in the first page and have other folders, like "/about" or "/projects" in the root folder.

like image 251
Marcelo Belli Avatar asked May 27 '16 02:05

Marcelo Belli


1 Answers

I get it! The way to do it was setting a query in the "items" key on the page model.

Like this:

[model]
name = Page
label = {{ this.title }}
hidden = yes
protected = yes

[fields.title]
label = Title
type = string

[pagination]
enabled = yes
per_page = 10
items = site.query('/blog')

After that it worked like a charm. :)

like image 158
Marcelo Belli Avatar answered Nov 20 '22 08:11

Marcelo Belli