Saber Config

You can use saber-config.yml, saber-config.toml, saber-config.js or saber-config.json for general configurations. All the possible config keys will be listed below.

Note that during development, changes made in the config file will NOT trigger rebuild, there're exceptions though, for siteConfig and themeConfig properties.


  • Type: string

The path to your theme or a npm package name (saber-theme- prefix is optional).


  • Type: object
  • Need Restarting: NO

This option is used for configuring the basic information of your website, e.g. siteConfig.title and siteConfig.description, these can be imported in your app:

import { siteConfig } from 'saber/config'

// You need to write custom logic to handle hot reloading
// ...

Alternatively you can access this.$siteConfig in your component, in this way it will automatically trigger hot reloading when the actual siteConfig changes.


  • Type: object
  • Need Restarting: NO

For reusuablity, a theme should use this option for customization instead of hard-coding everything in the theme itself.

Like siteConfig you can import it from saber/config or reference in component via this.$themeConfig.



  • Type: string
  • Default: /

The base URL your application will be deployed at. If your website is located at a sub directory, e.g., you should set this option to /blog/ (trailing slash is optional).


  • Type: boolean
  • Default: false

Extract CSS.


  • Type: boolean
  • Default: false

Source maps supports for CSS files.


  • Type: LoaderOptions
  • Default: {}

Options for css loaders:

interface LoaderOptions {
  /** sass-loader */
  sass?: any
  /** less-loader */
  less?: any
  /** stylus-loader */
  stylus?: any
  /** css-loader */
  css?: any
  /** postcss-loader */
  postcss?: any


  • Type: Array<Plugin>

Use a set of Saber plugins:

type Plugin =
  | string
  | {
      /** The path to your plugin or an npm package name */
      resolve: string
      /** Plugin options */
      options?: object


Customizing the internal markdown parser.


  • Type: string
  • Examples: limax ./my-slugify-utility

The path to a module or npm package name that slugifies the markdown headers. The module should have following signature:

type Slugify = (header: string) => string

You can use the limax which provides CJK support.


  • Type: string
  • Example: saber-highlighter-prism

The path to a module or npm package name that highlights code blocks in markdown. saber-highlighter- prefix is optional.

Note that a highlighter will only tokenize the code, you need to add corresponding CSS yourself.


  • Type: object

Options for markdown-it.


  • Type: Array<MarkdownPlugin>

Plugins for markdown-it:

interface MarkdownPlugin {
  // A package name or relative path
  // e.g. markdown-it-footnote
  resolve: string
  options?: object
  • Type: Permalinks (page: Page) => Permalinks
  • Default: /:posts/:slug.html for posts, /:slug.html for other pages

The template that is used to generate permalink for each page.

interface Permalinks {
  [pageType: string]: string

Note that the permalink for the homepage is always /.