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

"edit this page" links #176

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions default/templates/components/footer.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@
</path>
</svg>
</a>

</div>
</footer>
<div>
<a href="${ema:note:editUrl}" title="Edit this page" rel="edit">
<svg width="16" height="16" viewBox="0 0 20 20" fill="currentColor">
<path
d="M13.586 3.586a2 2 0 112.828 2.828l-.793.793-2.828-2.828.793-.793zM11.379 5.793L3 14.172V17h2.828l8.38-8.379-2.83-2.828z">
</path>
</svg>
</a>
</div>
</footer>
3 changes: 3 additions & 0 deletions docs/index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ page:
headHtml: |
<snippet var="js.prism" />

site:
editBaseUrl: https://github.com/srid/emanote/edit/master/docs/

pandoc:
rewriteClass:
# For use in notes with Prism.JS disabled
Expand Down
2 changes: 2 additions & 0 deletions src/Emanote/View/Template.hs
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,8 @@ renderLmlHtml model note = do
"tree:open" ## Heist.ifElseISplice (not . null $ children)
"ema:note:uptree:nonempty" ## Heist.ifElseISplice (not . null $ folgeAnc)
"ema:note:uptreeStr" ## HI.textSplice (toText . Shower.shower $ folgeAnc)
"ema:note:editUrl"
## HI.textSplice (MN.lookupAeson @Text "edit/" ("site" :| ["editBaseUrl"]) meta <> toText (R.encodeRoute $ R.lmlRouteCase r))
"ema:note:pandoc"
## withBlockCtx
$ \ctx ->
Expand Down