Skip to content

Instantly share code, notes, and snippets.

@candidexmedia
Last active July 18, 2023 02:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save candidexmedia/8d9b237f68a77f715b48c5ff5f24513f to your computer and use it in GitHub Desktop.
Save candidexmedia/8d9b237f68a77f715b48c5ff5f24513f to your computer and use it in GitHub Desktop.
[Publii] Post Modification Date – Manual Editing

(Response to: https://forum.getpublii.com/topic/post-modification-date-manual-editing/)

Just wanted to chime in on this topic:

You can modify the post mod date -- just not in the UI. You'll just need to edit the db.sqlite file in your site folder. I use SQLiteStudio. It looks like the modified_at value is based on Unix Time (from what I gathered with ChatGPT).

Tomasz Dziuda wrote:

you can use custom modification which will allow you to use custom field with modification date to display, instead of the one generated by Publii

This is a great suggestion Tomasz, although, the Theme Settings API seems to be missing a date picker (unless <input type="date"> is undocumented)...

catandmouse wrote:

(Currently Publii does not give the user a choice as far as I’m aware to enable or disable the post modification date from being displayed in the metadata.)

"Display last updated date" can be disabled from individual "Post Settings" and "Site Settings", so that they don't appear on the page.

In terms of ld+json data: You can create a theme override, remove the {{jsonLD}} helper from the "head.hbs" partial, and rebuild it yourself using tags and helpers. You'll be able to set your own modification date (likely using the Theme Settings API -> again, a date picker would be helpful).

It's not the most straightforward approach, but it's something.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment