On Mon, 27 Nov 2023 at 14:20, Bertrand Delacretaz <bdelacre...@apache.org> wrote: > > Hi, > > I'd like to add an "edit in GitHub" link to the pages of > https://community.apache.org/ , like we have in Sling [1].
Personally, I would rather the link was to the page source in the comdev repo. Otherwise one is forced to clone the repo before one can see how easy the change is likely to be. > But I don't know how to do it with Hugo - before I dig too deep, does > someone have an example? Looks like the following can be used in the baseof.html template file as the URL target of a link: https://github.com/apache/comdev-site/blob/main/source/{{ .Page.File }} This can be nested in the conditional: {{ if .IsPage }} {{ end }} > For some pages like [2] which are generated instead of being backed by > a Markdown file, we'd need to either link to the repository home, or > add no link. > > -Bertrand > > [1] https://sling.apache.org/documentation/development.html (at the > bottom, "this page can be edited...") > [2] https://community.apache.org/tags.html > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscr...@community.apache.org > For additional commands, e-mail: dev-h...@community.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@community.apache.org For additional commands, e-mail: dev-h...@community.apache.org