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

1
.gitignore vendored
View File

@ -3,3 +3,4 @@ _site/
.jekyll-metadata
_pdf
.DS_Store
.idea

26
.gitlab-ci.yml Normal file
View File

@ -0,0 +1,26 @@
image: ruby:2.3
variables:
JEKYLL_ENV: production
test:
stage: test
script:
- sh ./var/build.sh
- bundle exec jekyll build -d test
artifacts:
paths:
- test
except:
- master
pages:
stage: deploy
script:
- sh ./var/build.sh
- bundle exec jekyll build -d public
artifacts:
paths:
- public
only:
- master

View File

@ -15,6 +15,9 @@ company_name: Your company
github_editme_path: tomjoht/documentation-theme-jekyll/blob/gh-pages/
# if you're using Github, provide the basepath to the branch you've created for reviews, following the sample here. if not, leave this value blank.
# gitlab_editme_path: tomjoht/documentation-theme-jekyll/blob/gh-pages/
# if you're using GitLab, provide the basepath to the branch you've created for reviews, following the sample here. if not, leave this value blank.
disqus_shortname: idrbwjekyll
# if you're using disqus for comments, add the shortname here. if not, leave this value blank.

View File

@ -6,7 +6,7 @@
<title>{{ page.title }} | {{ site.site_title }}</title>
<link rel="stylesheet" href="{{ "css/syntax.css" }}">
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<!--<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">-->
<link rel="stylesheet" href="css/modern-business.css">
<!-- Latest compiled and minified CSS -->

View File

@ -45,6 +45,13 @@ layout: default
{% endif %}
{% if site.gitlab_editme_path %}
<a target="_blank" href="https://github.com/{{site.gitlab_editme_path}}{% unless page.url contains "index.html" %}pages/{% endunless %}{{page.folder}}{{page.url | remove: ".html" | append: ".md"}}" class="btn btn-default githubEditButton" role="button"><i class="fa fa-gitlab fa-lg"></i> Edit me</a>
{% endif %}
{{content}}
<div class="tags">

File diff suppressed because one or more lines are too long

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

Before

Width:  |  Height:  |  Size: 306 KiB

After

Width:  |  Height:  |  Size: 434 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

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.

10
var/build.sh Normal file
View File

@ -0,0 +1,10 @@
#!/usr/bin/env bash
apt-get update && \
apt-get install -y libfontconfig zip npm git apt-transport-https ca-certificates curl openssl && \
npm i -g npm && \
npm cache clean -f && \
npm install -g n && \
n stable && \
node --version && \
npm --version && \
bundle install