Skip to content

Commit e5e4aa1

Browse files
committed
Contribution widget
Signed-off-by: mrgarris0n <[email protected]>
1 parent 3395955 commit e5e4aa1

File tree

5 files changed

+34
-1
lines changed

5 files changed

+34
-1
lines changed

Gemfile

+1
Original file line numberDiff line numberDiff line change
@@ -111,5 +111,6 @@ group :jekyll_plugins do
111111
# https://github.com/HofiOne/minimal-mistakes
112112
#
113113
gem "jekyll-include-cache"
114+
gem "jekyll-github-metadata"
114115
# gem "github-pages"
115116
end

_config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -258,4 +258,4 @@ product:
258258
name: 'syslog-ng Open Source Edition'
259259
short_name: 'syslog-ng OSE'
260260

261-
repository: syslog-ng/syslog-ng
261+
repository: syslog-ng/syslog-ng

_includes/page__contribution.html

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{% if site.github.repository_url %}
2+
{% assign contrib_view = site.github.repository_url | append: '/tree/master/' | append: site.collections_dir | append: '/' | append: page.relative_path %}
3+
{% assign contrib_edit = site.github.repository_url | append: '/edit/master/' | append: site.collections_dir | append: '/' | append: page.relative_path %}
4+
{% assign contrib_report = site.github.repository_url | append: '/issues/new?title=Issue with ' | append: page.relative_path %}
5+
6+
<aside class="sidebar__right sticky contrib">
7+
<div class="align-right">
8+
<button id="view" class="masthead_button" type="button" onclick="window.open('{{contrib_view}}', '_blank')">
9+
<i class="masthead_button_icon fas fa-eye content-tooltip tooltip-align-center text-content-tooltip" data-tooltip-text="View page source"></i>
10+
</button>
11+
12+
<button id="edit" class="masthead_button" type="button" onclick="window.open('{{contrib_edit}}', '_blank')">
13+
<i class="masthead_button_icon far fa-edit content-tooltip tooltip-align-center text-content-tooltip" data-tooltip-text="Edit this page"></i>
14+
</button>
15+
16+
<button id="report" class="masthead_button" type="button" onclick="window.open('{{contrib_report}}', '_blank')">
17+
<i class="masthead_button_icon fas fa-bug content-tooltip tooltip-align-center text-content-tooltip" data-tooltip-text="Report an issue"></i>
18+
</button>
19+
</div>
20+
</aside>
21+
{% endif %}

_includes/sidebar.html

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
{% assign sidebarItemCount = page.sidebar.nav | size %}
55
{% endif %}
66

7+
{% include page__contribution.html %}
8+
79
<div class="sidebar {% if site.sidebar.sticky == true %}sticky{% endif %} {% if sidebarItemCount == 0 %}empty{% endif %}">
810
{% if page.author_profile or layout.author_profile %}
911
{% include author-profile.html %}

_sass/minimal-mistakes/minimal-mistakes/_sidebar.scss

+9
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,14 @@
9999
}
100100
}
101101
}
102+
103+
&.contrib {
104+
top: calc(#{$masthead-sticky} * 2 * #{$nav-height});
105+
margin-bottom: -2em;
106+
padding-right: 2.5em;
107+
width: $right-sidebar-width-wide;
108+
z-index: 0;
109+
}
102110
}
103111

104112
@include breakpoint($x-large) {
@@ -118,6 +126,7 @@
118126
margin-right: 0;
119127
}
120128
}
129+
121130

122131
/*
123132
Author profile and links

0 commit comments

Comments
 (0)