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

Simplifying and Unifying Static File Handling #368

Merged
merged 1 commit into from
Jan 14, 2025

Conversation

ia3andy
Copy link
Contributor

@ia3andy ia3andy commented Jan 13, 2025

This PR introduces changes to make static file management more consistent, intuitive, and easier to understand.

Before this, it wasn't possible to add static files directly to the root directory, which could cause issues (e.g., adding an HTML file for Google Search registration). This update addresses that limitation while unifying and simplifying related behaviours.

Key Changes:

  • Breaking Changes:
    • page.attachment() and site.staticFile() have been renamed to page.file() and site.file() for simplicity and consistency.
  • Static Files Directory:
    • Use public/ as the directory for static files.
    • Files in public/static/ will reproduce the same behavior as /static.
    • The static/ directory is still scanned for compatibility.
  • Default Image Directory:
    • The default image directory is now images (e.g., public/images/foo.png) instead of static/assets/images for simplicity.
    • The static/assets/images directory is still checked to support older sites.
  • QRCode Plugin:
    • Removed hardcoded values for QR codes in the AsciiDoc plugin. QR codes now use Base64, aligning to non asciidoc handing
  • Error Handling:
    • Using page.file() on non-directory pages now throws an error.
    • Using page.image() on a directory page will no longer fallback to site images if the image is not found; it will now throw an error.

These changes aim to simplify static file handling while maintaining backward compatibility where possible.

@ia3andy ia3andy requested a review from a team as a code owner January 13, 2025 20:10
Copy link

github-actions bot commented Jan 13, 2025

🙈 The PR is closed and the preview is expired.

@ia3andy ia3andy force-pushed the public-dir branch 3 times, most recently from 7b833fb to 4f41b51 Compare January 14, 2025 18:51
@ia3andy ia3andy changed the title Use public dir for clarity and to allow static files on root Simplifying and Unifying Static File Handling Jan 14, 2025
@ia3andy ia3andy merged commit e4cdd3d into quarkiverse:main Jan 14, 2025
4 checks passed
@ia3andy ia3andy deleted the public-dir branch January 14, 2025 19:57
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

Successfully merging this pull request may close these issues.

1 participant