Skip to content

Latest commit

 

History

History
77 lines (58 loc) · 1.46 KB

README.adoc

File metadata and controls

77 lines (58 loc) · 1.46 KB

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