# How to create "Edit on Github" links, while disturbing the theme as little as possible?

**URL:** <https://discourse.gohugo.io/t/how-to-create-edit-on-github-links-while-disturbing-the-theme-as-little-as-possible/47753>\
**Category:** support\
**Created:** [January 8, 2024, 11:52pm UTC](https://discourse.gohugo.io/t/how-to-create-edit-on-github-links-while-disturbing-the-theme-as-little-as-possible/47753 "2024-01-08T23:52:36Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![antoinentl](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/antoinentl/32/12914_2.png) [@antoinentl](https://discourse.gohugo.io/u/antoinentl)\
**Post date:** [January 9, 2024, 12:57am UTC](https://discourse.gohugo.io/t/how-to-create-edit-on-github-links-while-disturbing-the-theme-as-little-as-possible/47753/2 "2024-01-09T00:57:47Z")

</div>

You can do that with different ways, for example:

- add a repository parameter in your `config`:

```auto
[params]
  repository = "https://github.com/group/repo"

```

You have to change both “group” and “repo” in this URL.

- add this line in your template(s):

```auto
<a href="{{ .Site.Params.repository }}/edit/main/content/{{ .File.Path }}">Edit this page</a>

```

As you can see, `/edit/main/` depend on GitHub and on the name of your _main_ branch. And `content` is the folder of your _content_. You must tweak it to suit the template.

---

_[View the full topic](https://discourse.gohugo.io/t/how-to-create-edit-on-github-links-while-disturbing-the-theme-as-little-as-possible/47753)._
