feat(news): show the posts of the lists as note panels
All checks were successful
check / check (pull_request) Successful in 30s
All checks were successful
check / check (pull_request) Successful in 30s
The blog list, the pages of a category and the pages of an archive show every post as a
note panel: a small line with the long date and the categories, the title in bold with
a full stop (unless it ends with a full stop, a question mark or an exclamation mark),
the description and a read more link whose aria-label names the post. The page of a
post, {{news_list}} and the latest news of the home page are unchanged.
A language without read_more gets the title as the link on the category and archive
pages, as those pages worked before; the blog list still needs the string.
Refs #9
This commit is contained in:
parent
633da1c46b
commit
71cf14006d
1 changed files with 185 additions and 43 deletions
|
|
@ -63,8 +63,8 @@ The news exist once, not once per language. Their language is `news_language` in
|
|||
Everything below is opt in, so a site that does not use it builds as it did.
|
||||
|
||||
- **The post page** (`templates/post.html`) has, besides `post_title`, `date`, `post_body` and `post_byline`: `date_long` (such as "14 November 2026"), `post_summary` (the written description as a lead paragraph), `post_meta` (a line with the date, the author, the category links and the reading time), `post_reading`, `post_mastodon` (the reply link) and `post_nav` (the newer post, the older post and all the news). `og_type` is `article` there and `website` on every other page, and `article_meta` holds the published time and a tag for each category, for the head of `base.html`.
|
||||
- **The blog list**: a paragraph with only `{{news_blog}}` on the news index lists the posts as entries (title, long date, categories, description, a read more link), 10 to a page. The other pages are written under the index, at `page/2/`, `page/3/`, with a pager. The block needs an index page.
|
||||
- **The archive**: when `templates/archive.html` exists, every year and month with posts gets a page, `/news/2026/` and `/news/2026/11/`, with `archive_name`, `archive_nav` and `archive_posts`. `{{news_archive}}` lists the years and the months with their counts, and needs the template.
|
||||
- **The blog list**: a paragraph with only `{{news_blog}}` on the news index lists the posts as note panels (`<p class="note" role="note">`: a small line with the long date and the categories, the title in bold with a full stop unless it ends with `.`, `?` or `!`, the description, and a read more link named after the post), 10 to a page. The other pages are written under the index, at `page/2/`, `page/3/`, with a pager. The block needs an index page.
|
||||
- **The archive**: when `templates/archive.html` exists, every year and month with posts gets a page, `/news/2026/` and `/news/2026/11/`, with `archive_name`, `archive_nav` and `archive_posts`. The posts of an archive page, of a category page and of the blog list are the same panels; where the language has no `read_more` the title is the link instead, except on the blog list, where it is an error. `{{news_list}}` and the latest news of the home page stay plain lists. `{{news_archive}}` lists the years and the months with their counts, and needs the template.
|
||||
- **The feed** (`/news/feed.xml`) has the summary in `description` and the full text, with absolute links, in `content:encoded`, plus the categories and the author.
|
||||
|
||||
The strings come from the language files. These are required when the feature is used: `read_more`, `pager_label`, `pager_newer`, `pager_older` and `pager_page` (`Page {n} of {total}`) for the blog list, and `reply_mastodon` for a post with a Mastodon address. These are optional, and without them the feature is left out: `date_long` (`{d} {month} {y}`) and `month_01` to `month_12` (without them the date is `2026-11-14`), `date_month_year` (`{month} {y}`), `reading_time` (`{n} min read`), and `post_older`, `post_newer` and `post_nav` for the links between posts. The archive uses `archive_h` in its template and, optionally, `archive_up`.
|
||||
|
|
|
|||
Loading…
Reference in a new issue