Wow I should’ve tested assets out before making this post — it works and my site generates in ~12% of the time it used to. I’ll update with the structure of my project and what’s going on.
I previously posted about my weird site here: Complex use of taxonomy or subpage generation?
My project is structured as follows:
- content
- entries
- theories
- assets
- theories
Each theory in the content directory has it’s URL set to entries/%s/theories
in the frontmatter so that the theories of any entry can be found at the standard subdirectory.
In layouts/theories/single.html
I have the following:
{{- define "main" -}}
{{- $site := . -}}
<main>
{{ $file := printf "assets/theories/%s.html" $site.File.TranslationBaseName}}
{{ if fileExists $file -}}
{{ readFile $file | safeHTML }}
{{- end }}
</main>
{{- end -}}
Which inserts the HTML from the corresponding file in the assets directory into the template.