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

🐛 fix: allow pages within pages #385

Merged
merged 1 commit into from
Sep 17, 2024
Merged

🐛 fix: allow pages within pages #385

merged 1 commit into from
Sep 17, 2024

Conversation

welpo
Copy link
Owner

@welpo welpo commented Sep 17, 2024

Summary

Fixes the build error for pages nested within pages and implements a new hierarchy system to find the nearest parent page or section for nested pages.

Related issue

Fixes #384.

Changes

  • Fix build error for pages nested within pages by checking for last_ancestors length
  • When a page is within a page, the hierarchy would not find the nearest section. This PR implements the logic to find the parent page or nearest section based on the page.components. It uses a hack to check if a file (section) exists and manually builds the path to the _index.md. In short: it's fragile. It was either this or have the hierarchy not work for nested pages.
  • Update docs regarding Hierarchy to mention nested pages behaviour
  • Add comprehensive debugging output for future troubleshooting

Type of change

  • Bug fix (fixes an issue without altering functionality)
  • New feature (adds non-breaking functionality)
  • Breaking change (alters existing functionality)
  • UI/UX improvement (enhances user interface without altering functionality)
  • Refactor (improves code quality without altering functionality)
  • Documentation update
  • Other (please describe below)

Checklist

  • I have verified the accessibility of my changes
  • I have tested all possible scenarios for this change
  • I have updated theme.toml with a sane default for the feature
  • I have made corresponding changes to the documentation:
    • Updated config.toml comments
    • Updated theme.toml comments
    • Updated "Mastering tabi" post in English
    • (Optional) Updated "Mastering tabi" post in Spanish
    • (Optional) Updated "Mastering tabi" post in Catalan

- Fix build error for pages nested within pages
- Implement robust section detection for multilingual sites
- Maintain correct hierarchy for nested pages
- Add comprehensive debugging output for future troubleshooting
@welpo welpo added bug Something isn't working enhancement New feature or request labels Sep 17, 2024
Copy link

netlify bot commented Sep 17, 2024

Deploy Preview for tabi-demo ready!

Name Link
🔨 Latest commit 26af3aa
🔍 Latest deploy log https://app.netlify.com/sites/tabi-demo/deploys/66e9fac5ca5571000886e240
😎 Deploy Preview https://deploy-preview-385--tabi-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@welpo welpo mentioned this pull request Sep 17, 2024
@welpo welpo merged commit 0bebcd1 into main Sep 17, 2024
7 checks passed
@welpo welpo deleted the fix/nested-page-hierarchy branch September 17, 2024 22:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sub-pages cause error
1 participant