-
Notifications
You must be signed in to change notification settings - Fork 72
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
Conversation
Quick response: You can get svg icons from https://heroicons.com/ If the user doesn't specify editUrl in the yaml, I think we should just not show the edit link at all (no need for the default "edit/" hack, which wouldn't work anyway?). Heist is not great at handling optional values (see snapframework/heist#128 ) - but I wonder if we can workaround that by using lists and |
Under what situation would someone even want to do that? What I mean is: if you use |
I meant "nonempty editBaseUrl". Yeah the /edit path isn't useful; i put it in as a placeholder until i figure out how to omit the edit link from the output in case editBaseUrl isn't set. |
I'm not sure when I'm going to have time to dig in to figure out the empty-editBaseUrl case, so feel free to finish this, otherwise I'll come back to it next week or so. |
By the way, @edrex, do you know there is a way to achieve what you are doing here but without changing Emanote itself? Basically add your template to (You can just hardcode stuff in your .tpl; and no need to define any special .yml attribute) |
yeah, i just wanted to contribute something useful. I almost got this going yesterday, just needed to coax lookupAeson to return a Maybe |
This doesn't appear on the default Currently the EmaNote template makes the links go to the EmaNote repository. Update: It seems to be part of |
You have just discovered the undocumented HTML templating system (a powerful feature that neuron doesn't support), which allows you to override/customize any of HTML/CSS that Emanote generates. It works this way: look for any folder/file under https://github.com/srid/emanote/tree/master/default and copy it to your notebook, then make modifications.
|
These sites make use of HTML templating: https://blog.hemera.systems/ (view source) |
The template system is amazing. |
That's a good idea. Done in srid/emanote-template@8d75688 |
Nice, I need to get my public site up to exercise all this (still need to scrub private stuff, almost there). IIRC when I was looking at this there was some code forge whose edit URLs didn't have the form |
Implements an "Edit this page" link, a common feature for file-based static site gens.
I thought it would be good for me to start learning the template/view
end of the codebase so I can help myself more.
It's incomplete, but I wanted to get feedback.
Issues
Rather than choosing our own key (I usedResults: looking at hugo (not builtin) mkdocs.yml (concat repo_url with edit_uri), and mdbook (site.editBaseUrl
) findwhat other tools use and follow/boost convention.
edit-url-template
in TOML), there doesn't seem to be a convention.much. Where should it appear? Structurally, should it be in its own template?
your process for generating these?
baseUrl
meta key, but didn't see how to do that. Seems like Heist wants conditionals in Haskell, so I guess that requires some extra rendering logic?