Skip to content

Commit c1b77e3

Browse files
Add a article:modified_time property for articles
1 parent 1d732cf commit c1b77e3

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

docs/advanced-usage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ The following options can be set for any particular page. While the default opti
110110
* `type` - The type of things that the page represents. This must be a [Schema.org type](https://schema.org/docs/schemas.html), and will probably usually be something like [`BlogPosting`](https://schema.org/BlogPosting), [`NewsArticle`](https://schema.org/NewsArticle), [`Person`](https://schema.org/Person), [`Organization`](https://schema.org/Organization), etc.
111111
* `links` - An array of other URLs that represent the same thing that this page represents. For instance, Jane's bio page might include links to Jane's GitHub and Twitter profiles.
112112
* `date_modified` - Manually specify the `dateModified` field in the JSON-LD output to override Jekyll's own `dateModified`.
113-
This field will take **first priority** for the `dateModified` JSON-LD output. This is useful when the file timestamp does not match the true time that the content was modified. A user may also install [Last Modified At](https://github.com/gjtorikian/jekyll-last-modified-at) which will offer an alternative way of providing for the `dateModified` field.
113+
This field will take **first priority** for the `dateModified` JSON-LD output and the article modification time for Open Graph (`article:modified_time`). This is useful when the file timestamp does not match the true time that the content was modified. A user may also install [Last Modified At](https://github.com/gjtorikian/jekyll-last-modified-at) which will offer an alternative way of providing for the `dateModified` field.
114114

115115
### Customizing image output
116116

lib/template.html

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,12 @@
4242
{% endif %}
4343
{% endif %}
4444

45-
{% if page.date %}
45+
{% if seo_tag.date_published %}
4646
<meta property="og:type" content="article" />
47-
<meta property="article:published_time" content="{{ page.date | date_to_xmlschema }}" />
47+
<meta property="article:published_time" content="{{ seo_tag.date_published | date_to_xmlschema }}" />
48+
{% if seo_tag.date_modified %}
49+
<meta property="article:modified_time" content="{{ seo_tag.date_modified | date_to_xmlschema }}" />
50+
{% endif %}
4851
{% else %}
4952
<meta property="og:type" content="website" />
5053
{% endif %}

0 commit comments

Comments
 (0)