Skip to content

Commit

Permalink
Move JSON-LD from _config.yml to _data/lesson.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
rgaiacs committed Dec 20, 2018
1 parent 521fa60 commit b13ce0d
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 32 deletions.
16 changes: 0 additions & 16 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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).
#------------------------------------------------------------
Expand Down
15 changes: 15 additions & 0 deletions _data/lesson.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion _includes/episode_navbar.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ <h3 class="text-left">
</div>
<div class="col-xs-10">
{% if include.episode_navbar_title %}
<h3 class="maintitle"><a href="{{ relative_root_path }}/">{{ site.title }}</a></h3>
<h3 class="maintitle"><a href="{{ relative_root_path }}/">{{ site.data.lesson.title }}</a></h3>
{% endif %}
</div>
<div class="col-xs-1">
Expand Down
2 changes: 1 addition & 1 deletion _includes/favicons.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<link rel="icon" type="image/png" href="{{ favicon_url }}/favicon-32x32.png" sizes="32x32" />
<link rel="icon" type="image/png" href="{{ favicon_url }}/favicon-16x16.png" sizes="16x16" />
<link rel="icon" type="image/png" href="{{ favicon_url }}/favicon-128.png" sizes="128x128" />
<meta name="application-name" content="{{ carpentry }} - {{ site.title }}"/>
<meta name="application-name" content="{{ carpentry }} - {{ site.data.lesson.title }}"/>
<meta name="msapplication-TileColor" content="#FFFFFF" />
<meta name="msapplication-TileImage" content="{{ favicon_url }}/mstile-144x144.png" />
<meta name="msapplication-square70x70logo" content="{{ favicon_url }}/mstile-70x70.png" />
Expand Down
2 changes: 1 addition & 1 deletion _includes/main_title.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

{% include base_path.html %}

<h1 class="maintitle"><a href="{{ relative_root_path }}{% link index.md %}">{{ site.title }}</a>{% if page.title %}: {{ page.title }}{% endif %}</h1>
<h1 class="maintitle"><a href="{{ relative_root_path }}{% link index.md %}">{{ site.data.lesson.title }}</a>{% if page.title %}: {{ page.title }}{% endif %}</h1>
24 changes: 12 additions & 12 deletions _includes/schema_org.html
Original file line number Diff line number Diff line change
Expand Up @@ -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}}"
}
</script>
</script>
3 changes: 2 additions & 1 deletion _layouts/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<title>{{ site.title }}{% if page.title %}: {{ page.title }}{% endif %}</title>
<title>{{ site.data.lesson.title }}{% if page.title %}: {{ page.title }}{% endif %}</title>
{% include schema_org.html %}
</head>
<body>

Expand Down

0 comments on commit b13ce0d

Please sign in to comment.