From a29a10125abc39bf0a7145d32db928fa57207a9e Mon Sep 17 00:00:00 2001 From: Raniere Silva Date: Thu, 2 Aug 2018 08:16:50 +0100 Subject: [PATCH] Move JSON-LD from _config.yml to _data/lesson.yml --- _config.yml | 16 ---------------- _data/lesson.yml | 15 +++++++++++++++ _includes/episode_navbar.html | 2 +- _includes/favicons.html | 2 +- _includes/main_title.html | 2 +- _includes/schema_org.html | 24 ++++++++++++------------ _layouts/base.html | 3 ++- _layouts/lesson.html | 1 - 8 files changed, 32 insertions(+), 33 deletions(-) create mode 100644 _data/lesson.yml diff --git a/_config.yml b/_config.yml index 3cda65e6..db6b231d 100644 --- a/_config.yml +++ b/_config.yml @@ -9,22 +9,6 @@ # cp: Carpentries (to use for instructor traning for instance) carpentry: "cp" -# Overall title for pages. -title: "Lesson Title" - -#Metadata -# Here you can add metadata to describe your lesson so that people and search engines can understand what it's about. Please try to use fields from the Schema.org CreativeWork type - https://schema.org/CreativeWork -description: "This is the template description. Keep me brief (2-3 sentences)" -keywords: GitHub, Forking, Collaborative # see: https://schema.org/keywords -audience: [PostDoc students, Early Career Researchers] # see: https://schema.org/audience -license: "https://creativecommons.org/licenses/by/3.0/" # see: schema.org/license -author: [Homer Simpson, Ned Flanders] # see: https://schema.org/author -contributor: [Barney Gumball, Dr Nick Riviera] # see: https://schema.org/contributor -timeRequired: "1 hour" # see: https://schema.org/timeRequired -learningResourceType: "lesson plan" # see: https://schema.org/learningResourceType -citation: "How to cite a Training Material, John Smith et al, 2015" # see: https://schema.org/citation -dateCreated: 2016-05-01 - #------------------------------------------------------------ # Generic settings (should not need to change). #------------------------------------------------------------ diff --git a/_data/lesson.yml b/_data/lesson.yml new file mode 100644 index 00000000..b4dfbc3c --- /dev/null +++ b/_data/lesson.yml @@ -0,0 +1,15 @@ +# Overall title for pages. +title: "Lesson Title" + +#Metadata +# Here you can add metadata to describe your lesson so that people and search engines can understand what it's about. Please try to use fields from the Schema.org CreativeWork type - https://schema.org/CreativeWork +description: "This is the template description. Keep me brief (2-3 sentences)" +keywords: GitHub, Forking, Collaborative # see: https://schema.org/keywords +audience: [PostDoc students, Early Career Researchers] # see: https://schema.org/audience +license: "https://creativecommons.org/licenses/by/3.0/" # see: schema.org/license +author: [Homer Simpson, Ned Flanders] # see: https://schema.org/author +contributor: [Barney Gumball, Dr Nick Riviera] # see: https://schema.org/contributor +timeRequired: "1 hour" # see: https://schema.org/timeRequired +learningResourceType: "lesson plan" # see: https://schema.org/learningResourceType +citation: "How to cite a Training Material, John Smith et al, 2015" # see: https://schema.org/citation +dateCreated: 2016-05-01 diff --git a/_includes/episode_navbar.html b/_includes/episode_navbar.html index c2bc80e8..26ab7fb2 100644 --- a/_includes/episode_navbar.html +++ b/_includes/episode_navbar.html @@ -13,7 +13,7 @@

{% if include.episode_navbar_title %} -

{{ site.title }}

+

{{ site.data.lesson.title }}

{% endif %}
diff --git a/_includes/favicons.html b/_includes/favicons.html index 4ea6742d..b57c7052 100644 --- a/_includes/favicons.html +++ b/_includes/favicons.html @@ -24,7 +24,7 @@ - + diff --git a/_includes/main_title.html b/_includes/main_title.html index d007abae..69b955a7 100644 --- a/_includes/main_title.html +++ b/_includes/main_title.html @@ -1,4 +1,4 @@ {% comment %} Main title for lesson pages. {% endcomment %} -

{{ site.title }}{% if page.title %}: {{ page.title }}{% endif %}

+

{{ site.data.lesson.title }}{% if page.title %}: {{ page.title }}{% endif %}

diff --git a/_includes/schema_org.html b/_includes/schema_org.html index 0a196378..e5c22af9 100644 --- a/_includes/schema_org.html +++ b/_includes/schema_org.html @@ -6,34 +6,34 @@ "@context": "http://schema.org/", "@type": "creativeWork", "genre": "trainingMaterial", - "name": "{{site.title}}", - "description": "{{site.description}}", - "keywords": "{{site.keywords}}", + "name": "{{site.data.lesson.title}}", + "description": "{{site.data.lesson.description}}", + "keywords": "{{site.data.lesson.keywords}}", "audience": [ - {% for audience in site.audience %}{ + {% for audience in site.data.lesson.audience %}{ "@type": "Audience", "name": "{{audience}}" }{% if forloop.last %}{%else%},{%endif%} {% endfor %} ], - "license": "{{site.licence}}", + "license": "{{site.data.lesson.licence}}", "author": [ - {% for author in site.author %}{ + {% for author in site.data.lesson.author %}{ "@type": "Person", "name": "{{author}}" }{% if forloop.last %}{%else%},{%endif%} {% endfor %} ], "contributor": [ - {% for contributor in site.contributor %}{ + {% for contributor in site.data.lesson.contributor %}{ "@type": "Person", "name": "{{contributor}}" }{% if forloop.last %}{%else%},{%endif%} {% endfor %} ], - "timeRequired": "{{site.timeRequired}}", - "learningResourceType": "{{site.learningResourceType}}", - "citation": "{{site.citation}}", - "dateCreated" : "{{site.dateCreated}}" + "timeRequired": "{{site.data.lesson.timeRequired}}", + "learningResourceType": "{{site.data.lesson.learningResourceType}}", + "citation": "{{site.data.lesson.citation}}", + "dateCreated" : "{{site.data.lesson.dateCreated}}" } - \ No newline at end of file + diff --git a/_layouts/base.html b/_layouts/base.html index 99d65674..8c3e1649 100644 --- a/_layouts/base.html +++ b/_layouts/base.html @@ -22,7 +22,8 @@ - {{ site.title }}{% if page.title %}: {{ page.title }}{% endif %} + {{ site.data.lesson.title }}{% if page.title %}: {{ page.title }}{% endif %} +{% include schema_org.html %}
diff --git a/_layouts/lesson.html b/_layouts/lesson.html index b17c3882..7d566cd1 100644 --- a/_layouts/lesson.html +++ b/_layouts/lesson.html @@ -2,6 +2,5 @@ layout: base --- {% include main_title.html %} -{% include schema_org.html %} {{ content }} {% include syllabus.html %}