https://github.com/devidw/hugo-theme-component-oembed
Static oEmbed endpoint for Hugo websites
https://github.com/devidw/hugo-theme-component-oembed
endpoint hugo hugo-theme-component json oembed static
Last synced: 3 months ago
JSON representation
Static oEmbed endpoint for Hugo websites
- Host: GitHub
- URL: https://github.com/devidw/hugo-theme-component-oembed
- Owner: devidw
- License: gpl-3.0
- Created: 2021-12-08T21:32:31.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-03-13T18:58:53.000Z (over 3 years ago)
- Last Synced: 2024-10-18T21:04:20.946Z (8 months ago)
- Topics: endpoint, hugo, hugo-theme-component, json, oembed, static
- Language: HTML
- Homepage:
- Size: 16.6 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.adoc
- License: LICENSE
Awesome Lists containing this project
README
= Hugo Theme Component: oEmbed
David WolfAdd a static oEmbed endpoint to your hugo website by generating a oEmbed file for each of your posts.
Currently supported oEmbed content types:
* `link`
== Installation
Add the theme component as submodule to your hugo prject:[source,zsh]
----
git submodule add https://github.com/devidw/hugo-theme-component-oembed.git ./themes/hugo-theme-component-oembed
----// == Configuration
// …== Setup
Specify the output format in your `config.yaml` file:[source,yaml]
----
outputFormats:
# hugo-theme-component-oembed
oembed:
name: "oembed"
baseName: "oembed"
mediaType: "application/json"
isPlainText: true
----Also add the output format to the `outputs` array:
[source,yaml]
----
outputs:
home:
# …
- OEMBED # hugo-theme-component-oembed
page:
# …
- OEMBED # hugo-theme-component-oembed
----Include the `oembed.html` partial in the `` of you themes template file, for example `baseof.html`:
[source,go]
----
{{/* hugo-theme-component-oembed */}}
{{ partial "oembed.html" . }}
----This will create a link like the following on page build:
[source, html]
--------
== Usage
Exlude a page from the oEmbed output:[source,yaml]
----
notoembed: true
----== Resources
* https://oembed.com[oEmbed]
* https://halfelf.org/2021/oembedding-hugo/[oEmbedding Hugo]