atlas icon indicating copy to clipboard operation
atlas copied to clipboard

Ideas/Roadmap for Atlas

Open crgeary opened this issue 5 years ago • 5 comments

  • [x] Migrate to Hugo Pipes
  • [x] Remove NetlifyCMS from repo
  • [x] Consider removing BrowserSync in favour of hugo server
  • [ ] Make it easier to use Hugo Themes
  • [ ] Add bot for automatically updating Hugo in netlify.toml
  • [x] Remove Sass lint
  • [ ] Add debug/demo theme
  • [ ] Include partials for SEO & OpenGraph
  • [ ] Consider some good defaults for partials & shortcodes
  • [ ] Add uncss/purgecss support

crgeary avatar Dec 10 '18 15:12 crgeary

have u guys considered adding uncss/purgecss?

bronze avatar Jul 16 '19 18:07 bronze

It has come up before, but this was way back before Hugo released "Pipes", and we decided to wait for that to release. Consequently it was forgotten about.

I'll add it to the list, thanks for the suggestion! :)

crgeary avatar Jul 16 '19 19:07 crgeary

oh hey! i adapted some configurations/ideas from https://github.com/budparr/hugopipes-tailwindcss/ for PurgeCSS and ended up making Uncss work (their docs did NOT help. thanks @budparr for the inspiration!) uncss and postcss-uncss as package dependencies, and a production postcss.config.js with

    require('postcss-uncss')({
      html: ['layouts/**/*.html'],
    }),

this config is called on {{ $style := resources.Get "scss/uikit.scss" | toCSS (dict "targetPath" "css/style.css" "enableSourceMap" false) | postCSS (dict "config" "./assets/css/postcss.config.js") | minify | fingerprint }}

uikit reduced from 112kb normal to 12k with purgecss and 4kb with uncss (same site, same content)

Even the guys at PurgeCSS seem to think Uncss can be more accurate.

I wanted to use Uncss because i thought since uncss can be used as a postcss plugin, i wouldnt need to install node and just run hugo... i was wrong i guess.

Hope these links can be of some help. -cheers

bronze avatar Jul 16 '19 20:07 bronze

Thanks for the info... Unfortunately, I just implemented this with PurgeCSS. (or most of it anyhow). You can find it in it's currently (mostly untested state here: #73).

I believe Hugo just runs the command line version of PostCSS for you behind the scenes. So you would need Node installed to run it (you need Node installed for Atlas anyway because we also use Autoprefixer through PostCSS).

I'm not tied to PurgeCSS, I'd be happy to use UnCSS.. So I'll take a look at your notes in more detail, and possibly look at converting it over. (Not sure when, as I don't do much Hugo work at the moment). I would also welcome a PR if you're interested.

Thanks again for the notes above 👍

crgeary avatar Jul 16 '19 20:07 crgeary

your postcss.config.css file helped a LOT. i could remove the postcss config call at layouts.

if ('production' === process.env.NODE_ENV) {
    plugins.push(
        require('postcss-uncss')({
            html: ['layouts/**/*.html'],
            ignore: [],
        })
    );
}

just tested this at my fork and worked great! just had to add cross-env to package.json too, like in your branch.

-cheers

bronze avatar Jul 16 '19 21:07 bronze