Skip to content

cdowdy/bolt-webpack-theme-starter

Repository files navigation

Bolt CMS Webpack Theme Starter

This is a slightly opinionated Bolt CMS starter template using Webpack to build a theme for bolt.

This includes:

  • webpack
  • babel
  • node sass
  • mini-css-extract-plugin
  • postcss-loader
  • autoprefixer

It should be used as a "jumping off point".

You'll need to make one adjustment to either you config.yml or your config_local.yml in order for the webpack version assets to be delivered. this is undocumented by Bolt, and they currently have no interest in documenting this or accepting pull requests to document their undocumented use of something for developers. If you follow the docs that bolt links too they use a different config and it wont work. That change is as follows:

assets:
   theme:
        json_manifest_path: "/dist/manifest.json"

This allows your assets to be served from the "dist" directory with the hash that webpack creates.

this in a template:

<link rel="stylesheet" href="{{ asset('dist/css/app.css', 'theme') }}">

will produce:

<link rel="stylesheet" href="/theme/your_theme/dist/css/app.bbad62558ef19da7e0ca.css">  

the hash part comes from the json manifest produced by webpack.

theme.yml sets the twig template directory to the directory twig.

  • 1 Bootstrap, HTML5 Boilerplate and a few others recommend shring-to-fit=no be added to the viewport meta tag. I won't include it since it's an iOS specific thing, they provided no data as to why this is needed and who knows how long they'll continue to need it.

About

Bolt CMS webpack theme starter

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published