Added GitLab support for GitLab pages and GitLab Edit Links

This commit is contained in:
chickahoona
2017-08-20 17:28:45 +02:00
parent 2690b49fe9
commit 12908878e0
14 changed files with 2731 additions and 567 deletions

View File

@ -16,7 +16,7 @@ If you're using the doc as code approach, you might also consider using the same
There's an Edit me button on each page on this theme. This button allows collaborators to edit the content on Github.
Here's the code for that button on the page.html layout:
Here's the code for that button on the page.html layout for GitHub:
```
@ -27,7 +27,18 @@ Here's the code for that button on the page.html layout:
{% endif %}{% endraw %}
```
In your configuration file, edit the value for `github_editme_path`. For example, you might create a branch called "reviews" on your Github repo. Then you would add something like this in your configuration file for the 'github_editme_path': tomjoht/documentation-theme-jekyll/edit/reviews. Here "tomjoht" is my github account name. The repo name is "documentation-theme-jekyll". The "reviews" name is the branch.
and here for GitLab:
```
{% raw %}{% if site.gitlab_editme_path %}
<a target="_blank" href="https://github.com/{{site.gitlab_editme_path}}/{{page.folder}}{{page.url | append: ".md"}}{% endif %}" class="btn btn-default githubEditButton" role="button"><i class="fa fa-gitlab fa-lg"></i> Edit me</a>
{% endif %}{% endraw %}
```
In your configuration file, edit the value for `github_editme_path` (or for Gitlab: `gitlab_editme_path`). For example, you might create a branch called "reviews" on your Github repo. Then you would add something like this in your configuration file for the 'github_editme_path': tomjoht/documentation-theme-jekyll/edit/reviews. Here "tomjoht" is my github account name. The repo name is "documentation-theme-jekyll". The "reviews" name is the branch.
To suppress this button, comment out the `github_editme_path` in the \_config.yml file.