$page.title: Source code highlighting

Hello Saber!

This result of 1 + 1 is: 2


  1. install:
    npm i -ED saber-plugin-prismjs
    npm i -E prismjs saber-highlight-css
  2. configure in saber-config.js file:
    module.exports = {
      plugins: [
        { resolve: 'saber-plugin-prismjs' },
      ],
    };
  3. add css in saber-browser.js file:
    import 'prismjs/themes/prism.css';
    import 'saber-highlight-css/default.css';
  4. test it YAML:
    siteConfig:
    title: Saber
    description: A framework for building modern static websites.
    theme: ./src
    siteConfig:
      title: Saber
      description: A framework for building modern static websites.
    
    theme: ./src
    JavaScript:
    [
    {
    text: 'A page',
    slug: 'a-page',
    level: 1
    },
    {
    text: 'A section',
    slug: 'a-section',
    level: 2
    },
    {
    text: 'Another section',
    slug: 'another-section',
    level: 3
    }
    ]
    [
      {
        text: 'A page',
        slug: 'a-page',
        level: 1
      },
      {
        text: 'A section',
        slug: 'a-section',
        level: 2
      },
      {
        text: 'Another section',
        slug: 'another-section',
        level: 3
      }
    ]

const foo = `{{ safe, this won't be interpolated! }}`

And {{ bar }} is safe too! {{ yeah }}


This is an example:


available Object.keys($page): [
  "type",
  "internal",
  "contentType",
  "slug",
  "content",
  "createdAt",
  "updatedAt",
  "title",
  "markdownHeadings",
  "excerpt",
  "permalink",
  "assets",
  "attributes"
]
[
  {
    "text": "Hello Saber!",
    "slug": "hello-saber",
    "level": 2
  }
]
$siteConfig: {
  "url": "https://daggerok.guthub.io/saber-examples",
  "author": "daggerok",
  "email": "daggerok@gmail.com",
  "description": "Write an awesome description for your new site here.\n      You can edit this line in saber-config.yml of in saber-config.js files.\n      It will appear in your document head meta (for Google search results) site description."
}
$localePath: /
$themeConfig: {
  "nav": [
    {
      "text": "Home",
      "link": "/"
    },
    {
      "text": "About",
      "link": "/about.html"
    }
  ],
  "social": {
    "rss": true,
    "github": "daggerok",
    "twitter": "daggerok"
  }
}

NOTE: see https://saber.land/docs/markdown-features.html#code-highlighting