I am trying to create a SCORM manifest XML file, which essentially lists all the files (html + assets) by section. Note that these have to include the actual filename (not permalink).
I managed to set up a custom output format, and it’s generating fine. But I’ve stumbled on the file listing part. Essentially, I need to run readDir on my publishDir so I can list the files as they are published, and not on the folder containing source files.
When I run:
{{ range (readDir "/") }}
{{ .Name }}
{{ end }}
I get the project folders (assets, config, content, data, layouts, resources, static). So the contents of my site folder. I’d like to run:
{{ range (readDir "../build/") }}
{{ .Name }}
{{ end }}
But that errors out:
execute of template failed: template: _default/section.imsmanifest.xml:47:26: executing “_default/section.imsmanifest.xml” at <readDir “…/build”>: error calling readDir: failed to read directory “…/build”: open …/build: file does not exist
Is what I’m trying to do possible? Or should I suck it up and do it in webpack. (I’m using victor-hugo, so node is already part of the stack).