Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Last Modified Datetime to Meta #136

Closed
ghost opened this issue Feb 28, 2017 · 6 comments
Closed

Add Last Modified Datetime to Meta #136

ghost opened this issue Feb 28, 2017 · 6 comments

Comments

@ghost
Copy link

ghost commented Feb 28, 2017

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

@TWiStErRob
Copy link
Contributor

Is this plugin whitelisted in gh-pages?

@ghost
Copy link
Author

ghost commented Feb 28, 2017

@TWiStErRob
Copy link
Contributor

So, that's a no... I don't think it's worth dropping pages support for this.

@ghost
Copy link
Author

ghost commented Mar 1, 2017

https://github.com/jekyll/jekyll-seo-tag/pull/151/files#r103643150

@ghost
Copy link
Author

ghost commented Mar 1, 2017

@pathawks weighed, suggestion GH pages may never be able to support the Last-Modified-At gem. Maybe we'll see some kind of support built into Jekyll in the future, otherwise it can be achieved via front matter for those who are interested. That said, I'm using it currently with CloudCannon on the ChicagoGangHistory website and it works gloriously.

Ref: github/pages-gem#119

@ghost ghost closed this as completed Mar 1, 2017
@ghost
Copy link
Author

ghost commented Mar 1, 2017

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants