Skip to content

Commit

Permalink
Added GitLab support for GitLab pages and GitLab Edit Links
Browse files Browse the repository at this point in the history
  • Loading branch information
chickahoona committed Aug 20, 2017
1 parent 2690b49 commit 1290887
Show file tree
Hide file tree
Showing 14 changed files with 2,731 additions and 567 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ _site/
.jekyll-metadata
_pdf
.DS_Store
.idea
26 changes: 26 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion _includes/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 -->
Expand Down
7 changes: 7 additions & 0 deletions _layouts/page.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,13 @@ <h1 class="post-title-main">{{ page.title }}</h1>

{% 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">
Expand Down
4 changes: 2 additions & 2 deletions css/font-awesome.min.css

Large diffs are not rendered by default.

Binary file modified css/fonts/FontAwesome.otf
Binary file not shown.
Binary file modified css/fonts/fontawesome-webfont.eot
Binary file not shown.
3,230 changes: 2,668 additions & 562 deletions css/fonts/fontawesome-webfont.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified css/fonts/fontawesome-webfont.ttf
Binary file not shown.
Binary file modified css/fonts/fontawesome-webfont.woff
Binary file not shown.
Binary file modified css/fonts/fontawesome-webfont.woff2
Binary file not shown.
15 changes: 13 additions & 2 deletions pages/mydoc/mydoc_commenting_on_files.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:


```
Expand All @@ -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.

Expand Down
10 changes: 10 additions & 0 deletions var/build.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 1290887

Please sign in to comment.