bowman2001 / perplex

A Hugo theme to publish technical content (docs, news, blog, articles)
https://perplex.desider.at
Apache License 2.0
27 stars 11 forks source link

Add ability to use PurgeCSS with custom colour schemes #160

Open danielfdickinson opened 6 months ago

danielfdickinson commented 6 months ago

Without this the CSS triggers 'CSS too large' warnings with ahrefs and PageSpeed when purgecss: false.

At present purgecss: true with a custom colour scheme uses the perplex built-in colour scheme for production. This is likely due to Perplex using a pregenerated CSS in production builds and not one generated including the user's custom colour scheme.

Another option is to have a separate colour.css.min.... in the output so that the main CSS remains pregenerated but the colour.css.min.... is generated from the user's CSS, as is with the case with custom.css.min.....

I don't know if you have seen my dropping of my princesandmadmen site and consolidation of danielfdickinson.ca with https://www.wildtechgarden.ca but I like way Perplex has helped me get the site looking good and reasonable lengths for titles, decriptions, etc.

The GitLab repo is at https://gitlab.com/danielfdickinson/pp-wildtechgarden if you are curious about the source (esp. css and the few custom layouts/shortcodes).

Oh, yes, I have used the resume template with some custom tweaks to the page's CSS (mostly to get the dates of employment on the right-hand side of the same line as the job title, or eductation/training completed).

I'm looking forward to your superscript/subscript extension being merged into Hugo. Awesome!

bowman2001 commented 6 months ago

When I check your starting page with Lighthouse, I get a 100, 100, 100, 100. I’m happy you could achieve this with this theme. So the page speed is currently not on the top of my list.

To let purgecss run also over customized CSS would be an enhancement, but I won’t be looking into this any time soon. I’ll leave the issue open for contributions.

danielfdickinson commented 6 months ago

Thank you for looking into this. I appreciate your position on this and I hadn't realized I was doing quite so well for the pagespeed scores, I was paying more attention to all the warning messages. :shrug: I guess I have to remember to take (especially) Ahrefs with a large dose of salt. I've noticed a few things where it sounds the alarm when there is a technical 'issue' but the overall effect is that things are quite good.

Thank you again.