Skip to content

Commit

Permalink
Contribution widget
Browse files Browse the repository at this point in the history
Signed-off-by: mrgarris0n <gergely.karacsonyi@gmail.com>
  • Loading branch information
mrgarris0n committed Jul 22, 2024
1 parent 2cdd0b2 commit 93f3208
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 0 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -108,5 +108,6 @@ group :jekyll_plugins do
# https://github.com/HofiOne/minimal-mistakes
#
gem "jekyll-include-cache"
gem "jekyll-github-metadata"
# gem "github-pages"
end
3 changes: 3 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ plugins:
- jekyll-sitemap # Jekyll plugin to silently generate a sitemaps.org compliant sitemap for your Jekyll site.
- jekyll-gist # Liquid tag for displaying GitHub Gists in Jekyll sites.
- jekyll-include-cache # Liquid tag that caches Liquid includes.
- jekyll-github-metadata

# Whitelist plugins under safe mode.
whitelist:
Expand Down Expand Up @@ -256,3 +257,5 @@ footer:
product:
name: 'syslog-ng Open Source Edition'
short_name: 'syslog-ng OSE'

repository: syslog-ng/syslog-ng.github.io
23 changes: 23 additions & 0 deletions _includes/page__contribution.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{% if site.github.repository_url %}
<aside class="sidebar__right sticky contrib">
<div class="align-right">
<button id="view-button" class="masthead_button" type="button">
<a class="header-link" href="{{ site.github.repository_url }}/tree/master/{{ site.collections_dir }}/{{ page.relative_path }}" class="nav-link">
<i class="masthead_button_icon fas fa-eye content-tooltip tooltip-align-center text-content-tooltip" data-tooltip-text="View page source"></i>
</a>
</button>

<button id="edit-button" class="masthead_button" type="button">
<a href="{{ site.github.repository_url }}/edit/master/{{ site.collections_dir }}/{{ page.relative_path }}" class="nav-link">
<i class="masthead_button_icon far fa-edit content-tooltip tooltip-align-center text-content-tooltip" data-tooltip-text="Edit this page"></i>
</a>
</button>

<button id="report-button" class="masthead_button" type="button">
<a href="{{ site.github.repository_url }}/issues/new?title=Issue with {{ page.relative_path }}" class="nav-link">
<i class="masthead_button_icon fas fa-bug content-tooltip tooltip-align-center text-content-tooltip" data-tooltip-text="Report an issue"></i>
</a>
</button>
</div>
</aside>
{% endif %}
2 changes: 2 additions & 0 deletions _includes/sidebar.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
{% assign sidebarItemCount = page.sidebar.nav | size %}
{% endif %}

{% include page__contribution.html %}

<div class="sidebar {% if site.sidebar.sticky == true %}sticky{% endif %} {% if sidebarItemCount == 0 %}empty{% endif %}">
{% if page.author_profile or layout.author_profile %}
{% include author-profile.html %}
Expand Down
29 changes: 29 additions & 0 deletions _sass/minimal-mistakes/minimal-mistakes/_sidebar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,14 @@
}
}
}

&.contrib {
top: calc(#{$masthead-sticky} * 2 * #{$nav-height});
margin-bottom: -2em;
padding-right: 2.5em;
width: $right-sidebar-width-wide;
z-index: 0;
}
}

@include breakpoint($x-large) {
Expand All @@ -119,6 +127,27 @@
}
}

.sidebar__right__custom {
@include breakpoint($large) {
position: absolute;
top: 0;
right: 0;
margin-right: 0.75em;
padding-left: 1em;
padding-right: 1em;
z-index: 50;

&.sticky {
@include clearfix();
position: -webkit-sticky;
position: sticky;
top: calc((1 + #{$masthead-sticky} ) * 2 * #{$nav-height});
float: right;
}
}
}


/*
Author profile and links
========================================================================== */
Expand Down

0 comments on commit 93f3208

Please sign in to comment.