From da498c7c5fb2d7dc129ba59b85c106967df6143c Mon Sep 17 00:00:00 2001 From: kyle Date: Mon, 30 Jan 2017 10:37:27 -0500 Subject: [PATCH] Simplify documentation. Change to snake_case. Use Path instead of adding URL. --- README.md | 10 ++++------ lib/template.html | 6 +++--- spec/jekyll_seo_tag_spec.rb | 8 ++++---- 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index f04550e..06a5c89 100644 --- a/README.md +++ b/README.md @@ -185,27 +185,25 @@ The following options can be set for any particular page. While the default opti * `name` - If the name of the thing that the page represents is different from the page title. (i.e.: "Frank's Café" vs "Welcome to Frank's Café") * `type` - The type of things that the page represents. This must be a [Schema.org type](http://schema.org/docs/schemas.html), and will probably usually be something like [`BlogPosting`](http://schema.org/BlogPosting), [`NewsArticle`](http://schema.org/NewsArticle), [`Person`](http://schema.org/Person), [`Organization`](http://schema.org/Organization), etc. * `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. - * `dateModified` - An override for the `dateModified` field in the JSON-LD output. Useful when the file timestamp does not match the true time that the content was modified. - * `author` - The `author` field will match the JSON-LD author output where applicable. + * `date_modified` - An override for the `dateModified` field in the JSON-LD output. Useful when the file timestamp does not match the true time that the content was modified. ### Customizing image output For most users, setting `image: [path-to-image]` on a per-page basis should be enough. If you need more control over how images are represented, the `image` property can also be an object, with the following options: * `path` - The relative path to the image. Same as `image: [path-to-image]` -* `url` - The path to the image to be used in the JSON-LD image object `url`. * `twitter` - The relative path to a Twitter-specific image. * `facebook` - The relative path to a Facebook-specific image. * `height` - The height of the Facebook (`og:image`) image and JSON-LD image object. * `width` - The width of the Facebook (`og:image`) image and JSON-LD image object. -The JSON-LD will default to the `image: ` tag unless `url: ` `height: ` and `width: `. +The JSON-LD will default to the `image: ` tag unless `path: ` `height: ` and `width: `. You can use any of the above, optional properties, like so: ```yml image: - url: /img/banner.png + path: /img/banner.png twitter: /img/twitter.png facebook: /img/facebook.png height: 100 @@ -216,7 +214,7 @@ Or if you have no site specific images simply: ```yml image: - url: /img/banner.png + path: /img/banner.png height: 100 width: 100 ``` diff --git a/lib/template.html b/lib/template.html index eddc637..cf4c885 100644 --- a/lib/template.html +++ b/lib/template.html @@ -89,7 +89,7 @@ {% endif %} {% if page.image %} - {% assign seo_page_image = page.image.path | default: page.image.url | default: page.image.facebook | default: page.image %} + {% assign seo_page_image = page.image.path | default: page.image.facebook | default: page.image %} {% unless seo_page_image contains "://" %} {% assign seo_page_image = seo_page_image | absolute_url %} {% endunless %} @@ -230,8 +230,8 @@ "datePublished": {{ page.date | date_to_xmlschema | jsonify }}, {% endif %} -{% if page.dateModified %} - "dateModified": {{ page.dateModified | date_to_xmlschema | jsonify }}, +{% if page.date_modified %} + "dateModified": {{ page.date_modified | date_to_xmlschema | jsonify }}, {% elsif page.date %} "dateModified": {{ page.date | date_to_xmlschema | jsonify }}, {% endif %} diff --git a/spec/jekyll_seo_tag_spec.rb b/spec/jekyll_seo_tag_spec.rb index 6ffbf4f..7a391c4 100644 --- a/spec/jekyll_seo_tag_spec.rb +++ b/spec/jekyll_seo_tag_spec.rb @@ -196,10 +196,10 @@ describe Jekyll::SeoTag do end end - context "with image.url, image.height, and image.width" do + context "with image.path, image.height, and image.width" do let(:meta) do { - "image" => { "url" => "/img/banner.png", "height" => 1, "width" => 2 }, + "image" => { "path" => "/img/banner.png", "height" => 1, "width" => 2 }, "url" => "http://example.invalid" } end @@ -212,10 +212,10 @@ describe Jekyll::SeoTag do end end - context "with image.url only" do + context "with image.path only" do let(:meta) do { - "image" => { "url" => "/img/banner.png" }, + "image" => { "path" => "/img/banner.png" }, "url" => "http://example.invalid" } end