gohugoio / hugoDocs

The source for https://gohugo.io/
Apache License 2.0
1.05k stars 1.48k forks source link

Document handling of content vs. non-content page resources #2428

Open jmooring opened 7 months ago

jmooring commented 7 months ago

In v0.123.0 we handle all content files (.adoc, .html, .md, .org, .pdc, and .rst) the same way. Before v0.123.0 we just copied raw HTML files (files starting with an HTML element that is not a commented out front matter) directly to the public directory without any processing, just as if they were placed in the /static directory.

content/
└── posts/
    └── post-1/
        ├── foo.jpg
        ├── index.md
        ├── with-front-matter.html
        ├── with-front-matter.md
        ├── without-front-matter-begins-with-<.html
        ├── without-front-matter-does-not-begin-with-<.html
        └── without-front-matter.md

v0.122.0

File Page resource Copied to public
foo.jpg :heavy_check_mark: :heavy_check_mark:
with-front-matter.html :heavy_check_mark: :x:
with-front-matter.md :heavy_check_mark: :x:
without-front-matter-begins-with-<.html :heavy_check_mark: :heavy_check_mark:
without-front-matter-does-not-begin-with-<.html :heavy_check_mark: :x:
without-front-matter.md :heavy_check_mark: :x:

v0.123.0

File Page resource Copied to public
foo.jpg :heavy_check_mark: :heavy_check_mark:
with-front-matter.html :heavy_check_mark: :x:
with-front-matter.md :heavy_check_mark: :x:
without-front-matter-begins-with-<.html :heavy_check_mark: :x:
without-front-matter-does-not-begin-with-<.html :heavy_check_mark: :x:
without-front-matter.md :heavy_check_mark: :x:

To test the above:

git clone --single-branch -b hugo-github-issue-11999 https://github.com/jmooring/hugo-testing hugo-github-issue-11999
cd hugo-github-issue-11999
rm -rf public/ && hugo && tree public

Address terminology issues and clarification requests as described here: https://discourse.gohugo.io/t/shortcode-for-iframe-breaking-at-update-hugo-122-x-123-8/48904/13

jmooring commented 7 months ago

This was undocumented behavior, but we still need to document the difference between content files and non-content files in a page bundle.

See https://discourse.gohugo.io/t/companion-page-bundle-html-files-not-being-copied-to-subfolder-of-output-directory-anymore/48502/2 for examples and new way to handle this.