Skip to content

feat: add "Edit this page" link #130

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

Merged
merged 3 commits into from
Jul 12, 2024

Conversation

AriPerkkio
Copy link
Member

@AriPerkkio AriPerkkio commented Jul 11, 2024

Adds support for "Edit this page" link.

---
type: part
title: Basics
editPageLink: https://github.com/stackblitz/tutorialkit/tree/main/packages/template/src/content/tutorial/:path
---

Inherited editPageLink can be disabled on lower hierarcy:

---
type: lesson
title: Some lesson
editPageLink: false
---

See bottom-left corner:

Copy link

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@AriPerkkio AriPerkkio force-pushed the feat/edit-page-link branch from 83bef8e to 71c10f4 Compare July 12, 2024 08:55
@AriPerkkio AriPerkkio marked this pull request as ready for review July 12, 2024 08:56
@AriPerkkio AriPerkkio requested a review from Nemikolh July 12, 2024 08:56
Copy link
Member

@Nemikolh Nemikolh left a comment

Choose a reason for hiding this comment

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

This is looking great! 😃

One immediate feedback that comes to mind is regarding the use of :path. I think I see where this is coming from but I would prefer if we used ${path} because:

  • It's not behaving as route parameters in express-like servers where :path would only match a segment (so only until the next /). Here it instead does a string replace.
  • To use the same convention everywhere. If we're sold on using ${variable} for string interpolation in the metadata then let's use it everywhere we need that feature.

Note that I'm also open to a different syntax. I picked ${variable} initially because it's similar to JavaScript's template literal syntax.

@AriPerkkio AriPerkkio force-pushed the feat/edit-page-link branch from dccc2ad to b641643 Compare July 12, 2024 10:13
@AriPerkkio
Copy link
Member Author

One immediate feedback that comes to mind is regarding the use of :path. I think I see where this is coming from but I would prefer if we used ${path} because:

I've changed the pattern to ${path} now - it's better to be consistent with rest of the codebase. And partTemplate was already following this pattern. The :path convention was from VitePress.

@AriPerkkio AriPerkkio force-pushed the feat/edit-page-link branch from b641643 to 14754c2 Compare July 12, 2024 10:17
Copy link
Member

@Nemikolh Nemikolh left a comment

Choose a reason for hiding this comment

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

Nice!! Really good work on this 🤩

Love it ❤️

@Nemikolh Nemikolh merged commit dd9c52c into stackblitz:main Jul 12, 2024
8 checks passed
@AriPerkkio AriPerkkio deleted the feat/edit-page-link branch July 12, 2024 10:55
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.

2 participants