Hyperbook Documentation

Book Configuration

In your new Hyperbook project you will find a hyperbook.json file. This file is for configuring Hyperbook. Here is a list of options you can and part wise must set (indicated by a *).

PropertyDescription
name*Name of your Hyperbook. Used for the page header.
descriptionDescription of your Hyperbook. Used for SEO.
logoURL to a logo. Used for the page title. Can be relative to the public folder or an absolute URL
author.nameAuthor name of your Hyperbook. Used in the footer.
author.urlUsed to link the author name in the footer.
fontURL to a font. Used for headings and body. You can add ":90%" for adjusting the font size.
fonts.headingURL to a font. Used for headings. You can add ":90%" for adjusting the font size.
fonts.bodyURL to a font. Used for body. You can add ":90%" for adjusting the font size.
fonts.codeURL to a font. Used for code. You can add ":90%" for adjusting the font size.
colors.brandThe color for the header and the accents for example on links.
colors.brandDarkThe color for the header and the accents for example on links, if the user prefers a dark theme. Brand text is not used for the dark theme.
colors.brandTextThe color for the text in the header
basePathWhen deploying to a subdirectory, for example on GitHub pages, you can set a base path.
licenseLicense under the Hyperbook is published.
languageThe language of the Hyperbook.
repoThe link to the GitHub repo. Used for showing an edit button. The %path% placeholder will be replaced by the current path or the current path will be appended.
repo.urlThe link to the repo. Used for showing an edit button. The %path% placeholder will be replaced by the current path or the current path will be appended.
repo.labelThe label for the repo link.
elementsHere you can configure the elements. See the element pages for configuration options.
linksHere you can add custom links, which will be shown in the top right corner. See the example below on how to use them.
trailingSlashOutputs all files into ther own folders and produces only index.html files.

Here is an example configuration:

{
  "name": "Hyperbook Documentation",
  "description": "Documentation for Hyperbook created with Hyperbook",
  "author": {
    "name": "OpenPatch",
    "url": "https://openpatch.org"
  },
  "font": "/fonts/my-font.woff2:90%",
  "logo": "/logo.png",
  "license": "CC-BY-SA",
  "language": "en",
  "basePath": "/hyperbook-github-pages",
  "repo": {
    "url": "https://github.com/mikebarkmin/hyperbook-github-pages/edit/main/%path%",
    "label": "Edit on GitHub"
  },
  "colors": {
    "brand": "#FF0000"
  },
  "elements": {
    "bookmarks": false
  },
  "links": [
    {
      "label": "Contact",
      "links": [
        {
          "label": "Mail",
          "icon": "📧",
          "href": "mailto:contact@openpatch.org"
        },
        {
          "label": "Twitter",
          "icon": "🐦",
          "href": "https://twitter.com/openpatchorg"
        },
        {
          "label": "Mastodon",
          "icon": "🐘",
          "href": "https://fosstodon.org/@openpatch"
        },
        {
          "label": "Matrix (Chat)",
          "icon": "👨‍💻",
          "href": "https://matrix.to/#/#hyperbook:matrix.org"
        }
      ]
    },
    {
      "label": "OpenPatch",
      "href": "https://openpatch.org"
    }
  ]
}
✎ GitHub© Copyright 2024 by OpenPatch.