New Wibewa Wagtail Blog

My First Wagtail Post, Again

Sept. 24, 2024

I decided to give Wagtail another try. I didn't like it at first and there are still some things I don't like, but the benefits are hard to ignore

One of the things I don't like is a central feature of Wagtail, which is the tree structure. I wanted a way to make the home page something other than the root page. The home page is the page that people see when they visit the site with the root URL, and the root page is the parent page of all other pages on the site, in accordance with Wagtail's tree structure. From what I can tell, the root page is the home page in Wagtail and there is no way to have the home page be something other than the root page. So I wrote my own app, which I'm calling Wibekwa.

Of course, maybe I just missed something in the docs. I often jump off and write my own solution to a problem that's already solved because it's more fun than studying. I might feel silly later when I finally come across the existing solution, but as of now, I'm happy with the way I solved this problem.

Wibekwa contains a RedirectPage class. On this blog, the root page is a RedirectPage instance. Since it's the root page, all other pages on the site descend from it. But since it's a RedirectPage, you don't see it when you first visit the site. Instead, you see the page that the root page redirects to

Wibekwa also contains an "ArticleStaticTagsIndexPage" class. This page is an index of articles that match specified tags. These tags are specified in the admin panel, not on the fly in the URL as done in the BlogTagIndexPage from Wagtail's tutorial. So with the static tags index page, you can specify "featured" as a tag, and page will display articles tagged as "featured"

In this case, the specified tags are (subject to change), "_coding", "_politics", "_library", and _personal"

Wibekwa treats tags that start with underscores as hidden. These tags wont be displayed with the tag list that appears with each article.

I'll have a few articles that I want to tag as "politics", but I'll only want some to be featured. So I could set the static tags index to show "featured" tagged articles, and I could tag an article with both "politics", and "featured". That would work. But I want to be able to split "coding", "politics", "library", and "personal" into separate columns. The index page allows me to to do that. There are a few ways to achieve that, but I found it more convenient and versatile to have hidden tags. So I would tag a featured politics tag with both "_politics" and "politics"

Tags