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: add edit this page link #325

Merged
merged 3 commits into from
Nov 1, 2021
Merged

feat: add edit this page link #325

merged 3 commits into from
Nov 1, 2021

Conversation

HEIGE-PCloud
Copy link
Owner

Close #322

@HEIGE-PCloud HEIGE-PCloud added the new feature New feature label Nov 1, 2021
@HEIGE-PCloud HEIGE-PCloud added this to the v0.2.13 milestone Nov 1, 2021
@HEIGE-PCloud HEIGE-PCloud self-assigned this Nov 1, 2021
@HEIGE-PCloud HEIGE-PCloud added this to In progress in Roadmap via automation Nov 1, 2021
@vercel
Copy link

vercel bot commented Nov 1, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/pcloud/do-it/1QWxa92doi3ypzPAiqUAc8MKiEqB
✅ Preview: https://do-it-git-dev-edit-page-pcloud.vercel.app

@HEIGE-PCloud
Copy link
Owner Author

@eyllanesc Check this out :) https://do-it-git-dev-edit-page-pcloud.vercel.app/theme-documentation-basics

@HEIGE-PCloud
Copy link
Owner Author

I decide to use a magic variable {path} instead of %v to specify the relative path, and use replace instead of printf to process the URL. So the user can now set a specific URL for each individual page.

@eyllanesc
Copy link
Contributor

Could you explain to me with an example the phrase: So the user can now set a specific URL for each individual page.?

@HEIGE-PCloud HEIGE-PCloud merged commit 04aa3c6 into main Nov 1, 2021
Roadmap automation moved this from In progress to Done Nov 1, 2021
@HEIGE-PCloud HEIGE-PCloud deleted the dev/edit-page branch November 1, 2021 14:57
@HEIGE-PCloud
Copy link
Owner Author

HEIGE-PCloud commented Nov 1, 2021

Could you explain to me with an example the phrase: So the user can now set a specific URL for each individual page.?

The point is to detach the .File.Path from the linkToEdit.

For example, you can have this configuration in your config.toml

    linkToEdit = "https://github.com/HEIGE-PCloud/DoIt/edit/main/exampleSite/content/{path}"

And for one special post, you want to set the linkToEdit to something else for whatever reason. You just set the linkToEdit to a new value in the front matter, and use {path} for .File.Path if needed.

With the printf and %v implementation, set it to something like

  • linkToEdit = "https://github.com/a/url/without/path"
  • linkToEdit = "https://github.com/a/url/with/multiple/path?path"

is impossible.

This change just adds a little bit more flexibility and does not affect anything else.

@eyllanesc
Copy link
Contributor

Okay, I understand.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature New feature
Projects
No open projects
Roadmap
  
Done
Development

Successfully merging this pull request may close these issues.

[FEATURE] Edit this page
2 participants