I’m in the process of migrating a Google AMP page from Grow to Hugo. One aspect of that requires the CSS files to be inlined. Most examples I’ve found recommend either using a partial (as seen in a few AMP themes), or else using readFile. The partials approach isn’t ideal for me, as I use webpack to generate my CSS and related files (including fonts), and dumping them all into the partials folder leads to errors about encoding in the woff2 files, and copying just the CSS file to partials seems unnecessary.
As such, I’m trying to use readFile, which (according to the documentation) should return a string from a file, and requires a path to be given relative to the root of the project. My problem is that following the directions, I receive an error from Hugo stating that the file doesn’t exist, and lists the path. The path should be
/themes/custom/static/css/style.css, but the error indicates the file path ends up being
config.toml files are largely the defaults (save some unrelated language setup). This is in Hugo version
0.38.2 from the ArchLinux repositories. Is this the intended result, or is there a setting I can change somewhere?
Thanks in advance.