File: edit-on-github-link.md

package info (click to toggle)
ruby-jekyll-github-metadata 2.16.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 740 kB
  • sloc: ruby: 2,394; javascript: 107; sh: 41; makefile: 6
file content (30 lines) | stat: -rw-r--r-- 787 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
## Edit on GitHub link

The plugin also makes a tag available that generates links to edit the current page on GitHub.

### To generate a link

```liquid
<p>This site is open source. {% raw %}{% github_edit_link "Improve this page" %}{% endraw %}</p>
```

Produces:

```html
<p>This site is open source. <a href="https://github.com/benbalter/jekyll-edit-link/edit/master/README.md">Improve this page</a></p>
```

### To generate a path

If you'd prefer to build your own link, simply don't pass link text

```liquid
<p>This site is open source. <a href="{% raw %}{% github_edit_link %}{% endraw %}">Improve this page</a></p>
```

Produces:


```html
<p>This site is open source. <a href="https://github.com/benbalter/jekyll-edit-link/edit/master/README.md">Improve this page</a></p>
```