Configuring Limedocs

Configuration file

Configuration must be placed in a limedocs.config.js file placed in your site directory, like this:

my-super-site/
  ├── limedocs.config.js # <-- this file
  ├── content/
  ├── archetypes/
  └── theme/

Configuration properties

Multilingual properties

Default language

Useful for multilingual websites, the defaultLanguage property defines the default language that will be displayed to visitors. Defaults to en.

Example
module.exports = {
  // ...
  defaultLanguage: "it"
  // ...
}

Available languages

For multilingual websites, the languages property can be used to specify what languages are available on your site. Defaults to ["en"].

Example
module.exports = {
  // ...
  languages: ["en", "it", "fr"]
  // ...
}

Mixing languages

For multilingual websites, the mixLanguages property can be used to mix languages, e.g link to pages written in defaultLanguage when no translations are available for a given page. Defaults to false.

Example
module.exports = {
  // ...
  mixLanguages: true
  // ...
}

Server properties

Host

Specify the host to bind and listen to when using the limedocs dev or limedocs serve commands. Defaults to 0.0.0.0.

Example
module.exports = {
  // ...
  host: "127.0.0.1"
  // ...
}

Port

Specify port to bind and listen to when using the limedocs dev or limedocs serve commands. Defaults to 8889.

Example
module.exports = {
  // ...
  port: 8080
  // ...
}

Enable HTTPS

Use the secure property to enable HTTPS. Defaults to false.

Example
module.exports = {
  // ...
  secure: true
  // ...
}

Rendering properties

Dot files

Use the renderDotFiles property to specify whether or not render filenames starting with a dot. Defaults to false.

Example
module.exports = {
  // ...
  renderDotFiles: true
  // ...
}

Drafts

Use the renderDrafts property to specify whether or not render documents marked as draft. Defaults to false.

Example
module.exports = {
  // ...
  renderDrafts: true
  // ...
}

Underscore files

Use the renderUnderscoreFiles property to specify whether or not render filenames starting with an underscore. Defaults to false.

Example
module.exports = {
  // ...
  renderUnderscoreFiles: true
  // ...
}

Theme properties

Theme properties must be placed under the themeConfig object.

You can define one or more menus depending on the theme you're using. Menus does not necesseraly reflect your documentation tree: it can directly link to specific section, external locations, etc. Menus also support sub-menus. On this website, menus are used in the top navigation bar and in the footer.

Example
module.exports = {
  // ...
  themeConfig: {
    menus: {
      first: [ // a menu with id "first"
        {
          path: "quickstart" // path to a section
        },
        {
          url: "https://github.com", // external URL
          label: "Github project"
        },
      ],
      second: [ // a menu with id "second"
        {
          path: "quickstart/about.md", // path to a page
          label: "Github project",// override page title
        },
        {
          url: "https://npmjs.com",
          label: "NPM",
          menus: { // sub-menus
            platforms: [ // a sub-menu with id "platforms"
              {
                url: "https://docker.com",
                label: "Docker"
              },
              {
                url: "https://docker.com",
                label: "Docker"
              },

            ]
          }
        }
      ]
    }
    // ...
  }
  // ...
}

themeConfig.navShowPages defines what kind of pages to show in navigation bar.

  • all: show all pages from all sections & child sections

  • top-level-sections: show pages from all top-level sections

  • current-section: : show pages from current section

  • current-section-and-children: : show pages from current section and its child sections

    Defaults to top-level-sections.

Example
module.exports = {
  // ...
  themeConfig: {
    navShowPages: "current-section"
    // ...
  }
  // ...
}

HTML Meta-Tags

Use the themeConfig.metaTags Array property to specify HTML meta-tags objects to add to each page. Meta-tag objects can have the following properties:

  • name: Meta-tag name attribute. Can be one of application-name, author, description, generator, keywords, viewport.
  • charset: Meta-tag charset attribute.
  • http-equiv: Meta-tag http-equiv attribute.
  • content: Meta-tag content attribute.
Example
module.exports = {
  // ...
  themeConfig: {
    metaTags: [
      {
        name: "author",
        content: "John Doe"
      }
    ]
  }
  // ...
}

Theme

Use the themeConfig.theme property to specify theme to use (npm package name). Defaults to @limedocs/theme-yuzu. Package must be installed locally using npm install my-package within your site directory or globally (using npm install -g). Defaults to @limedocs/theme-yuzu.

Example
module.exports = {
  // ...
  themeConfig: {
    theme: "my-custom-theme"
  }
  // ...
}

Syntax highlighting theme

Use the highlightTheme property to specify syntax highlighting theme to use (from highlight.js). Defaults to monokai-sublime.

Example
module.exports = {
  // ...
  themeConfig: {
    highlightTheme: "ocean"
  }
  // ...
}

Use the themeConfig.showEditLink property to specify wether or not to show the edit-link. Defaults to false.

Example
module.exports = {
  // ...
  themeConfig: {
    showEditLink: true
    // ...
  }
  // ...
}

Table of contents

Table Of Content depth can be specified using tocDepth. Number between 1 and 6. defaults to 4.

Example
module.exports = {
  // ...
  themeConfig: {
    tocDepth: 5
    // ...
  }
  // ...
}

Stylesheets

Additional stylesheets can be specified using the stylesheets array property.

Example
module.exports = {
  // ...
  themeConfig: {
    stylesheets: [
      "static/css/limedocs-override.css"
    ]
    // ...
  }
  // ...
}

Google Analytics

Google analytics tracking can be set up using googleAnalytics object containing the following properties:

  • enabled: Boolean indicating whether or not to enable Google Analytics tracking.
  • trackingId: Your GA tracking ID
  • secondaryTrackingId: Your GA secondary tracking ID (optional)
Example
module.exports = {
  // ...
  themeConfig: {
    googleAnalytics: {
      enabled: true,
      trackingId: "UA-XXXX",
      secondaryTrackingId: "UA-YYYY",
    }
  }
  // ...
}

Other properties

Git repository

Git Repository informations can be specified using the repository containing the following properties:

  • branch: Git branch to use. Defaults to master.
  • path: Path to your site directory. Can be empty if your site resides at the root of your repository.
  • provider: Can be github, gitlab, bitbucket, or generic. Defaults to generic.
  • url: Git repository URL. Can be ssh or https URLs.
Example
module.exports = {
  // ...
  repository: {
    url: "https://github.com/developit/preact.git",
    path: "docs",
    provider: "github",
    branch: "master"
  }
  // ...
}

Base URL

Use the url propery to specify the base url of your website. Usually you will put this property within the env property so you can set different URLs for different environments. Defaults to http://{host}:{port}.

Example
module.exports = {
  // ...
  url: "http://myadomain.com"
  // ...
}
module.exports = {
  // ...
  env: {
    development: {
      url: "http://localhost:8889/"
      // ...
    },
    production: {
      url: "http://mydomain.com/"
      // ...
    }
  }
}

Using multiple environments

You may want to specify properties based on the environment. This can be done in the env property. Configuration values are thereby set dynamicaly based on the LIMEDOCS_ENV environment variable.

In the following example, the url value will be set to:

  • http://localhost:8889/ when LIMEDOCS_ENV is set to "development".
  • http://mydomain.com/path/to/site/ when LIMEDOCS_ENV is set to "production".

Example

module.exports = {
  // ...
  env: {
    development: {
      url: "http://localhost:8889/"
      // ... more properties
    },
    production: {
      url: "http://mydomain.com/path/to/site/"
      // ... more properties
    },
    staging: {
      url: "http://mydomain.com/path/to/site/"
      // ... more properties
    }
  }
  // ...
}

You can have a unlimited number of environments of any name.

Edit this page / submit change