DEV Community

Kumar Vanshaj
Kumar Vanshaj

Posted on

Inside Wagtail's News Template - What Works, What's Broken, and What's Missing

I spent several weeks reading the wagtail/news-template codebase for my Google Summer of Code application. This post shares what I found - what works, what is broken, and what could be better.

wagtail/news-template homepage showing dark hero section with navigation

The wagtail/news-template homepage - dark mode enabled by default

What the starter kit is

The news-template is a Wagtail starter kit for news and media websites. It gives you article pages, topic filtering, pagination, search, and dark mode. Everything works out of the box. The design uses Tailwind CSS and is responsive.

What it does well

The content model is solid. ArticlePage supports authors, topics, publication dates, and hero images. The body is built from StreamField blocks. Editors can add sections, quotes, stats, and cards - no code needed.

The block system is flexible. FeaturedArticleBlock lets editors override an article's image, description, and CTA text. Topic filtering works via query parameters. It is a small but thoughtful detail.

What is broken or missing

Reading the code revealed several bugs.

Newsletter signup never submitted. The email input had no name attribute. The button was an <a> tag with no connection to the input. Every visitor who tried to sign up got no result. I fixed this in PR #107.

Mobile navigation links were broken. A regression left mobile nav links with empty href="" attributes. Users were redirected back to the current page. Fixed in PR #101.

FeaturedArticleBlock had an empty template. The block defined five fields but its template was a stub. It rendered raw block data instead of HTML. Fixed in PR #103.

Missing imports caused runtime errors. slugify was not imported in utils/models.py. Pagination exceptions were missing in news/models.py. Both caused NameError crashes.

Form fields lacked label elements. Inputs had no <label> elements. This is a WCAG 2.1 AA accessibility violation. Fixed in PR #99.

Test coverage was minimal. The project had three tests before my contribution. Core models, template tags, and views had no coverage at all.

What could be added

  • Author profile pages with bio and social links

  • RSS feed for articles

  • Open Graph meta tags for social sharing

  • Multilingual support

Final thoughts

The starter kit is a strong foundation. The content model and block system are well thought out. But several core features were broken. Contributing fixes taught me more about Wagtail than any tutorial could.

Top comments (0)