How to show my posts on the first page, not in "/ blog" and support other auxiliary folders working like "/ about" and "/ projects",

I am trying to use Lektor as the platform of my blog, but I have a few problems.

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

If I request blogs in the page template, pagination does not work.

If I create child blog pages on the page using "replace_with = site.query ('/ blog'), the start page displays fine, but if I try to access any page, a Not Found message appears.

My goal is to show my messages on the first page and have other folders, such as "/ about" or "/ projects" in the root folder.

+4
source share
3 answers

I understood! The way to do this is to set the 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. :)

+6
source

I had the same problem. I tried a few things and none of them worked.

I have finished redirecting the page. Lektor does not yet support redirects; they are working on it .

I made home.htmlit redirect to /blog.

<meta http-equiv="refresh" content="0; url=http://example.com/blog/" />

This is not recommended by WWC. As long as lector does not support redirection, this is the way to go.

0
source

Here is how I did it.

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

[fields.title]
label = Title
type = string

[children]
model = blog-post
order_by = -pub_date, title

[pagination]
enabled = yes
per_page = 5
items = this.children.filter(F._model == 'blog-post')
0
source

All Articles