carpentries / carpentries-hugo-theme

Hugo theme to be used for The Carpentries website
MIT License
0 stars 0 forks source link

"meta" widget is not rendering #12

Closed maneesha closed 2 months ago

maneesha commented 3 months ago

In the sidebar layout, widgets for feedback, meta, and edit-github should display (with others defined in the page's frontmatter). The meta widget is not rendering, resulting in two lines with an empty space in between them in the sidebar.

maneesha commented 2 months ago

I am still seeing the blank space between two lines. See for example this page built from this file.

maneesha commented 2 months ago

See screenshot: Screenshot from 2024-08-09 11-44-03

maneesha commented 2 months ago

Removing "Ready for Review" label as this feature is not yet working.

AdamChlan commented 2 months ago

ready for review

maneesha commented 2 months ago

@AdamChlan I am still seeing the blank space (just like the screenshot above).

Link to netlify preview Link to source

(edit for typo and to add links)

maneesha commented 2 months ago

Also, I noticed that before these changes, some widgets were included on all pages. See the layout here.

Now, only explicitly specified widgets are included. Can we have certain widgets appear on all pages? I don't remember discussing this change.

AdamChlan commented 2 months ago

yes, I can revert that change

AdamChlan commented 2 months ago

This has been reverted, and believe I have the rules working as expected

AdamChlan commented 2 months ago

Also for meta to render you need to add a lastmod parameter with to the front matter like this:

lastmod: 2022-12-11T14:45:08+00:00

maneesha commented 2 months ago

OK,thanks. That is what had been missing - I thought the "last modified" data was automatically updated from the file history. Is that possible to do?

AdamChlan commented 2 months ago

@maneesha yes, this has been adjusted.

maneesha commented 2 months ago

@AdamChlan by "this has been adjusted" did you mean that it should now automatically use the file's last modified date/time? I am only seeing the meta widget render if the lastmod parameter is explicitly set.

maneesha commented 2 months ago

Also, in the source for the meta widget, it looks like if the date format is not set, it should default to the format 2 April, 2006.

If I don't have that param set, I am still getting a long date (like Last edited: 15 April, 2023 at 00:00:00 UTC).

It is also not reading the date correctly. The day and year are interpreted correctly but the month always says April no matter what month I put in. See example in this PR.

regisphilibert commented 2 months ago

@AdamChlan ref month should be January. Should update the theme's hugo.yaml file as well.

+ Last edited: {{ dateFormat (site.Params.date_format_with_time | default "2 January, 2006") . }}
- Last edited: {{ dateFormat (site.Params.date_format_with_time | default "2 April, 2006") . }}
AdamChlan commented 2 months ago

This has been updated

maneesha commented 2 months ago

It looks like the issue with the date always being April has been fixed.

Also want to check about my question above - does the date have to be manually set in the frontmatter or can it be automatically updated from the file history?

AdamChlan commented 2 months ago

@maneesha To have the modified dates pull in from Github, add the following to your projects hugo.yaml file:

enableGitInfo: true

This will completely automate the process so you will not need to add lastmod to the frontmatter

maneesha commented 2 months ago

Setting the enableGitInfo param seems to work. I would like this to show just date, not date-time so I'v put in PR #39.

maneesha commented 2 months ago

This can be closed once #39 is reviewed/merged.