Closed svengato closed 1 year ago
Can the news page look like the older news page, i.e., with news items expanded?
This format is set in the theme, so changing or overriding it is not trivial.
[Update on 19 December - it is pretty simple, see below.]
The News items function as expected, are we ready to close this issue?
Only one functionality "if it is doable". The MORE NEWS ideally should look like https://peanutbase.org/news_page_all where the contents are listed below the title of each month's news item.
Made some progress on this, but I think it will require converting markdown to HTML on the fly.
{{ post.content | markdownify }}
seems to work. Let me know what you think,
https://dev.peanutbase.org/news
Perfect! Now it is working like legacy news pages per expectation at https://github.com/PeanutBase/jekyll-peanutbase/issues/7#issuecomment-1339733482. May close the issue if no more work is needed for now.
My only question is whether the current format
<dd>{{ post.summary }}</dd>
<dd>{{ post.content | markdownify }}</dd>
is too repetitive. Should we drop the summary line? (that is, replace summary with content)
One more question: as this change affects only the theme, do we leave it uncommitted?
Looks like leaving it uncommitted makes me unable to reproduce it in my local docker version! I am guessing this is the reason why my local version doesn't show the news as it does in dev.peanutbase although botha are at 'd0d3ba....'.
That is correct. For now, just add that second line to _layouts/news.html.
We can discuss whether jekyll-theme-legumeinfo should work this way, in which case we can commit it. If not, maybe there should be a jekyll-theme-peanutbase fork (or branch).
Overriding the default Jekyll theme turns out to be very simple, all you do is copy any relevant directories and files from _themes/jekyll-theme-legumeinfo up to the site's home directory (jekyll-peanutbase in our case). Then there is no need to make uncommitted changes to the default theme.
mkdir _layouts
cp _themes/jekyll-theme-legumeinfo/_layouts/news.html _layouts/.
vi _layouts/news.html
and edit as desired. I replaced
{{ post.summary }}
with
{{ post.content | markdownify }}
diff _themes/jekyll-theme-legumeinfo/_layouts/news.html _layouts/news.html
I converted the five most recent News posts, plus an Old News page (news/_posts/2014-12-31-older-news.md) for all of the older news items (2013-2020). At the end of each year, we should move the previous year's posts into Old News, so that the News feed shows articles for "this year and last year" (for example, at the end of 2022 we would archive the 2021 posts and show 2022-2023 posts going forward). Note that this is not as simple as prepending the complete news item text to the Old News file, you have to tweak the headers a bit especially if there are multiple items in a month.
The default number of News items to display is 3, we can change this in _themes/jekyll-theme-legumeinfo/_includes/news-card.html but we may want to leave this uncommitted, as it is part of a submodule.
Many of the links in the old News posts point to the current peanutbase.org site, or to an old interactive tour, or are just obsolete. I fixed a few of the more obvious ones, but it will need further review.