decaporg / one-click-hugo-cms

Hugo template with Decap CMS
https://master-template-one-click-hugo-cms.netlify.app
MIT License
499 stars 298 forks source link

SVG processing does not match documentation #213

Closed gp-dublincentral closed 9 months ago

gp-dublincentral commented 5 years ago

- Do you want to request a feature or report a bug? What I think is a bug or at least inaccuracy in the docs

- What is the current behavior? In the SVG section od https://github.com/netlify-templates/one-click-hugo-cms/blob/master/README.md it says:

1/ automatically optimized with SVGO (gulp-svgmin)

2/ concatenated into a single SVG sprite stored as a a partial called svg.html

I don't think either of these things are happening.

- If the current behavior is a bug, please provide the steps to reproduce.

Add a new icon (e.g. icons-whatsapp.zip ) to site\static\img and neither of the above steps seems to happen

- What is the expected behavior?

A previous version used to have a build command that would merge/overlay site\static\img\icon.svg with each of site\static\img\icons-* and create the SVG snippet that could be inserted into site\layouts\partials\svg.html

I think the docs should be updated to reflect what is happening or vice versa.

- Please mention your node.js, NPM, Hugo and operating system version.

erquhart commented 5 years ago

Agreed 👍

marco-dsi commented 3 years ago

Hi, I've been trying to add an svg to this template and I cannot get the svg.html to rebuild. I tried running yarn build to no avail. Help would be greatly appreciated. Thanks.

desbo commented 1 year ago

I'm also running into this when trying to add a new SVG. The SVG compilation process to update svg.html doesn't seem to happen at all.

tanyabouman commented 10 months ago

I found a similar project that uses svgmin with gulp instead of webpack. Maybe that is useful for fixing the svg processing here. https://github.com/darindimitroff/netlify-cms-template/blob/master/gulpfile.babel.js#L52-L67

tanyabouman commented 9 months ago

Even easier, Hugo's builtin resources.Minify looks like it should take care of SVGs, and the icons can be inline.

martinjagodic commented 9 months ago

I vote for the Hugo minifier and using them inline. It's the least amount of work.