Hugo Theme Component to add a JSON API for your content
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
data
layouts
LICENSE
README.md
config.example.toml
theme.toml

README.md

Hugo JSON API Theme component

Theme Component to add a JSON API for your content

View Demo

Install

  1. Install to themes/ as a submodule:
    git submodule add https://github.com/dwalkr/hugo-json-api-component themes/json-api
    
  2. Update the theme setting in your config.toml, e.g. theme = ["your-current-theme","json-api"] if you already use a theme or simply theme = "json-api" if you don't.
  3. Enable the JSON output format for our list and single views in config.toml:
[outputs]
    page = ["html","json"]
    section = ["html","json"]

And you're done! Restart your Hugo server and you should be able to access the JSON data by adding /index.json to the end of section and page URLs.