docsy icon indicating copy to clipboard operation
docsy copied to clipboard

Hugo-module "Setup a site from scratch" instructions are missing steps

Open chalin opened this issue 3 years ago • 3 comments

Both the TL;DR and the "Detailed steps" need to mention Install PostCSS.

chalin avatar Nov 10 '23 11:11 chalin

And to create postcss.config.js as per step 3 of https://gohugo.io/hugo-pipes/postcss/

module.exports = {
  plugins: [
    require('autoprefixer')
  ]
};

If you don't want error:

Error: error building site: POSTCSS: failed to transform "/scss/main.css" (text/css): Error: Loading PostCSS Plugin failed: Cannot find module 'autoprefixer'

a-h avatar Sep 12 '24 17:09 a-h

Put together a fix in https://github.com/google/docsy/pull/2612.

anishesg avatar Apr 26 '26 16:04 anishesg

As of Docsy 0.16.0, PostCSS is opt-in: Docsy only runs PostCSS for RTL languages or when your site provides a project-root postcss.config.{js,mjs,cjs} file (see PostCSS is opt-in for non-RTL sites in the 0.16.0 release notes). A site created via the start-from-scratch guide no longer needs PostCSS or autoprefixer, so the Cannot find module 'autoprefixer' error reported here can no longer occur on a default setup.

For sites that do want PostCSS processing, the setup steps live in Installation prerequisites § Install PostCSS (optional).

Closing as resolved by the 0.16.0 changes (confirmed in 0.17.0). This also supersedes #2612, which would reintroduce PostCSS as a required step.

chalin avatar Sep 02 '26 13:09 chalin