From e40c9aeba6cb95ad0a929729b367865491c8219d Mon Sep 17 00:00:00 2001 From: techmagus <4515248-techmagus@users.noreply.gitlab.com> Date: Sat, 2 Apr 2022 16:43:09 +0800 Subject: [PATCH] migration from github to GitLab --- .gitignore | 22 ++ CITATION.cff | 13 + LICENSE | 21 ++ README.md | 93 +++++++ assets/css/semweb-style.css | 263 ++++++++++++++++++ config.toml | 5 + go.mod | 3 + i18n/en.toml | 53 ++++ layouts/partials/schemas/schema_Article.html | 198 +++++++++++++ .../partials/schemas/schema_ImageObject.html | 137 +++++++++ .../partials/schemas/schema_Organization.html | 87 ++++++ layouts/partials/schemas/schema_Person.html | 87 ++++++ .../partials/schemas/schema_VideoObject.html | 155 +++++++++++ .../partials/schemas/schema_WebContent.html | 46 +++ layouts/partials/schemas/schema_WebPage.html | 120 ++++++++ layouts/partials/schemas/schema_WebSite.html | 128 +++++++++ layouts/partials/schemas/semweb.html | 24 ++ layouts/shortcodes/image.html | 136 +++++++++ layouts/shortcodes/video.html | 163 +++++++++++ theme.toml | 33 +++ 20 files changed, 1787 insertions(+) create mode 100644 .gitignore create mode 100644 CITATION.cff create mode 100644 LICENSE create mode 100644 README.md create mode 100644 assets/css/semweb-style.css create mode 100644 config.toml create mode 100644 go.mod create mode 100644 i18n/en.toml create mode 100644 layouts/partials/schemas/schema_Article.html create mode 100644 layouts/partials/schemas/schema_ImageObject.html create mode 100644 layouts/partials/schemas/schema_Organization.html create mode 100644 layouts/partials/schemas/schema_Person.html create mode 100644 layouts/partials/schemas/schema_VideoObject.html create mode 100644 layouts/partials/schemas/schema_WebContent.html create mode 100644 layouts/partials/schemas/schema_WebPage.html create mode 100644 layouts/partials/schemas/schema_WebSite.html create mode 100644 layouts/partials/schemas/semweb.html create mode 100644 layouts/shortcodes/image.html create mode 100644 layouts/shortcodes/video.html create mode 100644 theme.toml diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..023e098 --- /dev/null +++ b/.gitignore @@ -0,0 +1,22 @@ +# Hugo default output directory +/public + +## OS Files +# Windows +Thumbs.db +ehthumbs.db +Desktop.ini +$RECYCLE.BIN/ + +# OSX +.DS_Store + +.sass-cache + +# IDE config. +.idea + +# SemWeb +schema_CriticReview.html +schema_Global.html +docs/ diff --git a/CITATION.cff b/CITATION.cff new file mode 100644 index 0000000..b56510a --- /dev/null +++ b/CITATION.cff @@ -0,0 +1,13 @@ +cff-version: 1.2.0 +title: Semantic Web for Hugo +version: 1.1.1 +date-released: 2021-12-10 +url: "https://github.com/YourOnly-One/hugo-semantic-web" +doi: 10.5281/zenodo.5771170 +message: "If you use this software, please cite it as below." +type: software +authors: + - family-names: Sese Cuneta + given-names: JC John + affiliation: Yelosan Publishing + orcid: 'https://orcid.org/0000-0003-4755-4548' diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..0a63cfd --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2021 JC John Sese Cuneta +Copyright (c) 2018 Martijn van Dijk + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..85b2f7d --- /dev/null +++ b/README.md @@ -0,0 +1,93 @@ +[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.5771170.svg)](https://doi.org/10.5281/zenodo.5771170) + +# Semantic Web for Hugo +By using JSON-LD and [Schema.org](https://schema.org) vocabulary, **Semantic Web for Hugo** adds *structured data* and *linked data* into a [Hugo](https://gohugo.io)-powered website. Through it, search engines can easily read the data and establish relationships between objects enabling them to intelligently store information about a website and use it to help display the website in search results. + +## Usage +You can download the latest release or add this as a Hugo Module. More information is available in the official [website](https://semweb.youronly.one). + +## Features +These are the supported types: +* Organization ([Schema.org Type](https://schema.org/Organization)) + * Thing > Organization +* Person ([Schema.org Type](https://schema.org/Person)) + * Thing > Person +* WebContent ([Schema.org Type](https://schema.org/WebContent)) + * Thing > CreativeWork > WebContent +* WebSite ([Schema.org Type](https://schema.org/WebSite)) + * Thing > CreativeWork > WebSite +* WebPage ([Schema.org Type](https://schema.org/WebPage)) + * Thing > CreativeWork > WebPage +* Article ([Schema.org Type](https://schema.org/Article)) + * Thing > CreativeWork > Article +* BlogPosting ([Schema.org Type](https://schema.org/BlogPosting)) + * Thing > CreativeWork > Article > SocialMediaPosting > BlogPosting +* ImageObject ([Schema.org Type](https://schema.org/ImageObject)) + * Thing > CreativeWork > MediaObject > ImageObject +* VideoObject ([Schema.org Type](https://schema.org/VideoObject)) + * Thing > CreativeWork > MediaObject > VideoObject + +### ToDo +The following are on the table: + +#### HowTo +* HowTo - [Schema.org Type](https://schema.org/HowTo)) + * Thing > CreativeWork > HowTo +* HowToSection ([Schema.org](https://schema.org/HowToSection)) + * Thing > CreativeWork > HowToSection + * Thing > Intangible > ItemList > HowToSection + * Thing > Intangible > ListItem > HowToSection +* HowToTip ([Schema.org](https://schema.org/HowToTip)) + * Thing > CreativeWork > HowToTip + * Thing > Intangible > ListItem > HowToTip +* HowToStep ([Schema.org](https://schema.org/HowToStep)) + * Thing > CreativeWork > HowToStep + * Thing > Intangible > ItemList > HowToStep + * Thing > Intangible > ListItem > HowToStep +* ListItem ([Schema.org](https://schema.org/ListItem)) + * Thing > Intangible > ListItem + +#### Reviews +* Review ([Schema.org Type](https://schema.org/Review)) + * Thing > CreativeWork > Review +* CriticReview ([Schema.org Type](https://schema.org/CriticReview)) + * Thing > CreativeWork > Review > CriticReview +* TVSeason ([Schema.org Type](https://schema.org/TVSeason)) + * Thing > CreativeWork > TVSeason + * Thing > CreativeWork > CreativeWorkSeason > TVSeason +* TVSeries ([Schema.org Type](https://schema.org/TVSeries)) + * Thing > CreativeWork > TVSeries + * Thing > CreativeWork > CreativeWorkSeries > TVSeries + * Thing > Intangible > Series > CreativeWorkSeries > TVSeries +* Movie ([Schema.org Type](https://schema.org/Movie)) + * Thing > CreativeWork > Movie +* Book ([Schema.org Type](https://schema.org/Book)) + * Thing > CreativeWork > Book + +#### Other types +* ItemList ([Schema.org](https://schema.org/ItemList)) + * Thing > Intangible > ItemList +* BreadcrumbList ([Schema.org Type](https://schema.org/BreadcrumbList)) + * Thing > Intangible > ItemList > BreadcrumbList + +### Under consideration +#### Food and drinks +* Menu ([Schema.org Type](https://schema.org/Menu)) + * Thing > CreativeWork > Menu +* MenuItem ([Schema.org Type](https://schema.org/MenuItem)) + * Thing > Intangible > MenuItem +* Recipe ([Schema.org](https://schema.org/Recipe)) + * Thing > CreativeWork > HowTo > Recipe +* NutritionInformation ([Schema.org](https://schema.org/NutritionInformation)) + * Thing > Intangible > StructuredValue > NutritionInformation + +#### FAQ types +* FAQPage ([Schema.org](https://schema.org/FAQPage)) + * Thing > CreativeWork > WebPage > FAQPage +* QAPage ([Schema.org](https://schema.org/QAPage)) + * Thing > CreativeWork > WebPage > QAPage + +## Attributions +Based on / forked from: +* [HugoStructuredData](https://github.com/Baseflow/HugoStructuredData) by [Baseflow](https://github.com/Baseflow) +* [Structured-Data-JSON-LD](https://github.com/JayHoltslander/Structured-Data-JSON-LD) by [JayHoltslander](https://github.com/JayHoltslander) diff --git a/assets/css/semweb-style.css b/assets/css/semweb-style.css new file mode 100644 index 0000000..ba5dedb --- /dev/null +++ b/assets/css/semweb-style.css @@ -0,0 +1,263 @@ +@charset "UTF-8"; +/*** + * semweb-style.css Copyright © 2021 YourOnly.One + * + * Licenses: [1] MIT/Expat License; [2] MPL v2.0; [3] LGPLv3 + * + * LICENSE: MIT License / Expat License + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * LICENSE: Mozilla Public License Version 2.0 ("MPL 2.0") + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * LICENSE: GNU LESSER GENERAL PUBLIC LICENSE Version 3 ("LGPLv3") + * This program is free software: you can redistribute it and/or modify + * it under the terms of the Lesser GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * Lesser GNU General Public License for more details. + * + * You should have received a copy of the Lesser GNU General Public License + * along with this program. If not, see . +***/ + +/*** + * Other Attributions + * + * Embed Responsively: embedresponsively.com +***/ + +/************************ +** BGN: COMMON CLASSES ** +************************/ + /*** BGN: Alignments ***/ + html body .obj_center { + margin-left: auto; + margin-right: auto; + -webkit-margin-start: auto; + margin-inline-start: auto; + -webkit-margin-end: auto; + margin-inline-end: auto; + } + html body .obj_left { + margin-right: auto; + -webkit-margin-end: auto; + margin-inline-end: auto; + } + html body .obj_right { + margin-left: auto; + -webkit-margin-start: auto; + margin-inline-start: auto; + } + html body .obj_floatleft { + float: left; + } + html body .obj_floatright { + float: right; + } + .floatclear { + clear: both; + } + html body .txt_center { + text-align: center; + } + html body .txt_justify { + text-align: justify; + } + html body .txt_left { + text-align: left; + } + html body .txt_right { + text-align: right; + } + /*** END: Alignments ***/ + + /*** BGN: Positional ***/ + html body .display_table-cell { + display: table-cell; + } + /*** END: Positional ***/ +/************************ +** END: COMMON CLASSES ** +************************/ + +/******************************* +** BGN: embedresponsively.com ** +*******************************/ + .responsive_embedframe { + position: relative; + padding-bottom: 56.25%; /* YouTube, Vimeo, Dailymotion, Google Maps, Generic */ + height: 0; + overflow: hidden; + max-width: 100%; + margin-bottom: 10px; + } + .responsive_embedframe.instagram { + padding-bottom: 120%; /* Instagram */ + } + .responsive_embedframe.vine { + padding-bottom: 100%; /* Vine */ + } + .responsive_embedframe.gettyimages { + padding-bottom: 79.96632996632997%; /* Getty Images */ + } + .responsive_embedframe.generic2 { + position: relative; + padding-bottom: initial; /* Generic2 */ + /* height: 0; */ + overflow: hidden; + max-width: 100%; + margin-bottom: 10px; + } + + .responsive_embedframe iframe, + .responsive_embedframe ojbect, + .responsive_embedframe embed { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + } +/******************************* +** END: embedresponsively.com ** +*******************************/ + +/******************************************************************************/ +/******************************************************************************/ + +/********************* +** BGN: Attribution ** +*********************/ + /* BGN: Remove browser style */ + html body figure.quote_box, + html body aside.quote_box, + html body div.quote_box, + html body aside.figure_box, + html body div.figure_box, + html body .caption_txt > p { + margin: 0; + -webkit-margin-before: 0; + margin-block-start: 0; + -webkit-margin-after: 0; + margin-block-end: 0; + -webkit-margin-start: 0; + margin-inline-start: 0; + -webkit-margin-end: 0; + margin-inline-end: 0; + } + /* END: Remove browser style */ + + /* BGN: Add margins */ + html body figure.quote_box, + html body aside.quote_box, + html body div.quote_box, + html body aside.figure_box, + html body div.figure_box { + margin: 1rem 0; + -webkit-margin-before: 1rem; + margin-block-start: 1rem; + -webkit-margin-after: 1rem; + margin-block-end: 1rem; + -webkit-margin-start: 0; + margin-inline-start: 0; + -webkit-margin-end: 0; + margin-inline-end: 0; + } + /* END: Add margins */ + + /** BGN: Remove theme style + * - useful for Blogspot and Tumblr themes with embedded CSS + * + * - IMPT: Do not change the chaining. + * We need to increase the specifity to override embedded CSS + **/ + html body figure.quote_box, + html body aside.quote_box, + html body div.quote_box, + html body aside.figure_box, + html body div.figure_box, + html body .caption_txt > p { + text-align: revert; + } + html body figure.quote_box > blockquote, + html body aside.quote_box > blockquote, + html body div.quote_box > blockquote { + background-color: transparent; + border: revert; + color: revert; + font-size: revert; + font-style: revert; + /* font-weight: revert; */ + line-height: revert; + width: revert; + } + html body figure.quote_box > blockquote::before, + html body figure.quote_box > blockquote::after, + html body aside.quote_box > blockquote::before, + html body aside.quote_box > blockquote::after, + html body div.quote_box > blockquote::before, + html body div.quote_box > blockquote::after { + content: revert; + } + /* END: Remove theme style */ + + /* .figure_box > div, */ + html body .quote_box > blockquote { + margin: 1rem; + -webkit-margin-before: 1rem; + margin-block-start: 1rem; + -webkit-margin-after: 1rem; + margin-block-end: 1rem; + -webkit-margin-start: 1rem; + margin-inline-start: 1rem; + -webkit-margin-end: 1rem; + margin-inline-end: 1rem; + padding: 0; + -webkit-padding-before: 0; + padding-block-start: 0; + -webkit-padding-after: 0; + padding-block-end: 0; + -webkit-padding-start: 0; + padding-inline-start: 0; + -webkit-padding-end: 0; + padding-inline-end: 0; + } + + html body .attribution_name > p::before { + content: "\2015"; /* horizontal bar; quotation dash as per https://unicode.org/charts/PDF/U2000.pdf */ + } + html body .caption_txt { + line-height: normal; + margin-bottom: 23px; + -webkit-margin-after: 23px; + margin-block-end: 23px; + } + html body .caption_txt > p > small { + font-size: 0.73em; + } +/********************* +** END: Attribution ** +*********************/ diff --git a/config.toml b/config.toml new file mode 100644 index 0000000..312c507 --- /dev/null +++ b/config.toml @@ -0,0 +1,5 @@ +#[module] +# [module.hugoVersion] +# #extended = true +# min = "0.88.0" +# #max = "" diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..6e8a2c5 --- /dev/null +++ b/go.mod @@ -0,0 +1,3 @@ +module github.com/YourOnly-One/hugo-semantic-web + +go 1.17 diff --git a/i18n/en.toml b/i18n/en.toml new file mode 100644 index 0000000..1f0c7fd --- /dev/null +++ b/i18n/en.toml @@ -0,0 +1,53 @@ +# Translations for English +# https://gohugo.io/content-management/multilingual/#translation-of-strings + +# BGN: attribution and license + [attribution_by] + other = "by" + [attribution_licensedunder] + other = "licensed under" + [attribution_cc0_extent] + other = "To the extent possible under law" + [attribution_cc0_waived] + other = "waived all copyright and related or neighbouring rights" + [attribution_cc0_publishedfrom] + other = "This work is published from" + [attribution_publicdomain] + other = "free of known copyright restrictions" + [attribution_allrightsreserved] + other = "The work shown above is Copyrighted" + [attribution_allrightsreservedcover] + other = "The cover image used in this article is Copyrighted" + [attribution_ccbysa4] + other = "Creative Commons Attribution-ShareAlike 4.0 International" + [attribution_directedby] + other = "Directed by" + [attribution_musicby] + other = "Music by" +# END: attribution and license + +# BGN: generic words + [word_is] + other = "is" + [word_has] + other = "has" + [word_to] + other = "to" + [word_coverimage] + other = "・ Cover image:" + [word_date] + other = "Date" + [word_time] + other = "Time" + [word_location] + other = "Location" +# END: generic words + +# BGN: punctuations + [punctuation_colon] + other = ":" + [punctuation_fullstop] + other = "." + [punctuation_pause] + other = "," +# END: punctuations diff --git a/layouts/partials/schemas/schema_Article.html b/layouts/partials/schemas/schema_Article.html new file mode 100644 index 0000000..4e6bb9c --- /dev/null +++ b/layouts/partials/schemas/schema_Article.html @@ -0,0 +1,198 @@ +{{- /* + ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― + BGN: SEMANTIC WEB + ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― + + **************************** + ** Syntax: JSON-LD ** + ** Vocab: schema.org ** + ** ** + ** Schema: Article ** + **************************** + + Links: + - https://www.w3.org/standards/semanticweb/ + - https://schema.org/Article + + About SemWeb: + - https://im.youronly.one/techmagus/ + + How-To: + - https://github.com/ + + ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― + END: SEMANTIC WEB + ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― +*/}} +{{- $iso8601 := "2006-01-02T15:04:05-07:00" -}} +{{- $iso8601y := "2006" -}} +{{- $acquireLicensePage := or (.Param "semweb.acquirelicensepage") (.Param "acquirelicensepage") -}} +{{- $title := .LinkTitle -}} +{{- $permalink := .Permalink -}} +{{- $copyrightYear := "" -}} +{{- $dateCreated := .Date -}} +{{- $datePublished := or (.PublishDate) ($dateCreated) -}} +{{- $dateModified := .Lastmod.Format $iso8601 -}} +{{- $dateModifiedYear := .Lastmod.Format $iso8601y -}} +{{- $dateExpiry := "" -}} +{{- if not .ExpiryDate.IsZero -}} + {{- $dateExpiry = .ExpiryDate.Format $iso8601 -}} +{{- end -}} +{{- if $datePublished -}} + {{- $datePublished = dateFormat $iso8601 $datePublished -}} +{{- else if $dateCreated -}} + {{- $datePublished = $dateCreated -}} +{{- end -}} +{{- if $dateCreated -}} + {{- $copyrightYear = dateFormat $iso8601y $dateCreated -}} + {{- $dateCreated = dateFormat $iso8601 $dateCreated -}} +{{- else if $datePublished -}} + {{- $copyrightYear = dateFormat $iso8601y $datePublished -}} + {{- $dateCreated = $datePublished -}} +{{- end -}} +{{- if ne $copyrightYear $dateModifiedYear -}} + {{- $copyrightYear = $dateModifiedYear -}} +{{- end -}} +{{- $datapersons := .Site.Data.persons -}} +{{- $semwebpersons := .Site.Params.semweb.persons -}} +{{- $frontmatterpersons := .Params.authors }} + { + "@type": [ "Article"{{ with $.Param "semweb.isblog" }}, "BlogPosting"{{ end }} ], + "@id": "{{ $permalink }}#article", + + {{- /* Properties from Article */}} + {{ with or (.Params.categories) (.Params.tags) }}"articleSection": [ {{ range $i, $articlesection := . }}{{ if $i }}, {{ end }}"{{ $articlesection }}"{{ end }} ],{{ end }} + "wordCount": "{{ .Plain | countwords }}", + + {{- /* Properties from CreativeWork */}} + {{ with $acquireLicensePage }}"acquireLicensePage": "{{ . }}",{{ end }} + {{ if $frontmatterpersons }}"author": [ {{ range $i, $frontmatterperson := index $frontmatterpersons }}{{ $dataperson := index $datapersons $frontmatterperson.person }}{{ if $i }}, {{ end }} + {{- /* note: if [[authors]] is set in frontmatter, use this to display a list of persons with fallback to /data/persons/ if present */}} + { + "@id": "{{ or ($frontmatterperson.id) ($dataperson.id) }}"{{ with or ($frontmatterperson.name) ($frontmatterperson.url) }},{{ end }} + {{ with $frontmatterperson.name }}"name": "{{ . }}",{{ end }} + {{ with $frontmatterperson.sameas }}"sameAs": [ {{ range $i, $sameas := . }}{{ if $i }}, {{ end }}"{{ $sameas }}"{{ end }} ],{{ end }} + {{ with $frontmatterperson.url }}"url": "{{ . }}",{{ end }} + {{ with or ($frontmatterperson.name) ($frontmatterperson.url) }}"@type": "Person"{{ end }} + }{{ end }} + ],{{ else if $semwebpersons }}"author": [ {{ range $i, $semwebperson := index $semwebpersons }}{{ $dataperson := index $datapersons $semwebperson.person }}{{ if $i }}, {{ end }} + {{- /* note: else if [[semweb.persons]] is set in config file, use it to display a list of persons with fallback to /data/persons/ if present */}} + { + "@id": "{{ or ($semwebperson.id) ($dataperson.id) }}"{{ with or ($semwebperson.name) ($semwebperson.url) }},{{ end }} + {{ with $semwebperson.name }}"name": "{{ . }}",{{ end }} + {{ with $semwebperson.sameas }}"sameAs": [ {{ range $i, $sameas := . }}{{ if $i }}, {{ end }}"{{ $sameas }}"{{ end }} ],{{ end }} + {{ with $semwebperson.url }}"url": "{{ . }}",{{ end }} + {{ with or ($semwebperson.name) ($semwebperson.url) }}"@type": "Person"{{ end }} + }{{ end }} + ],{{ else if .Param "author" }}"author": [ + {{- /* note: else if default Hugo 'author' param is used in frontmatter or config, display generic */}} + { + "name": "{{ .Param "author" }}" + } + ],{{ end }} + {{ if $frontmatterpersons }}"copyrightHolder": [ {{ range $i, $frontmatterperson := index $frontmatterpersons }}{{ $dataperson := index $datapersons $frontmatterperson.person }}{{ if $i }}, {{ end }} + {{- /* note: if [[authors]] is set in frontmatter, use this to display a list of persons with fallback to /data/persons/ if present */}} + { + "@id": "{{ or ($frontmatterperson.id) ($dataperson.id) }}"{{ with or ($frontmatterperson.name) ($frontmatterperson.url) }},{{ end }} + {{ with $frontmatterperson.name }}"name": "{{ . }}",{{ end }} + {{ with $frontmatterperson.sameas }}"sameAs": [ {{ range $i, $sameas := . }}{{ if $i }}, {{ end }}"{{ $sameas }}"{{ end }} ],{{ end }} + {{ with $frontmatterperson.url }}"url": "{{ . }}",{{ end }} + {{ with or ($frontmatterperson.name) ($frontmatterperson.url) }}"@type": "Person"{{ end }} + }{{ end }} + ],{{ else if $semwebpersons }}"copyrightHolder": [ {{ range $i, $semwebperson := index $semwebpersons }}{{ $dataperson := index $datapersons $semwebperson.person }}{{ if $i }}, {{ end }} + {{- /* note: else if [[semweb.persons]] is set in config file, use it to display a list of persons with fallback to /data/persons/ if present */}} + { + "@id": "{{ or ($semwebperson.id) ($dataperson.id) }}"{{ with or ($semwebperson.name) ($semwebperson.url) }},{{ end }} + {{ with $semwebperson.name }}"name": "{{ . }}",{{ end }} + {{ with $semwebperson.sameas }}"sameAs": [ {{ range $i, $sameas := . }}{{ if $i }}, {{ end }}"{{ $sameas }}"{{ end }} ],{{ end }} + {{ with $semwebperson.url }}"url": "{{ . }}",{{ end }} + {{ with or ($semwebperson.name) ($semwebperson.url) }}"@type": "Person"{{ end }} + }{{ end }} + ],{{ else if .Param "author" }}"copyrightHolder": [ + {{- /* note: else if default Hugo 'author' param is used in frontmatter or config, display generic */}} + { + "name": "{{ .Param "author" }}" + } + ],{{ end }} + "copyrightYear": "{{ $copyrightYear }}", + "creativeWorkStatus": "Published", + {{ if $frontmatterpersons }}"creator": [ {{ range $i, $frontmatterperson := index $frontmatterpersons }}{{ $dataperson := index $datapersons $frontmatterperson.person }}{{ if $i }}, {{ end }} + {{- /* note: if [[authors]] is set in frontmatter, use this to display a list of persons with fallback to /data/persons/ if present */}} + { + "@id": "{{ or ($frontmatterperson.id) ($dataperson.id) }}"{{ with or ($frontmatterperson.name) ($frontmatterperson.url) }},{{ end }} + {{ with $frontmatterperson.name }}"name": "{{ . }}",{{ end }} + {{ with $frontmatterperson.sameas }}"sameAs": [ {{ range $i, $sameas := . }}{{ if $i }}, {{ end }}"{{ $sameas }}"{{ end }} ],{{ end }} + {{ with $frontmatterperson.url }}"url": "{{ . }}",{{ end }} + {{ with or ($frontmatterperson.name) ($frontmatterperson.url) }}"@type": "Person"{{ end }} + }{{ end }} + ],{{ else if $semwebpersons }}"creator": [ {{ range $i, $semwebperson := index $semwebpersons }}{{ $dataperson := index $datapersons $semwebperson.person }}{{ if $i }}, {{ end }} + {{- /* note: else if [[semweb.persons]] is set in config file, use it to display a list of persons with fallback to /data/persons/ if present */}} + { + "@id": "{{ or ($semwebperson.id) ($dataperson.id) }}"{{ with or ($semwebperson.name) ($semwebperson.url) }},{{ end }} + {{ with $semwebperson.name }}"name": "{{ . }}",{{ end }} + {{ with $semwebperson.sameas }}"sameAs": [ {{ range $i, $sameas := . }}{{ if $i }}, {{ end }}"{{ $sameas }}"{{ end }} ],{{ end }} + {{ with $semwebperson.url }}"url": "{{ . }}",{{ end }} + {{ with or ($semwebperson.name) ($semwebperson.url) }}"@type": "Person"{{ end }} + }{{ end }} + ],{{ else if .Param "author" }}"creator": [ + {{- /* note: else if default Hugo 'author' param is used in frontmatter or config, display generic */}} + { + "name": "{{ .Param "author" }}" + } + ],{{ end }} + "dateCreated": "{{ $dateCreated | safeHTML }}", + "dateModified": "{{ $dateModified | safeHTML }}", + "datePublished": "{{ $datePublished | safeHTML }}", + {{ with $dateExpiry }}"expires": "{{ . | safeHTML }}",{{ end }} + "headline": "{{ $title }}", + "inLanguage": "{{ or (.Site.LanguageCode) (.Site.Language.Lang) }}", + "isPartOf": [ + { + "@id": "{{ $permalink }}#webpage" + }, + { + "@id": "{{ $permalink }}#webcontent" + } + ], + {{ with .Keywords }}"keywords": [ {{ range $i, $keyword := . }}{{ if $i }}, {{ end }}"{{ $keyword }}"{{ end }} ],{{ end }} + {{ with or (.Param "semweb.license") (.Param "license") }}"license": "{{ . }}",{{ end }} + {{ with .Site.Params.semweb.publisher }}"publisher": { + "@id": "{{ . }}#organization" + },{{ end }} + {{- /* "translationOfWork": "", */}} + {{- /* "translator": "", */}} + {{ with $acquireLicensePage }}"usageInfo": "{{ . }}",{{ end }} + {{ with .Params.videos }}"video": [ {{ range $i, $video := . }}{{ if $i }}, {{ end }} + { + "@id": "{{ . }}#video", + "contentUrl": "{{ . }}", + "url": "{{ . }}", + "@type": "VideoObject" + }{{ end }} + ],{{ end }} + {{- /* "workTranslation": "", */}} + + {{- /* Properties from Thing */}} + {{ with or (.Description) (.Summary) }}"description": "{{ . | plainify }}",{{ end }} + {{ with (.Param "images") }}"image": [ {{ range $i, $image := . }}{{ if $i }}, {{ end }} + { + "@id": "{{ . }}#image", + "contentUrl": "{{ . }}", + "url": "{{ . }}", + "@type": "ImageObject" + }{{ end }} + ],{{ end }} + "mainEntityOfPage": [ + { + "@id": "{{ $permalink }}#article" + }, + { + "@id": "{{ $permalink }}#webpage" + }, + { + "@id": "{{ $permalink }}#webcontent" + } + ], + "name": "{{ $title }}", + "url": "{{ $permalink }}" + } \ No newline at end of file diff --git a/layouts/partials/schemas/schema_ImageObject.html b/layouts/partials/schemas/schema_ImageObject.html new file mode 100644 index 0000000..c8b3122 --- /dev/null +++ b/layouts/partials/schemas/schema_ImageObject.html @@ -0,0 +1,137 @@ +{{- /* + ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― + BGN: SEMANTIC WEB + ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― + + **************************** + ** Syntax: JSON-LD ** + ** Vocab: schema.org ** + ** ** + ** Schema: ImageObject ** + **************************** + + Links: + - https://www.w3.org/standards/semanticweb/ + - https://schema.org/ImageObject + + Google specific: + - https://developers.google.com/search/docs/advanced/structured-data/image-license-metadata + + About SemWeb: + - https://im.youronly.one/techmagus/ + + How-To: + - https://github.com/ + + ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― + END: SEMANTIC WEB + ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― +*/ -}} +{{- $iso8601 := "2006-01-02T15:04:05-07:00" -}} +{{- $iso8601y := "2006" -}} +{{- $mainID := printf "%s#image" (.Get "src") -}} +{{- $acquireLicensePage := or (.Get "acquirelicensepage") (.Page.Param "semweb.acquirelicensepage") (.Page.Param "acquirelicensepage") -}} +{{- $alt := .Get "alt" -}} +{{- $thumbnailURL := .Get "thumbnailurl" -}} +{{- $title := .Get "title" -}} +{{- $url := .Get "src" -}} +{{- $caption := or (.Get "caption") $alt -}} +{{- $about := or $caption $alt $title -}} +{{- $description := or $caption $alt -}} +{{- $name := or $title $caption $alt -}} +{{- $attribto := or (.Get "attr") (.Get "attribto") }} +{{- $publisher := or (.Get "publisher") $attribto -}} +{{- $copyrightYear := "" -}} +{{- $dateCreated := .Get "datecreated" -}} +{{- $datePublished := .Get "datepublished" -}} +{{- if $datePublished -}} + {{- $datePublished = dateFormat $iso8601 $datePublished -}} +{{ else if $dateCreated -}} + {{- $datePublished = dateFormat $iso8601 $dateCreated -}} +{{- end -}} +{{- if $dateCreated -}} + {{- $copyrightYear = dateFormat $iso8601y $dateCreated -}} + {{- $dateCreated = dateFormat $iso8601 $dateCreated -}} +{{- else if $datePublished -}} + {{- $copyrightYear = dateFormat $iso8601y $datePublished -}} + {{- $dateCreated = dateFormat $iso8601 $datePublished -}} +{{- end -}} +{{- $hashArticle := printf "%s#article" (.Page.Permalink) -}} +{{- $hashWebPage := printf "%s#webpage" (.Page.Permalink) -}} +{{- $hashWebContent := printf "%s#webcontent" (.Page.Permalink) -}} +{{- $hashThumbnail := printf "%s#thumbnail" $thumbnailURL -}} +{{- $hashPlace := printf "%s#place" (.Get "contentlocurl") -}} + diff --git a/layouts/partials/schemas/schema_Organization.html b/layouts/partials/schemas/schema_Organization.html new file mode 100644 index 0000000..41151b0 --- /dev/null +++ b/layouts/partials/schemas/schema_Organization.html @@ -0,0 +1,87 @@ +{{- /* + ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― + BGN: SEMANTIC WEB + ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― + + **************************** + ** Syntax: JSON-LD ** + ** Vocab: schema.org ** + ** ** + ** Schema: Organization ** + **************************** + + Special uses: + - Site logo: https://developers.google.com/search/docs/advanced/structured-data/logo + + Links: + - https://www.w3.org/standards/semanticweb/ + - https://schema.org/Organization + + About SemWeb: + - https://im.youronly.one/techmagus/ + + How-To: + - https://github.com/ + + ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― + END: SEMANTIC WEB + ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― +*/}} +{{- $org := index .Site.Data.orgs .Site.Params.semweb.org }} + { + "@type": "Organization", + "@id": "{{ $org.id }}#organization", + + {{- /* Properties from Organization */}} + {{ with $org.brands }}"brand": [ {{ range $i, $brand := . }}{{ if $i }}, {{ end }} + { + "@id": "{{ .id }}#website", + {{ with .logo }}"logo": "{{ . }}",{{ end }} + {{ with .name }}"name": "{{ . }}",{{ end }} + {{ with .url }}"url": "{{ . }}",{{ end }} + "@type": [ "Brand"{{ with .iswebsite }}, "WebSite"{{ end }} ] + }{{ end }} + ],{{ end }} + {{ if $org.founders }}"founder": [ {{ range $i, $orgfounder := index $org.founders }}{{ if $i }}, {{ end }} + { + "@id": "{{ $orgfounder.id }}"{{ with or ($orgfounder.name) ($orgfounder.url) }},{{ end }} + {{ with $orgfounder.name }}"name": "{{ . }}",{{ end }} + {{ with $orgfounder.sameas }}"sameAs": [ {{ range $i, $sameas := . }}{{ if $i }}, {{ end }}"{{ $sameas }}"{{ end }} ],{{ end }} + {{ with $orgfounder.url }}"url": "{{ . }}",{{ end }} + {{ with or ($orgfounder.name) ($orgfounder.url) }}"@type": "Person"{{ end }} + }{{ end }} + ],{{ end }} + {{ with $org.foundingdate }}"foundingDate": "{{ . }}",{{ end }} + {{ with $org.knowslanguages }}"knowsLanguage": [ {{ range $i, $knowslanguage := . }}{{ if $i }}, {{ end }}"{{ $knowslanguage }}"{{ end }} ],{{ end }} + "legalName": "{{ $org.legalname }}", + "logo": [ {{ $countislogo := 0 }}{{ range $i, $image := $org.images }}{{ with .islogo }}{{ $countislogo = add $countislogo 1 }}{{ if gt $countislogo 1 }}, {{ end }} + { + "@id": "{{ $.Site.BaseURL }}#logo", + {{ with $image.caption }}"caption": "{{ . }}",{{ end }} + "contentUrl": "{{ $image.url }}", + "url": "{{ $image.url }}", + "@type": "ImageObject" + }{{ end }}{{ end }} + ], + {{ with $org.slogan }}"slogan": "{{ . }}",{{ end }} + {{ with $org.taxid }}"taxID": "{{ . }}",{{ end }} + {{ with $org.vatid }}"vatID": "{{ . }}",{{ end }} + + {{- /* Properties from Thing */ -}} + {{ with $org.alternatenames }}"alternateName": [ {{ range $i, $alternatename := . }}{{ if $i }}, {{ end }}"{{ $alternatename }}"{{ end }} ],{{ end }} + "description": "{{ $org.description }}", + "image": [ {{ range $i, $image := $org.images }}{{ if $i }}, {{ end }} + { + {{ with .islogo | default false }}"@id": "{{ $.Site.BaseURL }}#logo" + {{- else }}"@id": "{{ .url }}", + {{ with .caption }}"caption": "{{ . }}",{{ end }} + "contentUrl": "{{ .url }}", + "url": "{{ .url }}", + "@type": "ImageObject" + {{- end }} + }{{ end }} + ], + "name": "{{ $org.name }}", + {{ with $org.sameas }}"sameAs": [ {{ range $i, $sameas := . }}{{ if $i }}, {{ end }}"{{ $sameas }}"{{ end }} ],{{ end }} + "url": "{{ $org.url }}" + } \ No newline at end of file diff --git a/layouts/partials/schemas/schema_Person.html b/layouts/partials/schemas/schema_Person.html new file mode 100644 index 0000000..bd14112 --- /dev/null +++ b/layouts/partials/schemas/schema_Person.html @@ -0,0 +1,87 @@ +{{- /* + ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― + BGN: SEMANTIC WEB + ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― + + **************************** + ** Syntax: JSON-LD ** + ** Vocab: schema.org ** + ** ** + ** Schema: Person ** + **************************** + + Links: + - https://www.w3.org/standards/semanticweb/ + - https://schema.org/Person + + About SemWeb: + - https://im.youronly.one/techmagus/ + + How-To: + - https://github.com/ + + ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― + END: SEMANTIC WEB + ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― +*/}} +{{- $datapersons := .Site.Data.persons -}} +{{- $semwebpersons := .Site.Params.semweb.persons -}} +{{- $frontmatterpersons := .Params.authors -}} + {{ range $i, $semwebperson := index $semwebpersons }}{{ $dataperson := index $datapersons $semwebperson.person }}{{ if $i }}, {{ end }} + { + "@type": "Person", + "@id": "{{ or ($semwebperson.id) ($dataperson.id) }}", + + {{- /* Properties from Person */}} + {{ with or ($semwebperson.additionalnames) ($dataperson.additionalnames) }}"additionalName": [ {{ range $i, $additionalname := . }}{{ if $i }}, {{ end }}"{{ $additionalname }}"{{ end }} ],{{ end }} + {{ with or ($semwebperson.affiliations) ($dataperson.affiliations) }}"affiliation": [ {{ range $i, $affiliation := . }}{{ if $i }}, {{ end }} + { + "@id": "{{ .id }}#organization"{{ with or (.name) (.url) }},{{ end }} + {{ with .name }}"name": "{{ . }}",{{ end }} + {{ with .url }}"url": "{{ . }}",{{ end }} + {{ with or (.name) (.url) }}"@type": "Organization"{{ end }} + }{{ end }} + ],{{ end }} + {{ with or ($semwebperson.brands) ($dataperson.brands) }}"brand": [ {{ range $i, $brand := . }}{{ if $i }}, {{ end }} + { + "@id": "{{ .id }}#website", + {{ with .logo }}"logo": "{{ . }}",{{ end }} + {{ with .name }}"name": "{{ . }}",{{ end }} + {{ with .url }}"url": "{{ . }}",{{ end }} + "@type": [ "Brand"{{ with .iswebsite }}, "WebSite"{{ end }} ] + }{{ end }} + ],{{ end }} + {{ with or ($semwebperson.jobtitles) ($dataperson.jobtitles) }}"jobTitle": [ {{ range $i, $jobtitle := . }}{{ if $i }}, {{ end }}"{{ $jobtitle }}"{{ end }} ],{{ end }} + {{ with or ($semwebperson.knowslanguages) ($dataperson.knowslanguages) }}"knowsLanguage": [ {{ range $i, $knowslanguage := . }}{{ if $i }}, {{ end }}"{{ $knowslanguage }}"{{ end }} ],{{ end }} + {{ with or ($semwebperson.spouse) ($dataperson.spouse) }}"spouse": { + "@id": "{{ .id }}", + {{ with .name }}"name": "{{ . }}",{{ end }} + {{ with .url }}"url": "{{ . }}"{{ end }} + },{{ end }} + {{ with or ($semwebperson.taxid) ($dataperson.taxid) }}"taxID": "{{ . }}",{{ end }} + {{ with or ($semwebperson.vatid) ($dataperson.vatid) }}"vatID": "{{ . }}",{{ end }} + {{ with or ($semwebperson.worksfor) ($dataperson.worksfor) }}"worksFor": [ {{ range $i, $worksfor := . }}{{ if $i }}, {{ end }} + { + "@id": "{{ .id }}#organization"{{ with or (.name) (.url) }},{{ end }} + {{ with .name }}"name": "{{ . }}",{{ end }} + {{ with .url }}"url": "{{ . }}",{{ end }} + {{ with or (.name) (.url) }}"@type": "Organization"{{ end }} + }{{ end }} + ],{{ end }} + + {{- /* Properties from Thing */}} + {{ with or ($semwebperson.description) ($dataperson.description) }}"description": "{{ . }}",{{ end }} + "image": [ {{ range $i, $image := or ($semwebperson.images) ($dataperson.images) }}{{ if $i }}, {{ end }} + { + "@id": "{{ .url }}{{ with .isphoto | default false }}#photo{{ end }}", + {{ with .caption }}"caption": "{{ . }}",{{ end }} + "contentUrl": "{{ .url }}", + "url": "{{ .url }}", + "@type": "ImageObject" + }{{ end }} + ], + {{ with or ($semwebperson.mainentityofpage) ($dataperson.mainentityofpage) }}"mainEntityOfPage": "{{ . }}",{{ end }} + {{ with or ($semwebperson.name) ($dataperson.name) }}"name": "{{ . }}",{{ end }} + {{ with or ($semwebperson.sameas) ($dataperson.sameas) }}"sameAs": [ {{ range $i, $sameas := . }}{{ if $i }}, {{ end }}"{{ $sameas }}"{{ end }} ],{{ end }} + {{ with or ($semwebperson.url) ($dataperson.url) }}"url": "{{ . }}"{{ end }} + }{{ end }} \ No newline at end of file diff --git a/layouts/partials/schemas/schema_VideoObject.html b/layouts/partials/schemas/schema_VideoObject.html new file mode 100644 index 0000000..6dbb5e8 --- /dev/null +++ b/layouts/partials/schemas/schema_VideoObject.html @@ -0,0 +1,155 @@ +{{- /* + ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― + BGN: SEMANTIC WEB + ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― + + **************************** + ** Syntax: JSON-LD ** + ** Vocab: schema.org ** + ** ** + ** Schema: VideoObject ** + **************************** + + Links: + - https://www.w3.org/standards/semanticweb/ + - https://schema.org/VideoObject + + About SemWeb: + - https://im.youronly.one/techmagus/ + + How-To: + - https://github.com/ + + ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― + END: SEMANTIC WEB + ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― +*/ -}} +{{- $iso8601 := "2006-01-02T15:04:05-07:00" -}} +{{- $iso8601y := "2006" -}} +{{- $vidID := .Get "id" -}} +{{- $platform := .Get "platform" -}} +{{- $url := "" -}} +{{- if eq $platform "youtube" -}} + {{- $url = printf "%s%s" "https://www.youtube.com/watch?v=" $vidID -}} +{{- else if eq $platform "vimeo" -}} + {{- $url = printf "%s%s" "https://vimeo.com/" $vidID -}} +{{- end -}} +{{- $mainID := printf "%s#video" $url -}} +{{- $acquireLicensePage := or (.Get "acquirelicensepage") (.Page.Param "semweb.acquirelicensepage") (.Page.Param "acquirelicensepage") -}} +{{- $title := .Get "title" -}} +{{- $caption := .Get "caption" -}} +{{- $about := or $caption $title -}} +{{- $description := $caption -}} +{{- $name := or $title $caption -}} +{{- $attribto := or (.Get "attr") (.Get "attribto") }} +{{- $publisher := or (.Get "publisher") $attribto -}} +{{- $copyrightYear := "" -}} +{{- $dateCreated := .Get "datecreated" -}} +{{- $datePublished := .Get "datepublished" -}} +{{- if $datePublished -}} + {{- $datePublished = dateFormat $iso8601 $datePublished -}} +{{- else if $dateCreated -}} + {{- $datePublished = dateFormat $iso8601 $dateCreated -}} +{{- end -}} +{{- if $dateCreated -}} + {{- $copyrightYear = dateFormat $iso8601y $dateCreated -}} + {{- $dateCreated = dateFormat $iso8601 $dateCreated -}} +{{- else if $datePublished -}} + {{- $copyrightYear = dateFormat $iso8601y $datePublished -}} + {{- $dateCreated = dateFormat $iso8601 $datePublished -}} +{{- end -}} +{{- $hashArticle := printf "%s#article" (.Page.Permalink) -}} +{{- $hashWebPage := printf "%s#webpage" (.Page.Permalink) -}} +{{- $hashWebContent := printf "%s#webcontent" (.Page.Permalink) -}} +{{- $thumbnailURL := "" -}} +{{- if eq $platform "youtube" -}} + {{- $thumbnailURL = printf "%s%s%s" "https://img.youtube.com/vi/" $vidID "/hqdefault.jpg" -}} +{{- end -}} +{{- $hashPlace := printf "%s#place" ($.Get "contentlocurl") -}} +{{- $hashThumbnail := "" -}} +{{- if eq $platform "youtube" -}} + {{- $hashThumbnail = printf "%s%s" $thumbnailURL "#thumbnail" -}} +{{- end }} + diff --git a/layouts/partials/schemas/schema_WebContent.html b/layouts/partials/schemas/schema_WebContent.html new file mode 100644 index 0000000..9cb0a83 --- /dev/null +++ b/layouts/partials/schemas/schema_WebContent.html @@ -0,0 +1,46 @@ +{{- /* + ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― + BGN: SEMANTIC WEB + ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― + + **************************** + ** Syntax: JSON-LD ** + ** Vocab: schema.org ** + ** ** + ** Schema: WebContent ** + **************************** + + Links: + - https://www.w3.org/standards/semanticweb/ + - https://schema.org/WebContent + + About SemWeb: + - https://im.youronly.one/techmagus/ + + How-To: + - https://github.com/ + + ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― + END: SEMANTIC WEB + ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― +*/}} +{{- $title := or (.LinkTitle) (.Site.Title) -}} +{{- $permalink := .Permalink }} + { + "@type": "WebContent", + "@id": "{{ $permalink }}#webcontent", + + "hasPart": [ + { + "@id": "{{ .Site.BaseURL }}#website" + }, + { + "@id": "{{ $permalink }}#webpage" + }{{ if .IsPage }}, + { + "@id": "{{ $permalink }}#article" + }{{ end }} + ], + "name": "{{ $title }}", + "url": "{{ .Site.BaseURL }}" + } \ No newline at end of file diff --git a/layouts/partials/schemas/schema_WebPage.html b/layouts/partials/schemas/schema_WebPage.html new file mode 100644 index 0000000..9c75d0b --- /dev/null +++ b/layouts/partials/schemas/schema_WebPage.html @@ -0,0 +1,120 @@ +{{- /* + ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― + BGN: SEMANTIC WEB + ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― + + **************************** + ** Syntax: JSON-LD ** + ** Vocab: schema.org ** + ** ** + ** Schema: WebPage ** + **************************** + + Links: + - https://www.w3.org/standards/semanticweb/ + - https://schema.org/WebPage + + About SemWeb: + - https://im.youronly.one/techmagus/ + + How-To: + - https://github.com/ + + ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― + END: SEMANTIC WEB + ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― +*/}} +{{- $title := or (.LinkTitle) (.Site.Title) -}} +{{- $permalink := .Permalink -}} +{{- $datapersons := .Site.Data.persons -}} +{{- $semwebpersons := .Site.Params.semweb.persons -}} +{{- $frontmatterpersons := .Params.authors }} + { + "@type": "WebPage", + "@id": "{{ $permalink }}#webpage", + + {{- /* Properties from WebPage */}} + {{- /* {{ with $breadcrumb }}"breadcrumb": "{{ . }}",{{ end }} */}} + "mainContentOfPage": "{{ $permalink }}", + {{ with and (.IsPage) (.Params.images) }}"primaryImageOfPage": { + "contentUrl": "{{ index . 0 | absURL }}", + "url": "{{ index . 0 | absURL }}", + "@type": "ImageObject" + },{{ end }} + + {{- /* Properties from CreativeWork */}} + {{ if .IsPage }} + {{ if $frontmatterpersons }}"author": [ {{ range $i, $frontmatterperson := index $frontmatterpersons }}{{ $dataperson := index $datapersons $frontmatterperson.person }}{{ if $i }}, {{ end }} + {{- /* note: if [[authors]] is set in frontmatter, use this to display a list of persons with fallback to /data/persons/ if present */}} + { + "@id": "{{ or ($frontmatterperson.id) ($dataperson.id) }}"{{ with or ($frontmatterperson.name) ($frontmatterperson.url) }},{{ end }} + {{ with $frontmatterperson.name }}"name": "{{ . }}",{{ end }} + {{ with $frontmatterperson.url }}"url": "{{ . }}",{{ end }} + {{ with or ($frontmatterperson.name) ($frontmatterperson.url) }}"@type": "Person"{{ end }} + }{{ end }} + ],{{ else if $semwebpersons }}"author": [ {{ range $i, $semwebperson := index $semwebpersons }}{{ $dataperson := index $datapersons $semwebperson.person }}{{ if $i }}, {{ end }} + {{- /* note: else if [[semweb.persons]] is set in config file, use it to display a list of persons with fallback to /data/persons/ if present */}} + { + "@id": "{{ or ($semwebperson.id) ($dataperson.id) }}"{{ with or ($semwebperson.name) ($semwebperson.url) }},{{ end }} + {{ with $semwebperson.name }}"name": "{{ . }}",{{ end }} + {{ with $semwebperson.url }}"url": "{{ . }}",{{ end }} + {{ with or ($semwebperson.name) ($semwebperson.url) }}"@type": "Person"{{ end }} + }{{ end }} + ],{{ else if .Param "author" }}"author": [ + {{- /* note: else if default Hugo 'author' param is used in frontmatter or config, display generic */}} + { + "name": "{{ .Param "author" }}" + } + ],{{ end }} + {{ end }} + {{ if .IsPage }}"hasPart": { + "@id": "{{ $permalink }}#article" + },{{ end }} + {{ if .IsPage }}"headline": "{{ $title }}",{{ end }} + "inLanguage": "{{ or (.Site.LanguageCode) (.Site.Language.Lang) }}", + "isPartOf": [ + { + "@id": "{{ .Site.BaseURL }}#website" + }, + { + "@id": "{{ $permalink }}#webcontent" + } + ], + "mainEntity": [ {{ if .IsPage }} + { + "@id": "{{ $permalink }}#article" + },{{ end }} + { + "@id": "{{ $permalink }}#webpage" + } + ], + {{ with and (.IsPage) (.Params.videos) }}"video": [ {{ range $i, $video := . }}{{ if $i }}, {{ end }} + { + "@id": "{{ . }}#video", + "contentUrl": "{{ . }}", + "url": "{{ . }}", + "@type": "VideoObject" + }{{ end }} + ],{{ end }} + + {{- /* Properties from Thing */}} + {{ with or (.Description) (.Summary) (.Site.Params.description) }}"description": "{{ . | plainify }}",{{ end }} + {{ with (.Param "images") }}"image": [ {{ range $i, $image := . }}{{ if $i }}, {{ end }} + { + "@id": "{{ . }}#image", + "contentUrl": "{{ . }}", + "url": "{{ . }}", + "@type": "ImageObject" + }{{ end }} + ],{{ end }} + "mainEntityOfPage": [ + { + "@id": "{{ $permalink }}#webpage" + }, + { + "@id": "{{ $permalink }}#webcontent" + } + ], + "name": "{{ $title }}", + "url": "{{ $permalink }}" + } \ No newline at end of file diff --git a/layouts/partials/schemas/schema_WebSite.html b/layouts/partials/schemas/schema_WebSite.html new file mode 100644 index 0000000..37817e0 --- /dev/null +++ b/layouts/partials/schemas/schema_WebSite.html @@ -0,0 +1,128 @@ +{{- /* + ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― + BGN: SEMANTIC WEB + ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― + + **************************** + ** Syntax: JSON-LD ** + ** Vocab: schema.org ** + ** ** + ** Schema: WebSite ** + **************************** + + Links: + - https://www.w3.org/standards/semanticweb/ + - https://schema.org/WebSite + + About SemWeb: + - https://im.youronly.one/techmagus/ + + How-To: + - https://github.com/ + + ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― + END: SEMANTIC WEB + ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― +*/}} +{{- $iso8601 := "2006-01-02T15:04:05-07:00" -}} +{{- $iso8601y := "2006" -}} +{{- $permalink := .Permalink -}} +{{- $acquireLicensePage := or (.Site.Params.semweb.acquirelicensepage) (.Site.Params.acquirelicensepage) -}} +{{- $copyrightYear := "" -}} +{{- $dateCreated := .Date -}} +{{- $datePublished := or (.Site.Params.semweb.datefirstpublished) (.Site.Params.datefirstpublished) (.PublishDate) ($dateCreated) -}} +{{- $dateModified := .Lastmod.Format $iso8601 -}} +{{- $dateModifiedYear := .Lastmod.Format $iso8601y -}} +{{- $dateExpiry := "" -}} +{{- if not .ExpiryDate.IsZero -}} + {{- $dateExpiry = .ExpiryDate.Format $iso8601 -}} +{{- end -}} +{{- if $datePublished -}} + {{- $datePublished = dateFormat $iso8601 $datePublished -}} +{{- else if $dateCreated -}} + {{- $datePublished = $dateCreated -}} +{{- end -}} +{{- if $dateCreated -}} + {{- $copyrightYear = dateFormat $iso8601y $dateCreated -}} + {{- $dateCreated = dateFormat $iso8601 $dateCreated -}} +{{- else if $datePublished -}} + {{- $copyrightYear = dateFormat $iso8601y $datePublished -}} + {{- $dateCreated = $datePublished -}} +{{- end -}} +{{- if ne $copyrightYear $dateModifiedYear -}} + {{- $copyrightYear = $dateModifiedYear -}} +{{- end -}} +{{- $datapersons := .Site.Data.persons -}} +{{- $semwebpersons := .Site.Params.semweb.persons }} + { + "@type": "WebSite", + "@id": "{{ .Site.BaseURL }}#website", + + {{- /* Properties from WebSite */}} + {{ with .Site.Params.semweb.issn }}"issn": "{{ . }}",{{ end }} + + {{- /* Properties from CreativeWork */ -}} + {{ with $acquireLicensePage }}"acquireLicensePage": "{{ . }}",{{ end }} + {{ if $semwebpersons }}"copyrightHolder": [ {{ range $i, $semwebperson := index $semwebpersons }}{{ $dataperson := index $datapersons $semwebperson.person }}{{ if $i }}, {{ end }} + {{- /* note: else if [[semweb.persons]] is set in config file, use it to display a list of persons with fallback to /data/persons/ if present */}} + { + "@id": "{{ or ($semwebperson.id) ($dataperson.id) }}"{{ with or ($semwebperson.name) ($semwebperson.url) }},{{ end }} + {{ with $semwebperson.name }}"name": "{{ . }}",{{ end }} + {{ with $semwebperson.url }}"url": "{{ . }}",{{ end }} + {{ with or ($semwebperson.name) ($semwebperson.url) }}"@type": "Person"{{ end }} + }{{ end }} + ],{{ else if .Param "author" }}"copyrightHolder": [ + {{- /* note: else if default Hugo 'author' param is used in frontmatter or config, display generic */}} + { + "name": "{{ .Param "author" }}" + } + ],{{ end }} + {{ with .Site.Params.semweb.copyrightnotice }}"copyrightNotice": "{{ . }}",{{ end }} + "copyrightYear": "{{ $copyrightYear }}", + "creativeWorkStatus": "Published", + {{ if $semwebpersons }}"creator": [ {{ range $i, $semwebperson := index $semwebpersons }}{{ $dataperson := index $datapersons $semwebperson.person }}{{ if $i }}, {{ end }} + {{- /* note: else if [[semweb.persons]] is set in config file, use it to display a list of persons with fallback to /data/persons/ if present */}} + { + "@id": "{{ or ($semwebperson.id) ($dataperson.id) }}"{{ with or ($semwebperson.name) ($semwebperson.url) }},{{ end }} + {{ with $semwebperson.name }}"name": "{{ . }}",{{ end }} + {{ with $semwebperson.url }}"url": "{{ . }}",{{ end }} + {{ with or ($semwebperson.name) ($semwebperson.url) }}"@type": "Person"{{ end }} + }{{ end }} + ],{{ else if .Param "author" }}"creator": [ + {{- /* note: else if default Hugo 'author' param is used in frontmatter or config, display generic */}} + { + "name": "{{ .Param "author" }}" + } + ],{{ end }} + {{ with .Site.Params.semweb.credittext }}"creditText": "{{ . }}",{{ end }} + "dateCreated": "{{ $dateCreated | safeHTML }}", + "dateModified": "{{ $dateModified | safeHTML }}", + "datePublished": "{{ $datePublished | safeHTML }}", + "hasPart": { + "@id": "{{ $permalink }}#webpage" + }, + "inLanguage": "{{ or (.Site.LanguageCode) (.Site.Language.Lang) }}", + "isPartOf": { + "@id": "{{ $permalink }}#webcontent" + }, + {{ with .Site.Params.keywords }}"keywords": [ {{ range $i, $keyword := . }}{{ if $i }}, {{ end }}"{{ $keyword }}"{{ end }} ],{{ end }} + {{ with or (.Site.Params.semweb.license) (.Site.Params.license) }}"license": "{{ . }}",{{ end }} + {{ with .Site.Params.semweb.publisher }}"publisher": { + "@id": "{{ . }}#organization" + },{{ end }} + {{ with $acquireLicensePage }}"usageInfo": "{{ . }}",{{ end }} + + {{- /* Properties from Thing */ -}} + "description": "{{ .Site.Params.description }}", + {{ with .Site.Params.images }}"image": [ {{ range $i, $image := . }}{{ if $i }}, {{ end }} + { + "@id": "{{ . }}#image", + "contentUrl": "{{ . }}", + "url": "{{ . }}", + "@type": "ImageObject" + }{{ end }} + ],{{ end }} + "name": "{{ .Site.Title }}", + {{ with .Site.Params.semweb.sameas }}"sameAs": [ {{ range $i, $sameas := . }}{{ if $i }}, {{ end }}"{{ $sameas }}"{{ end }} ],{{ end }} + "url": "{{ .Site.BaseURL }}" + } \ No newline at end of file diff --git a/layouts/partials/schemas/semweb.html b/layouts/partials/schemas/semweb.html new file mode 100644 index 0000000..83a8d59 --- /dev/null +++ b/layouts/partials/schemas/semweb.html @@ -0,0 +1,24 @@ + diff --git a/layouts/shortcodes/image.html b/layouts/shortcodes/image.html new file mode 100644 index 0000000..0a40cda --- /dev/null +++ b/layouts/shortcodes/image.html @@ -0,0 +1,136 @@ +{{- /* HOW TO USE +{{< image + height="" + width="" + class="" + style="" + type="" + + isrepresentativeofpage=false + + src="" + link="" + linkrel="" + thumbnailurl="" + + title="" + caption="" + alt="" + embeddedtextcaption="" + inlanguage="" + + datecreated="" + datepublished="" + + objheight="" + objwidth="" + + infoalign="" + + licensecode="" + licenseurl="" + licensename="" + + acquirelicensepage="" + copyrightnotice="" + credittext="" + + attribto="" + attriburl="" + attribrel="" + + cc0country="" + cc0countrycode="" + cc0countryurl="" + + contentloc="" + contentlocurl="" + contentlocrel="" + contentreferencetime="" +>}} +*/ -}} +{{- $height := .Get "height" -}} +{{- $width := .Get "width" -}} +{{- $display := .Get "display" -}} +{{- $class := .Get "class" | default "obj_center" -}} +{{- $style := .Get "style" | safeCSS -}} +{{- $type := .Get "type" | default "image" -}} +{{- $src := .Get "src" -}} +{{- $link := .Get "link" -}} +{{- $linkrel := .Get "linkrel" | default "noopener external nofollow" -}} +{{- $title := .Get "title" -}} +{{- $caption := .Get "caption" -}} +{{- $alt := .Get "alt" -}} +{{- $datecreated := .Get "datecreated" -}} +{{- $infoalign := .Get "infoalign" | default "txt_center" -}} +{{- $licensecode := .Get "licensecode" | default "allrightsreserved" -}} +{{- $licenseurl := .Get "licenseurl" -}} +{{- $licensename := .Get "licensename" | default "All Rights Reserved" -}} +{{- $attribto := or (.Get "attr") (.Get "attribto") -}} +{{- $attriburl := or (.Get "attriburl") (.Get "attrlink") -}} +{{- $attribrel := .Get "attribrel" | default "noopener external nofollow" -}} +{{- $cc0country := .Get "cc0country" -}} +{{- $cc0countrycode := .Get "cc0countrycode" -}} +{{- $cc0countryurl := .Get "cc0countryurl" -}} +{{- $contentloc := .Get "contentloc" -}} +{{- $contentlocurl := .Get "contentlocurl" -}} +{{- $contentlocrel := .Get "contentlocrel" | default "noopener external nofollow" -}} +{{- $contentreferencetime := .Get "contentreferencetime" -}} + + {{- if eq $type "imagecoverattrib" }} +
+
+ {{ else }} + {{- /* keep
centered, if we want to change the image alignment itself, it should be done inside figure */ -}} +
+
+ {{ with $link }}{{ end }} + {{ . | plainify }}{{ with $link }}{{ end }} +
+
+ {{ with $title }}

{{ . | markdownify }}

{{ end }} + {{ with $caption }}

{{ . | markdownify }}

{{ end }} + {{ end -}} +

+ {{- if eq $licensecode "allrightsreserved" }} + {{/* ALL RIGHTS RESERVED */}} + {{ if eq $type "imagecoverattrib" }}{{ i18n "word_coverimage" }} {{ i18n "attribution_allrightsreservedcover" }}{{ else }}{{ i18n "attribution_allrightsreserved" }}{{ end }}{{ with $attribto }} {{ i18n "word_to" }} {{ with $attriburl }}{{ end }}{{ . | markdownify }}{{ end }}{{ with $attriburl }}{{ end }}{{ i18n "punctuation_fullstop" }} + {{ else if eq $licensecode "cc0" }} + {{/* CC0 DEDICATION */}} + {{ if eq $type "imagecoverattrib" }}{{ i18n "word_coverimage" }} {{ end }}{{ i18n "attribution_cc0_extent" }}{{ i18n "punctuation_pause" }} {{ $attribto }} {{ i18n "word_has" }} {{ i18n "attribution_cc0_waived" }} {{ i18n "word_to" }} 「{{ with $link }}{{ end }}{{ with or $title $alt $caption }}{{ . | markdownify }}{{ end }}{{ with $link }}{{ end }}」{{ i18n "punctuation_fullstop" }} {{ i18n "attribution_cc0_publishedfrom" }} {{ $cc0country }}{{ i18n "punctuation_fullstop" }} + {{ else }} + + {{ if eq $type "imagecoverattrib" }}{{ i18n "word_coverimage" }} {{ end }}「{{ with $link }}{{ end }}{{ with or $title $alt $caption }}{{ . | markdownify }}{{ end }}{{ with $link }}{{ end }}」{{ with $attribto }} {{ i18n "attribution_by" }} {{ with $attriburl }}{{ end }}{{ $attribto | markdownify }}{{ with $attriburl }}{{ end }} {{ i18n "word_is" }} + {{ if ne $licensecode "publicdomain" }} + {{/* ANY LICENSE */}} + {{ i18n "attribution_licensedunder" }} {{ with $licensename }}{{ . }}{{ end }}{{ i18n "punctuation_fullstop" }} + {{ else }} + {{/* PUBLIC DOMAIN */}} + {{ i18n "attribution_publicdomain" }}{{ i18n "punctuation_fullstop" }} + {{ end }} + {{ end }} + {{ with or $contentloc $datecreated $contentreferencetime }}
+ {{ with $contentloc }} + {{ i18n "word_location" }}{{ i18n "punctuation_colon" }} {{ with $contentlocurl }}{{ end }}{{ . }}{{ with $contentlocurl }}{{ end }} + {{ with or $datecreated $contentreferencetime }} | {{ end }} + {{ end }} + {{ with $datecreated }} + {{ i18n "word_date" }}{{ i18n "punctuation_colon" }} {{ . }} + {{ with and (ne $datecreated $contentreferencetime) ($contentreferencetime) }} | {{ end }} + {{ end }} + {{ with and (ne $datecreated $contentreferencetime) ($contentreferencetime) }} + {{ i18n "word_time" }}{{ i18n "punctuation_colon" }} {{ . }} + {{ end }} + {{ end }} +
+ {{ end }} +

+ {{- if eq $type "imagecoverattrib" }} +
+
+ {{ else }} + + + {{ end -}} + +{{- if and (templates.Exists "partials/schemas/schema_ImageObject.html") (ne $type "imagecoverattrib") }}{{ partial "schemas/schema_ImageObject.html" . }}{{ end -}} diff --git a/layouts/shortcodes/video.html b/layouts/shortcodes/video.html new file mode 100644 index 0000000..e353b3e --- /dev/null +++ b/layouts/shortcodes/video.html @@ -0,0 +1,163 @@ +{{- /* HOW TO USE +{{< video + height="" + width="" + class="" + style="" + platform="" + + id="" + linkrel="" + isplaylist=false + isloop=false + starttime="" + endtime="" + + title="" + caption="" + inlanguage="" + + datecreated="" + datepublished="" + + director="" + musicby="" + + objframesize="" + objquality="" + objheight="" + objwidth="" + + infoalign="" + + licensecode="" + licenseurl="" + licensename="" + + acquirelicensepage="" + copyrightnotice="" + credittext="" + + attribto="" + attriburl="" + attribrel="" + + cc0country="" + cc0countrycode="" + cc0countryurl="" + + contentloc="" + contentlocurl="" + contentlocrel="" + contentreferencetime="" +>}} +*/ -}} +{{- $height := .Get "height" -}} +{{- $width := .Get "width" -}} +{{- $class := .Get "class" | default "obj_center" -}} +{{- $style := .Get "style" | safeCSS -}} +{{- $platform := .Get "platform" | default "youtube" -}} +{{- $id := .Get "id" -}} +{{- $link := "" -}} +{{- if eq $platform "youtube" -}} + {{- $link = printf "%s%s" "https://www.youtube.com/watch?v=" $id -}} +{{- else if eq $platform "vimeo" -}} + {{- $link = printf "%s%s" "https://vimeo.com/" $id -}} +{{- end -}} +{{- $linkrel := .Get "linkrel" | default "noopener external nofollow" -}} +{{- $isplaylist := .Get "isplaylist" | default false -}} +{{- $isloop := .Get "isloop" | default false -}} +{{- $starttime := .Get "starttime" -}} +{{- $endtime := .Get "endtime" -}} +{{- $title := .Get "title" -}} +{{- $caption := .Get "caption" -}} +{{- $inlanguage := .Get "inlanguage" -}} +{{- $datecreated := .Get "datecreated" -}} +{{- $director := .Get "director" -}} +{{- $musicby := .Get "musicby" -}} +{{- $infoalign := .Get "infoalign" | default "txt_center" -}} +{{- $licensecode := .Get "licensecode" | default "allrightsreserved" -}} +{{- $licenseurl := .Get "licenseurl" -}} +{{- $licensename := .Get "licensename" | default "All Rights Reserved" -}} +{{- $attribto := .Get "attribto" -}} +{{- $attriburl := .Get "attriburl" -}} +{{- $attribrel := .Get "attribrel" | default "noopener external nofollow" -}} +{{- $cc0country := .Get "cc0country" -}} +{{- $cc0countrycode := .Get "cc0countrycode" -}} +{{- $cc0countryurl := .Get "cc0countryurl" -}} +{{- $contentloc := .Get "contentloc" -}} +{{- $contentlocurl := .Get "contentlocurl" -}} +{{- $contentlocrel := .Get "contentlocrel" | default "noopener external nofollow" -}} +{{- $contentreferencetime := .Get "contentreferencetime" -}} + +
+
+ {{ if eq $platform "youtube" }} + {{- $pc := .Page.Site.Config.Privacy.YouTube -}} + {{- if not $pc.Disable -}} + {{- $ytHost := cond $pc.PrivacyEnhanced "www.youtube-nocookie.com" "www.youtube.com" -}} + + {{- end -}} + {{ else if eq $platform "vimeo" }} + {{- $pc := .Page.Site.Config.Privacy.Vimeo -}} + {{- if not $pc.Disable -}} + + {{- end -}} + {{- /* + {{ else if eq $platform "custom" }} + + */ -}} + {{ else }} +

Platform "{{ $platform }}" currently not supported, either check if it is correct or file a feature request [here]().

+ {{ end }} +
+
+ {{ with $title }}

{{ . | markdownify }}

{{ end }} + {{ with $caption }}

{{ . | markdownify }}

{{ end }} +

+ {{- if eq $licensecode "allrightsreserved" }} + {{/* ALL RIGHTS RESERVED */}} + {{ i18n "attribution_allrightsreserved" }}{{ with $attribto }} {{ i18n "word_to" }} {{ with $attriburl }}{{ end }}{{ . | markdownify }}{{ end }}{{ with $attriburl }}{{ end }}{{ i18n "punctuation_fullstop" }} + {{ else if eq $licensecode "cc0" }} + {{/* CC0 DEDICATION */}} + {{ i18n "attribution_cc0_extent" }}{{ i18n "punctuation_pause" }} {{ $attribto }} {{ i18n "word_has" }} {{ i18n "attribution_cc0_waived" }} {{ i18n "word_to" }} 「{{ with $link }}{{ end }}{{ with or $title $caption }}{{ . | markdownify }}{{ end }}{{ with $link }}{{ end }}」{{ i18n "punctuation_fullstop" }} {{ i18n "attribution_cc0_publishedfrom" }} {{ $cc0country }}{{ i18n "punctuation_fullstop" }} + {{ else }} + + 「{{ with $link }}{{ end }}{{ with or $title $caption }}{{ . | markdownify }}{{ end }}{{ with $link }}{{ end }}」{{ with $attribto }} {{ i18n "attribution_by" }} {{ with $attriburl }}{{ end }}{{ $attribto | markdownify }}{{ with $attriburl }}{{ end }} {{ i18n "word_is" }} + {{ if ne $licensecode "publicdomain" }} + {{/* ANY LICENSE */}} + {{ i18n "attribution_licensedunder" }} {{ with $licensename }}{{ . }}{{ end }}{{ i18n "punctuation_fullstop" }} + {{ else }} + {{/* PUBLIC DOMAIN */}} + {{ i18n "attribution_publicdomain" }}{{ i18n "punctuation_fullstop" }} + {{ end }} + {{ end }} + {{ with or $director $musicby }}
+ {{ with $director }} + {{ i18n "attibution_directedby" }}{{ i18n "punctuation_colon" }} {{ . }} + {{ with $musicby }} | {{ end }} + {{ end }} + {{ with $musicby }} + {{ i18n "attribution_musicby" }}{{ i18n "punctuation_colon" }} {{ . }} + {{ end }} + {{ end }} + {{ with or $contentloc $datecreated $contentreferencetime }}
+ {{ with $contentloc }} + {{ i18n "word_location" }}{{ i18n "punctuation_colon" }} {{ with $contentlocurl }}{{ end }}{{ . }}{{ with $contentlocurl }}{{ end }} + {{ with or $datecreated $contentreferencetime }} | {{ end }} + {{ end }} + {{ with $datecreated }} + {{ i18n "word_date" }}{{ i18n "punctuation_colon" }} {{ . }} + {{ with and (ne $datecreated $contentreferencetime) ($contentreferencetime) }} | {{ end }} + {{ end }} + {{ with and (ne $datecreated $contentreferencetime) ($contentreferencetime) }} + {{ i18n "word_time" }}{{ i18n "punctuation_colon" }} {{ . }} + {{ end }} + {{ end }} +
+ {{ end }} +

+
+
+ +{{- if and (templates.Exists "partials/schemas/schema_VideoObject.html") (ne $isplaylist true) }}{{ partial "schemas/schema_VideoObject.html" . }}{{ end -}} diff --git a/theme.toml b/theme.toml new file mode 100644 index 0000000..465c2ed --- /dev/null +++ b/theme.toml @@ -0,0 +1,33 @@ +# theme.toml template for a Hugo theme +# See https://github.com/gohugoio/hugoThemesSiteBuilder#theme-configuration for an example + +name = "Semantic Web for Hugo" +license = "MIT" +licenselink = "https://github.com/YourOnly-One/hugo-semantic-web/blob/master/LICENSE" +description = "Add structured data (Schema.org JSON-LD) to your website to improve SEO." + +# The home page of the theme, where the source can be found. +homepage = "https://github.com/YourOnly-One/hugo-semantic-web" + +# If you have a running demo of the theme. +#demosite = "https://gohugo.io" + +tags = ["SEO", "JSON-LD", "Schema.org", "Structured Data", "Linked Data", "SemWeb", "YourOnly.One"] +features = ["Organization", "WebSite", "WebPage", "WebContent", "Article", "BlogPosting", "Person", "ImageObject", "VideObject"] + +# If the theme has multiple authors +#authors = [ +# {name = "Name of author", homepage = "Website of author"}, +# {name = "Name of author", homepage = "Website of author"} +#] + +# If the theme has a single author +[author] + name = "YourOnly.One" + homepage = "https://youronly.one" + +# If porting an existing theme +[original] + author = "Martijn00" + homepage = "https://baseflow.com" + repo = "https://github.com/Baseflow/HugoStructuredData"