From 27fcd3f61803fcff038b0f30da3d57c8acbe786f Mon Sep 17 00:00:00 2001 From: Luc Sarzyniec <devel@olbat.net> Date: Fri, 15 Sep 2017 17:03:18 +0200 Subject: [PATCH 1/3] Make Travis CI flush Cloudflare's cache after deploying --- .travis.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.travis.yml b/.travis.yml index 37166d9f..c9463b2b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,3 +26,8 @@ jobs: local_dir: _site/ on: branch: source + after_deploy: # flush Cloudflare's cache + - curl -X DELETE "https://api.cloudflare.com/client/v4/zones/${CLOUDFLARE_ZONEID/purge_cache" \ + -H "X-Auth-Email: ${CLOUDFLARE_USER}" \ + -H "X-Auth-Key: ${CLOUDFLARE_TOKEN}" \ + -H "Content-Type: application/json" --data '{"purge_everything":true}' From 8d72ce6ab6ff0b52e9b27f2eddfa00e4128f6f1a Mon Sep 17 00:00:00 2001 From: Luc Sarzyniec <devel@olbat.net> Date: Fri, 15 Sep 2017 08:10:18 +0200 Subject: [PATCH 2/3] Add positions to ItemLists --- _includes/structured_data/coding.json | 10 +++-- _includes/structured_data/identities.json | 44 +++++++++++++------- _includes/structured_data/research.json | 41 +++++++++++------- _includes/structured_data/research/doc.json | 46 +++++++++++---------- 4 files changed, 86 insertions(+), 55 deletions(-) diff --git a/_includes/structured_data/coding.json b/_includes/structured_data/coding.json index 773108a5..b369a573 100644 --- a/_includes/structured_data/coding.json +++ b/_includes/structured_data/coding.json @@ -1,13 +1,14 @@ { "@type": "ItemList", - "name": "{{page.title}}", - "itemListOrder": "http://schema.org/ItemListUnordered", + "itemListOrder": "http://schema.org/ItemListOrderAscending", "itemListElement": [ +{% assign counter = 1 %} {%- for repository in site.github.public_repositories %} {%- for project in include.data.projects %} {%- if project.repositories contains repository.name %} { "@type": "ListItem", + "position": {{counter}}, "item": { "@type": "SoftwareSourceCode", "name": "{{repository.name}}", @@ -21,9 +22,12 @@ "url": "{{repository.html_url}}" } }, + {% assign counter = counter | plus: 1 %} {%- endif %} {%- endfor %} {%- endfor %} {} - ] + ], + {% assign counter = counter | minus: 1 %} + "numberOfItems": {{counter}} } diff --git a/_includes/structured_data/identities.json b/_includes/structured_data/identities.json index 110552a4..f7e282f9 100644 --- a/_includes/structured_data/identities.json +++ b/_includes/structured_data/identities.json @@ -1,29 +1,41 @@ { "@type": "ItemList", - "name": "{{page.title}}", - "itemListOrder": "http://schema.org/ItemListUnordered", + "itemListOrder": "http://schema.org/ItemListOrderAscending", "itemListElement": [ + {% assign counter = 1 %} {% for profile in include.data.profiles -%} { - "@type": "ProfilePage", - "name": "{{profile.id}}", - "author": { "@id": "{{site.url}}/#person" }, - {%- if profile.name %}"description": "{{profile.name}}",{% endif %} - "url": "{{profile.url}}", - "relatedLink": "{{site.url}}", - "specialty": { - "@type": "Specialty", - "name": "{{profile.type | capitalize}}" + "@type": "ListItem", + "position": {{counter}}, + "item": { + "@type": "ProfilePage", + "name": "{{profile.id}}", + "author": { "@id": "{{site.url}}/#person" }, + {%- if profile.name %}"description": "{{profile.name}}",{% endif %} + "url": "{{profile.url}}", + "relatedLink": "{{site.url}}", + "specialty": { + "@type": "Specialty", + "name": "{{profile.type | capitalize}}" + } } }, + {% assign counter = counter | plus: 1 %} {% endfor -%} {%- for website in include.data.websites -%} { - "@type": "Website", - "name": "{{website.name}}", - "author": { "@id": "{{site.url}}/#person" }, - "url": "{{website.url}}" + "@type": "ListItem", + "position": {{counter}}, + "item": { + "@type": "Website", + "name": "{{website.name}}", + "author": { "@id": "{{site.url}}/#person" }, + "url": "{{website.url}}" + } }{% unless forloop.last %},{% endunless %} + {% assign counter = counter | plus: 1 %} {% endfor -%} - ] + ], + {% assign counter = counter | minus: 1 %} + "numberOfItems": {{counter}} } diff --git a/_includes/structured_data/research.json b/_includes/structured_data/research.json index 7c2e0ca7..981fcf34 100644 --- a/_includes/structured_data/research.json +++ b/_includes/structured_data/research.json @@ -1,35 +1,46 @@ { "@type": "ItemList", - "name": "{{page.title}}", - "itemListOrder": "http://schema.org/ItemListUnordered", + "itemListOrder": "http://schema.org/ItemListOrderAscending", "itemListElement": [ + {% assign counter = 1 %} {%- for doc in include.data.papers %} - {% include structured_data/research/doc.json type="ScholarlyArticle" doc=doc %} + {% include structured_data/research/doc.json type="ScholarlyArticle" doc=doc pos=counter %} {%- unless forloop.last %},{% endunless -%} + {% assign counter = counter | plus: 1 %} {%- endfor -%}, {%- for doc in include.data.posters %} - {% include structured_data/research/doc.json type="CreativeWork" doc=doc %} + {% include structured_data/research/doc.json type="CreativeWork" doc=doc pos=counter %} {%- unless forloop.last %},{% endunless -%} + {% assign counter = counter | plus: 1 %} {%- endfor -%}, {%- for doc in include.data.slides %} - {% include structured_data/research/doc.json type="CreativeWork" doc=doc %} + {% include structured_data/research/doc.json type="CreativeWork" doc=doc pos=counter %} {%- unless forloop.last %},{% endunless -%} + {% assign counter = counter | plus: 1 %} {%- endfor -%}, {%- for doc in include.data.misc %} - {% include structured_data/research/doc.json type="CreativeWork" doc=doc %} + {% include structured_data/research/doc.json type="CreativeWork" doc=doc pos=counter %} {%- unless forloop.last %},{% endunless -%} + {% assign counter = counter | plus: 1 %} {%- endfor -%}, {%- for project in include.data.projects %} { - "@type": "SoftwareApplication", - "name": "{{project.name}}", - "contributor": { "@id": "{{site.url}}/#person" }, - "description": "{{project.description}}", - "license": "{{project.license}}", - "operatingSystem": "Unix-like", - "applicationCategory": "Other", - "url": "{{project.url}}" + "@type": "ListItem", + "position": {{counter}}, + "item": { + "@type": "SoftwareApplication", + "name": "{{project.name}}", + "contributor": { "@id": "{{site.url}}/#person" }, + "description": "{{project.description}}", + "license": "{{project.license}}", + "operatingSystem": "Unix-like", + "applicationCategory": "Other", + "url": "{{project.url}}" + } }{% unless forloop.last %},{% endunless %} + {% assign counter = counter | plus: 1 %} {%- endfor -%} - ] + ], + {% assign counter = counter | minus: 1 %} + "numberOfItems": {{counter}} } diff --git a/_includes/structured_data/research/doc.json b/_includes/structured_data/research/doc.json index 6c2b6e87..526cdf4e 100644 --- a/_includes/structured_data/research/doc.json +++ b/_includes/structured_data/research/doc.json @@ -1,24 +1,28 @@ { - "@type": "{{include.type}}", - "name": "{{include.doc.title}}", - "contributor": { "@id": "{{site.url}}/#person" }, - "headline": "{% if include.doc.description %}{{include.doc.description | json}}{% else %}{{include.doc.title}}{% endif %}", - {% if include.doc.identifier %}"identifier": "{{include.doc.identifier | json}}",{% endif %} - {% if include.doc.target.date %}"datePublished": "{{include.doc.target.date}}",{% endif %} - "image": "{{include.doc.file | absolute_url}}", - "url": "{{include.doc.file | absolute_url}}", - {% if include.doc.url %}"sameAs": "{{include.doc.url}}",{% endif %} - "publication": { - "name": "{{include.doc.target.name}}", - {% if include.doc.target.description %}"description": "{{include.doc.target.description | json}}",{% endif %} - {% if include.doc.target.date %}"startDate": "{{include.doc.target.date}}",{% endif %} - {% if include.doc.target.location -%} - "location": { - "@type": "Place", - "name": "{{include.doc.target.location}}" - }, - {% endif %} - {% if include.doc.target.url %}"url": "{{include.doc.target.url}}",{% endif %} - "@type": "PublicationEvent" + "@type": "ListItem", + "position": {{include.pos}}, + "item": { + "@type": "{{include.type}}", + "name": "{{include.doc.title}}", + "contributor": { "@id": "{{site.url}}/#person" }, + "headline": "{% if include.doc.description %}{{include.doc.description | json}}{% else %}{{include.doc.title}}{% endif %}", + {% if include.doc.identifier %}"identifier": "{{include.doc.identifier | json}}",{% endif %} + {% if include.doc.target.date %}"datePublished": "{{include.doc.target.date}}",{% endif %} + "image": "{{include.doc.file | absolute_url}}", + "url": "{{include.doc.file | absolute_url}}", + {% if include.doc.url %}"sameAs": "{{include.doc.url}}",{% endif %} + "publication": { + "name": "{{include.doc.target.name}}", + {% if include.doc.target.description %}"description": "{{include.doc.target.description | json}}",{% endif %} + {% if include.doc.target.date %}"startDate": "{{include.doc.target.date}}",{% endif %} + {% if include.doc.target.location -%} + "location": { + "@type": "Place", + "name": "{{include.doc.target.location}}" + }, + {% endif %} + {% if include.doc.target.url %}"url": "{{include.doc.target.url}}",{% endif %} + "@type": "PublicationEvent" + } } } From a8d90bd3dbec2e80bc469084b46e87cff38e3f22 Mon Sep 17 00:00:00 2001 From: Luc Sarzyniec <devel@olbat.net> Date: Fri, 15 Sep 2017 08:51:00 +0200 Subject: [PATCH 3/3] Use arrays instead of ItemLists in mainEntity fields --- _includes/structured_data/coding.json | 44 +++++--------- _includes/structured_data/identities.json | 66 ++++++++------------- _includes/structured_data/research.json | 44 +++++--------- _includes/structured_data/research/doc.json | 46 +++++++------- 4 files changed, 76 insertions(+), 124 deletions(-) diff --git a/_includes/structured_data/coding.json b/_includes/structured_data/coding.json index b369a573..1d2a1f91 100644 --- a/_includes/structured_data/coding.json +++ b/_includes/structured_data/coding.json @@ -1,33 +1,21 @@ -{ - "@type": "ItemList", - "itemListOrder": "http://schema.org/ItemListOrderAscending", - "itemListElement": [ -{% assign counter = 1 %} +[ {%- for repository in site.github.public_repositories %} {%- for project in include.data.projects %} - {%- if project.repositories contains repository.name %} - { - "@type": "ListItem", - "position": {{counter}}, - "item": { - "@type": "SoftwareSourceCode", - "name": "{{repository.name}}", - "contributor": { "@id": "{{site.url}}/#person" }, - "description": "{{repository.description | json}}", - "genre": "{{project.group}}", - "programmingLanguage": "{{repository.language}}", - "dateModified": "{{repository.pushed_at}}", - "codeRepository": "{{repository.git_url}}", - "license": "GPLv3", - "url": "{{repository.html_url}}" - } - }, - {% assign counter = counter | plus: 1 %} - {%- endif %} + {%- if project.repositories contains repository.name %} + { + "@type": "SoftwareSourceCode", + "name": "{{repository.name}}", + "contributor": { "@id": "{{site.url}}/#person" }, + "description": "{{repository.description | json}}", + "genre": "{{project.group}}", + "programmingLanguage": "{{repository.language}}", + "dateModified": "{{repository.pushed_at}}", + "codeRepository": "{{repository.git_url}}", + "license": "GPLv3", + "url": "{{repository.html_url}}" + }, + {%- endif %} {%- endfor %} {%- endfor %} {} - ], - {% assign counter = counter | minus: 1 %} - "numberOfItems": {{counter}} -} +] diff --git a/_includes/structured_data/identities.json b/_includes/structured_data/identities.json index f7e282f9..e0466557 100644 --- a/_includes/structured_data/identities.json +++ b/_includes/structured_data/identities.json @@ -1,41 +1,25 @@ -{ - "@type": "ItemList", - "itemListOrder": "http://schema.org/ItemListOrderAscending", - "itemListElement": [ - {% assign counter = 1 %} - {% for profile in include.data.profiles -%} - { - "@type": "ListItem", - "position": {{counter}}, - "item": { - "@type": "ProfilePage", - "name": "{{profile.id}}", - "author": { "@id": "{{site.url}}/#person" }, - {%- if profile.name %}"description": "{{profile.name}}",{% endif %} - "url": "{{profile.url}}", - "relatedLink": "{{site.url}}", - "specialty": { - "@type": "Specialty", - "name": "{{profile.type | capitalize}}" - } - } - }, - {% assign counter = counter | plus: 1 %} - {% endfor -%} - {%- for website in include.data.websites -%} - { - "@type": "ListItem", - "position": {{counter}}, - "item": { - "@type": "Website", - "name": "{{website.name}}", - "author": { "@id": "{{site.url}}/#person" }, - "url": "{{website.url}}" - } - }{% unless forloop.last %},{% endunless %} - {% assign counter = counter | plus: 1 %} - {% endfor -%} - ], - {% assign counter = counter | minus: 1 %} - "numberOfItems": {{counter}} -} +[ +{% for profile in include.data.profiles -%} + { + "@type": "ProfilePage", + "name": "{{profile.id}}", + "author": { "@id": "{{site.url}}/#person" }, + {%- if profile.name %}"description": "{{profile.name}}",{% endif %} + "url": "{{profile.url}}", + "relatedLink": "{{site.url}}", + "specialty": { + "@type": "Specialty", + "name": "{{profile.type | capitalize}}" + } + }, +{% endfor -%} +{%- for website in include.data.websites -%} + { + "@type": "Website", + "name": "{{website.name}}", + "author": { "@id": "{{site.url}}/#person" }, + "url": "{{page.url | absolute_url}}#item-{{counter}}", + "sameAs": "{{website.url}}" + }{% unless forloop.last %},{% endunless %} +{% endfor -%} +] diff --git a/_includes/structured_data/research.json b/_includes/structured_data/research.json index 981fcf34..8b3d1c46 100644 --- a/_includes/structured_data/research.json +++ b/_includes/structured_data/research.json @@ -1,46 +1,30 @@ -{ - "@type": "ItemList", - "itemListOrder": "http://schema.org/ItemListOrderAscending", - "itemListElement": [ - {% assign counter = 1 %} +[ {%- for doc in include.data.papers %} - {% include structured_data/research/doc.json type="ScholarlyArticle" doc=doc pos=counter %} + {% include structured_data/research/doc.json type="ScholarlyArticle" doc=doc %} {%- unless forloop.last %},{% endunless -%} - {% assign counter = counter | plus: 1 %} {%- endfor -%}, {%- for doc in include.data.posters %} - {% include structured_data/research/doc.json type="CreativeWork" doc=doc pos=counter %} + {% include structured_data/research/doc.json type="CreativeWork" doc=doc %} {%- unless forloop.last %},{% endunless -%} - {% assign counter = counter | plus: 1 %} {%- endfor -%}, {%- for doc in include.data.slides %} - {% include structured_data/research/doc.json type="CreativeWork" doc=doc pos=counter %} + {% include structured_data/research/doc.json type="CreativeWork" doc=doc %} {%- unless forloop.last %},{% endunless -%} - {% assign counter = counter | plus: 1 %} {%- endfor -%}, {%- for doc in include.data.misc %} - {% include structured_data/research/doc.json type="CreativeWork" doc=doc pos=counter %} + {% include structured_data/research/doc.json type="CreativeWork" doc=doc %} {%- unless forloop.last %},{% endunless -%} - {% assign counter = counter | plus: 1 %} {%- endfor -%}, {%- for project in include.data.projects %} { - "@type": "ListItem", - "position": {{counter}}, - "item": { - "@type": "SoftwareApplication", - "name": "{{project.name}}", - "contributor": { "@id": "{{site.url}}/#person" }, - "description": "{{project.description}}", - "license": "{{project.license}}", - "operatingSystem": "Unix-like", - "applicationCategory": "Other", - "url": "{{project.url}}" - } + "@type": "SoftwareApplication", + "name": "{{project.name}}", + "contributor": { "@id": "{{site.url}}/#person" }, + "description": "{{project.description}}", + "license": "{{project.license}}", + "operatingSystem": "Unix-like", + "applicationCategory": "Other", + "url": "{{project.url}}" }{% unless forloop.last %},{% endunless %} - {% assign counter = counter | plus: 1 %} {%- endfor -%} - ], - {% assign counter = counter | minus: 1 %} - "numberOfItems": {{counter}} -} +] diff --git a/_includes/structured_data/research/doc.json b/_includes/structured_data/research/doc.json index 526cdf4e..6c2b6e87 100644 --- a/_includes/structured_data/research/doc.json +++ b/_includes/structured_data/research/doc.json @@ -1,28 +1,24 @@ { - "@type": "ListItem", - "position": {{include.pos}}, - "item": { - "@type": "{{include.type}}", - "name": "{{include.doc.title}}", - "contributor": { "@id": "{{site.url}}/#person" }, - "headline": "{% if include.doc.description %}{{include.doc.description | json}}{% else %}{{include.doc.title}}{% endif %}", - {% if include.doc.identifier %}"identifier": "{{include.doc.identifier | json}}",{% endif %} - {% if include.doc.target.date %}"datePublished": "{{include.doc.target.date}}",{% endif %} - "image": "{{include.doc.file | absolute_url}}", - "url": "{{include.doc.file | absolute_url}}", - {% if include.doc.url %}"sameAs": "{{include.doc.url}}",{% endif %} - "publication": { - "name": "{{include.doc.target.name}}", - {% if include.doc.target.description %}"description": "{{include.doc.target.description | json}}",{% endif %} - {% if include.doc.target.date %}"startDate": "{{include.doc.target.date}}",{% endif %} - {% if include.doc.target.location -%} - "location": { - "@type": "Place", - "name": "{{include.doc.target.location}}" - }, - {% endif %} - {% if include.doc.target.url %}"url": "{{include.doc.target.url}}",{% endif %} - "@type": "PublicationEvent" - } + "@type": "{{include.type}}", + "name": "{{include.doc.title}}", + "contributor": { "@id": "{{site.url}}/#person" }, + "headline": "{% if include.doc.description %}{{include.doc.description | json}}{% else %}{{include.doc.title}}{% endif %}", + {% if include.doc.identifier %}"identifier": "{{include.doc.identifier | json}}",{% endif %} + {% if include.doc.target.date %}"datePublished": "{{include.doc.target.date}}",{% endif %} + "image": "{{include.doc.file | absolute_url}}", + "url": "{{include.doc.file | absolute_url}}", + {% if include.doc.url %}"sameAs": "{{include.doc.url}}",{% endif %} + "publication": { + "name": "{{include.doc.target.name}}", + {% if include.doc.target.description %}"description": "{{include.doc.target.description | json}}",{% endif %} + {% if include.doc.target.date %}"startDate": "{{include.doc.target.date}}",{% endif %} + {% if include.doc.target.location -%} + "location": { + "@type": "Place", + "name": "{{include.doc.target.location}}" + }, + {% endif %} + {% if include.doc.target.url %}"url": "{{include.doc.target.url}}",{% endif %} + "@type": "PublicationEvent" } }