question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add Last Modified Datetime to Meta

See original GitHub issue

Feeling Responsive includes _meta_information.html when show_meta is truthy. Meta information output includes the date with a calendar icon. It would be beneficial for user agents and the Web infrastructure if we also included the last modified time.

Last modified time can be included using the jekyll-last-modified-at gem. Here’s an example update to the meta info include file to incorporate this data when the gem is present (and enabled via config):

{% if page.date %}
  <span class="icon-calendar pr20"> Published: <time datetime="{{ page.date | date_to_xmlschema }}" itemprop="datePublished"> {{ page.date | date: "%Y-%m-%d" }}</time></span>
{% endif %}
{% if page.last_modified_at %}
  <span class="icon-calendar pr20"> Updated: <time datetime="{{ page.last_modified_at | date_to_xmlschema }}" itemprop="datePublished"> {{ page.last_modified_at | date: "%Y-%m-%d" }}</time></span>
{% endif %}

The above looks like this when output:

screen shot 2017-02-28 at 3 15 19 pm

Considerations:

This is a little verbose, mind you, as user agents and readers alike may benefit from conditionally visually displaying one or the other depending on which is available and more recent. In other words, only show one calendar icon and date, specify which it is (one of Published or Last Modified), but output both, if available, to the page (one as meta with microformat data, or using JSON-LD).

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

0reactions
ghostcommented, Mar 1, 2017

I jumped the gun on closing this. I believe the gem may still see GH pages support once some validation occurs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

html - How to insert Last-Modified date in response header?
First you have to add a spring configuration. You can put it in a xml file in \src\main\resources\META-INF\spring <bean id=" ...
Read more >
How to Display the Last Updated Date of Your Posts in ...
The code checks to see if a post's published date and last modified dates are different. If they are, then it displays the...
Read more >
Last Modified Date In Google Search - GeneratePress
The snippet is working as the Post Meta Date is only displaying the Updated Date. One of your plugins, most likely SEO, is...
Read more >
How to show Published date and/or Modified date
This function should be displaying both modified and published dates only if they differ.
Read more >
How To Show Last Updated Date on WordPress Posts and ...
To get rid of the published date but keep the last updated date (previously added from the methods above), go to Appearance >...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found