Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/devidw/hugo-theme-component-structured-data

Hugo Theme Component for Structured Data
https://github.com/devidw/hugo-theme-component-structured-data

hugo hugo-theme hugo-theme-component jsonld seo seo-optimization seo-tools static structured-data

Last synced: 28 days ago
JSON representation

Hugo Theme Component for Structured Data

Awesome Lists containing this project

README

        

= Hugo Theme Component for Structured Data

You can use the Structured Data Theme Component on your own theme by following the instructions below. Also make sure to check out the https://gohugo.io/hugo-modules/theme-components/[docs about Theme Components].

.Currently available schema types include:
* BlogPosting

== Installation
=== 1. Clone this theme component to your `/themes` directory
[source, sh]
----
git submodule add https://github.com/devidw/hugo-theme-component-structured-data ./themes/hugo-theme-component-structured-data
----

=== 2. Add this theme component to your list of themes inside your config-file
[source, toml]
----
theme = ["…", "hugo-theme-component-structured-data", "…"]
----

=== 3. Add the following statement in the layout file where your `` lives:
[source, go]
----
{{ partial "structureddata/include.html" . }}
----

// NOTE: When using the https://hugoseotheme.com[Hugo Theme for perfect SEO] this will be done automatically for you so there's really no more configuration needed here.

== Usage
Add `schemas` key to your content frontmatter and provide an array of content types as value, e.g. `[BlogPosting]`.

.Yaml example
[source, yaml]
----
schemas: [BlogPosting]
----

=== Configuration
|===
| Required

a|
* `BaseURL`
* `LanguageCode`
|===

=== Frontmatter
|===
| Required | Optional

a|
* `date`
* `title`

a|
* `author`
* `description`
* `lastmod`
* `lang`
|===