Skip to content

Commit 521fa60

Browse files
njallrgaiacs
authored andcommitted
Added lesson metadata and schema.org JSON-LD rendering
1 parent d9031b2 commit 521fa60

File tree

3 files changed

+53
-0
lines changed

3 files changed

+53
-0
lines changed

_config.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,19 @@ carpentry: "cp"
1212
# Overall title for pages.
1313
title: "Lesson Title"
1414

15+
#Metadata
16+
# 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
17+
description: "This is the template description. Keep me brief (2-3 sentences)"
18+
keywords: GitHub, Forking, Collaborative # see: https://schema.org/keywords
19+
audience: [PostDoc students, Early Career Researchers] # see: https://schema.org/audience
20+
license: "https://creativecommons.org/licenses/by/3.0/" # see: schema.org/license
21+
author: [Homer Simpson, Ned Flanders] # see: https://schema.org/author
22+
contributor: [Barney Gumball, Dr Nick Riviera] # see: https://schema.org/contributor
23+
timeRequired: "1 hour" # see: https://schema.org/timeRequired
24+
learningResourceType: "lesson plan" # see: https://schema.org/learningResourceType
25+
citation: "How to cite a Training Material, John Smith et al, 2015" # see: https://schema.org/citation
26+
dateCreated: 2016-05-01
27+
1528
#------------------------------------------------------------
1629
# Generic settings (should not need to change).
1730
#------------------------------------------------------------

_includes/schema_org.html

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<!-- Schema.org annotations in JSON-LD for a CreativeWork type.
2+
Variables should be declared in the .md file
3+
For full list of available attributes see https://schema.org/CreativeWork -->
4+
<script type="application/ld+json">
5+
{
6+
"@context": "http://schema.org/",
7+
"@type": "creativeWork",
8+
"genre": "trainingMaterial",
9+
"name": "{{site.title}}",
10+
"description": "{{site.description}}",
11+
"keywords": "{{site.keywords}}",
12+
"audience": [
13+
{% for audience in site.audience %}{
14+
"@type": "Audience",
15+
"name": "{{audience}}"
16+
}{% if forloop.last %}{%else%},{%endif%}
17+
{% endfor %}
18+
],
19+
"license": "{{site.licence}}",
20+
"author": [
21+
{% for author in site.author %}{
22+
"@type": "Person",
23+
"name": "{{author}}"
24+
}{% if forloop.last %}{%else%},{%endif%}
25+
{% endfor %}
26+
],
27+
"contributor": [
28+
{% for contributor in site.contributor %}{
29+
"@type": "Person",
30+
"name": "{{contributor}}"
31+
}{% if forloop.last %}{%else%},{%endif%}
32+
{% endfor %}
33+
],
34+
"timeRequired": "{{site.timeRequired}}",
35+
"learningResourceType": "{{site.learningResourceType}}",
36+
"citation": "{{site.citation}}",
37+
"dateCreated" : "{{site.dateCreated}}"
38+
}
39+
</script>

_layouts/lesson.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
layout: base
33
---
44
{% include main_title.html %}
5+
{% include schema_org.html %}
56
<article>
67
{{ content }}
78
</article>

0 commit comments

Comments
 (0)