Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jmooring opened this issue Feb 6, 2024 · 1 comment
Open

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

jmooring opened this issue Feb 6, 2024 · 1 comment

Comments

@jmooring
Copy link
Member

jmooring commented Feb 6, 2024

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.

  • In v0.123.0, everything inside /content is either a Page or a bundled Resource.
  • Before v0.123.0, we had two cases we treated as "static content": the raw HTML files (see above) and non-content files (e.g. images, text files) that lived in folders below branch bundles. Now that we have lifted that restriction, everything is either a Page or a bundled Resource.
  • And all pages and resources will get a logical path.
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 ✔️ ✔️
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.123.0

File Page resource Copied to public
foo.jpg ✔️ ✔️
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 ✔️

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 jmooring self-assigned this Feb 9, 2024
@jmooring jmooring changed the title Document v0.123.0 change to HTML files as page resources Document v0.123.0 HTML as page resource fix Feb 9, 2024
@jmooring
Copy link
Member Author

jmooring commented Feb 9, 2024

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.

@jmooring jmooring changed the title Document v0.123.0 HTML as page resource fix Document handling of content vs. non-content page resources Feb 9, 2024
@gohugoio gohugoio deleted a comment from bep Feb 9, 2024
@jmooring jmooring removed their assignment Jun 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant