Closed davidsneighbour closed 4 years ago
The repo is here if it needs testing: https://github.com/davidsneighbour/samui-samui.de
Are you saying that the above doesn't work?
Sorry, I just assumed that the encoding like \u003c would throw errors when I run npm install
or one of the npm scripts. I recreated the issue just now and it appears that the encoding does not turn up on every call of hugo mod npm pack
. I ran it twice this time to see the encoded characters.
Also I checked npm install
and npm run algolia
and it appears that those encodings can be read by npm - both commands run without complaining. So this is probably something that can be closed.
It's just not very readable for humans.
Running npm install
after hugo mod npm pack
changes the encoding back to readable characters.
Also, the sorting of package.json ends up alphabetically. If it's possible then the comment array should just be added to the end instead of resorting the whole file? I know that's hair splitting, but a package.json that has the name, version and other main information in the beginning is better readable, don't you think?
This is Go's JSON encoder; I will have a look at this, but I'm not ... implementing a JSON encoder. I have a very unsentimental relationship with how my package.json is ordered.
Also, you need to consider package.hugo.json
as the new origina -- the file you edit ... There are some missing pieces in all of this, but I had to start somewhere.
closing this in favour of being less pedantic about the order in package.json.
There is a npm package called fixpack that solves this issue for everyone with OCD :)
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
What version of Hugo are you using (
hugo version
)?Running
hugo mod npm pack
breaks regular special characters and encodes them in package.json.Original:
After running
hugo mod npm pack
(not sure if I understand the use of the command right)