Diplodocus

Table of contents

Site Configuration

Diplodocus works without any settings, but there are some configurable options.

Diplodocus accepts YAML, JSON or TypeScript configuration files. The file should be diplodocus.(yaml|yml|json) in the same directory with the entry point file of Deno Deploy such as server.ts.

├── docs/
├── diplodocus.yml
└── server.ts

If there are multiple configuration files, Diplodocus will choose one of them by this priority: (high) yaml yml json (low).

Format

diplodocus.yaml / diplodocus.yml

sourceDir: docs

diplodocus.json

{
  "sourceDir": "docs"
}

Available Keys

These values below can be used to configure Diplodocus. All of them are optional.

sourceDir

Directory that served by Diplodocus. This should be relative path from the file calling Diplodocus.load().

rootFile

File name without extensions that served when accessed to the root path like https://example.deno.dev.

lang

Language of HTML files.

siteName

Site name. This is put on the top of the pages and <title> tag of the HTML files.

description

Site description. This is used in meta information of the HTML files.

favicon

Site favicon.

image

Site image. This will be shown in social links.

twitter

Twitter user name. This is put in og:twitter tag.

Array of the links on the navbar. Each item can have title, path and items.

Example:

{
  "navLinks": [
    { "title": "Documentation", "path": "docs" },
    { "path": "acknowledgements" },
    {
      "title": "Links",
      "items": [
        {
          "path": "https://github.com/kawarimidoll/deno-diplodocus",
          "title": "GitHub"
        },
        { "path": "https://deno.land/x/diplodocus", "title": "deno.land/x" }
      ]
    }
  ]
}

title

Title of the list. If this left blank, capitalized path is used.

path

Path the link leads to. Both of internal and external links are allowed. If items is present, this key is skipped.

items

Nested list items. Each item can have title and path above, path is required.

listPages

Array of the list pages. Each item can have title and path.

Example:

{
  "listPages": [
    { "path": "articles" },
    { "title": "My Products", "path": "products" }
  ]
}

title

Title of the list. If this left blank, capitalized path is used.

path

Path to directory that contains the files to list. This also used as path to link the page.

tocLevels

The header levels to show in auto-generated TOC (Table Of Contents). Set this [] to disable to generate TOC.

removeDefaultStyles

Flag to remove all default styles.

bottomHead

String to put into bottom of <head> tag without sanitization. Use it to append some tags.

bottomBody

String to put into bottom of <head> tag without sanitization. Use it to append some tags.