The hugo theme PaperMod which I use for this site, has a nice function to editPost which adds a kind of edit button on each page which leads to the source of the page to quickly fix and change the page content. If really like this feature but I was kind of unable to use it in the right way from the beginning. This post is now used to figure out a working solution.

1
2
3
4
editPost:
  URL: "https://github.com/<owner>/<repo name>/tree/<branch name>/<path to content>/"
  Text: "Suggest Changes" # edit text
  appendFilePath: true # to append file path to Edit link

To my understanding the URL shall lock like the example above which is basically the path to the github repo extended with tree/<branch name>/<path to the content> especially the part with the branch name is a little bit tricky because, the link will only work if the file already exists in the repo. That might not be the case during writing.