Config Reference

Base Config

title

  • Type: string

The title for your website, generally used by themes.

description

  • Type: string

The description for your website, generally used by themes.

root

  • Type: string
  • Default: /

The root pathname of your website.

For example, you have to set it to /blog/ if your website is located at: https://website.com/blog.

sourceDir

  • Type: string
  • Default: source

The directory to your source files, relative to base directory.

  • Type: string
  • Default: :slug

The permanent link format of pages.

permalink.post

  • Type: string
  • Default: :year/:month/:day/:slug

The permanent link format of posts.

pwa

  • Type: boolean object
  • Default: false

PWA (Progressive Web App) support.

You can set enable it by setting this option to true or using an object for advanced usage:

// Default values when `true`
{
  // Show notifier when updatesare  available
  notifyUpdates: true,
  // Always skip waiting for service worker to be activated
  // You usually don't need this
  skipWaiting: false,
  updaterMessage: 'New contents are available...',
  updaterButtonText: 'Refresh'
}

googleAnalytics

  • Type: string object
  • Default: undefined

Track ID for Google Analytics.

pagination

  • pagination
    • perPage:
      • Default: 30

Set pagination to false to disable it.

categories

  • Type: boolean
  • Default: true

Whether to generate caregory archives.

tags

  • Type: boolean
  • Default: true

Whether to generate tag archives.

categoryMap

  • Type: object

Category name to URL path name mapping. e.g.:

{
  'Apple Pencil': 'apple-pencil'
}

In a markdown file:

---
title: My drawing
date: 2018-02-31
categories:
  - Apple Pencil
---

Draw something with the pencil...

Then you can access this category page via /categories/apple-pencil.

tagMap

Same as categoryMap for but tags.

feed

  • Type: boolean object
  • Default: undefined

Generate feed, disabled by default. When it's true, default options will be used:

{
  type: 'atom', // Only option for now
  path: 'atom.xml',
  limit: 20
}

Theme

theme

  • Type: string

It could be a theme name like theme: 'simple' for peco-theme-simple, or a local path.

themeConfig

  • Type: object

Theme-specific configurations.

markdown

markdown.slugify

Use a custom npm package for slugify headers, e.g. use limax for CJK support:

📝 peco.config.yml:

markdown:
  slugify: limax

You can also directory require a package when using JS config file:

📝 peco.config.js:

module.exports = {
  markdown: {
    slugify: require('limax')
  }
}

markdown.plugins

  • Type: An array of {name: string, options: any}
markdown:
  plugins:
    - name: markdown-it-footnote
      options: # optional options

Build Pipeline

chainWebpack

  • Type: (config: WebpackChain, context: Context) => void
    • Context: { type: 'client' | 'server' }

Extend webpack config with webpack-chain.