PeanutBase / jekyll-peanutbase

A "starter" Jekyll site that uses the jekyll-theme-legumeinfo submodule
Apache License 2.0
0 stars 0 forks source link

Add (and review) News items from current site #7

Closed svengato closed 1 year ago

svengato commented 2 years ago

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.

sdash-github commented 2 years ago

Can the news page look like the older news page, i.e., with news items expanded?

svengato commented 2 years ago

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.]

svengato commented 1 year ago

The News items function as expected, are we ready to close this issue?

sdash-github commented 1 year ago

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.

svengato commented 1 year ago

Made some progress on this, but I think it will require converting markdown to HTML on the fly.

svengato commented 1 year ago

{{ post.content | markdownify }} seems to work. Let me know what you think, https://dev.peanutbase.org/news

sdash-github commented 1 year ago

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.

svengato commented 1 year ago

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)

svengato commented 1 year ago

One more question: as this change affects only the theme, do we leave it uncommitted?

sdash-github commented 1 year ago

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....'.

svengato commented 1 year ago

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).

svengato commented 1 year ago

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.

  1. We want to change only the News layout, _layouts/news.html, so
    mkdir _layouts
    cp _themes/jekyll-theme-legumeinfo/_layouts/news.html _layouts/.
  2. Then 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
  1. Rebuild the PeanutBase site, then test the News page. https://dev.peanutbase.org/news/
svengato commented 1 year ago

Done, in commit 93f8cc8.