Skip to content

devidw/hugo-theme-component-oembed

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hugo Theme Component: oEmbed

Add 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:

git submodule add https://github.com/devidw/hugo-theme-component-oembed.git ./themes/hugo-theme-component-oembed

Setup

Specify the output format in your config.yaml file:

outputFormats:
  # hugo-theme-component-oembed
  oembed:
    name: "oembed"
    baseName: "oembed"
    mediaType: "application/json"
    isPlainText: true

Also add the output format to the outputs array:

outputs:
  home:
    #
    - OEMBED # hugo-theme-component-oembed
  page:
    #
    - OEMBED # hugo-theme-component-oembed

Include the oembed.html partial in the <head> of you themes template file, for example baseof.html:

{{/* hugo-theme-component-oembed */}}
{{ partial "oembed.html" . }}

This will create a link like the following on page build:

<link rel="alternate"
      type="application/json+oembed"
      href="https://example.com/oembed.json">

Usage

Exlude a page from the oEmbed output:

notoembed: true

Releases

No releases published

Sponsor this project

 

Packages

No packages published

Languages