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

feat(document-driven): support navigation.redirect from _dir files #1545

Merged
merged 2 commits into from Sep 21, 2022

Conversation

farnabaz
Copy link
Member

@farnabaz farnabaz commented Sep 20, 2022

πŸ”— Linked issue

resolves #1521

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@netlify
Copy link

netlify bot commented Sep 20, 2022

βœ… Deploy Preview for nuxt-content ready!

Name Link
πŸ”¨ Latest commit b15829d
πŸ” Latest deploy log https://app.netlify.com/sites/nuxt-content/deploys/632aeefd04ce700009498dab
😎 Deploy Preview https://deploy-preview-1545--nuxt-content.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 settings.

@@ -224,6 +224,7 @@ export default defineNuxtPlugin((nuxt) => {

// Use `redirect` key to redirect to another page
if (_page?.redirect) { return _page?.redirect }
if (_page?._dir?.navigation?.redirect) { return _page?._dir?.navigation?.redirect }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can leverage navKeyFromPath(_page._path, 'redirect', navigation) instead of fetching the _dir.yml

@farnabaz farnabaz merged commit 5fc042b into main Sep 21, 2022
@farnabaz farnabaz deleted the feat/_dir_redirect branch September 21, 2022 11:11
@farnabaz farnabaz mentioned this pull request Oct 19, 2022
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.

[Document Driven] Support navigation.redirect in _dir.yml
2 participants