jekyll-dash 2.0.0 → 2.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f29e755db2527c979641ecb23c33b2f262c0f211584ec242afc77484d1c654f7
4
- data.tar.gz: 805c3a368c4a96784046d9f787cf066b2d156eacdcf4e58609c7ae927e3bad2a
3
+ metadata.gz: becafdda8eaf7923084e20b2795dbe33ceb1c658f93039f0733125508a942ec0
4
+ data.tar.gz: 48ced63d493776ba8d39008f1e404479b25e72934ba20eb5509dc7a8b33bb659
5
5
  SHA512:
6
- metadata.gz: 9d1bf17a0e6c40756660b888e7ba6c7f6262afd9999a9e2d29fbe7a054b3e77a2e4de7f442dbdf98a273a4e5aee28cc8c08a4f658897203fe11320aacbc93c27
7
- data.tar.gz: e14db70d0eb5c5c3ecf4b0d9cb0bfb28ac73ecd3210fd3a86778656f23fcee48ab21eb7e9867c52dd29343ec232bc90915ca37f2c2e60282c6238a1cb13f7a12
6
+ metadata.gz: a7c2ad4d9876e91ec459e6f6d0fdf4870e102589649b83d1bb29e6464bdbe5ae6f14f8cef157456e1807648a5ff37e3ef471b8aa1a0709a72f92b1de9ad663bd
7
+ data.tar.gz: 85f4e0665738fd1b1f82a2533558f7a8327a03556bd87f9433fe33e9b072c1f1fe16b6741c482e2485652a7bbb6c8b6060f103b2b9ec29b6920fa7ad12c7b7da
data/README.md CHANGED
@@ -3,27 +3,39 @@
3
3
 
4
4
  A dark and light theme for Jekyll, inspired by Dash UI for Atom. 🌒☀
5
5
 
6
- [![Build Status](https://img.shields.io/travis/bitbrain/braingdx/master.svg?logo=travis&style=flat-square)](https://travis-ci.org/bitbrain/jekyll-dash)
6
+ ![Build Tag](https://github.com/bitbrain/jekyll-dash/actions/workflows/build-tag.yml/badge.svg)
7
7
  [![license](https://img.shields.io/github/license/bitbrain/jekyll-dash.svg?style=flat-square)](LICENSE.MD)
8
+ [![Gem](https://badgen.net/rubygems/v/jekyll-dash)](https://badgen.net/rubygems/v/jekyll-dash "View this project in Rubygems")
9
+ [![Downloads](https://ruby-gem-downloads-badge.herokuapp.com/jekyll-dash)](https://rubygems.org/gems/jekyll-dash "Number of Gem downloads")
8
10
  ---
9
11
  This theme for [Jekyll](https://jekyllrb.com/) has been inspired by [dash-ui](https://atom.io/themes/dash-ui), a dark theme for [Atom](https://atom.io).
10
12
 
11
13
  [![design](theme.gif)](http://bitbrain.github.io)
12
14
 
15
+ ## Features
16
+
17
+ #### :first_quarter_moon: Dark/Light Mode
18
+ #### :arrow_left: Right-to-Left (RTL) Support
19
+ #### :bookmark: Tags
20
+ #### :orange_book: Pagination
21
+ #### :computer: Syntax Highlighting
22
+ #### :wave: Customisable Avatar Box
23
+ #### :two_hearts: Social Links
24
+
13
25
  ## Installation
14
26
 
15
27
  Add this line to your Jekyll site's `Gemfile`:
16
28
 
17
29
  For **Jekyll 3**:
18
30
  ```ruby
19
- gem 'jekyll-dash', '~> 1.0.0'
31
+ gem 'jekyll-dash', '~> 1'
20
32
  ```
21
33
 
22
34
  > Keep in mind: Github pages generation only supports Jekyll 3.8 right now.
23
35
 
24
36
  For **Jekyll 4**:
25
37
  ```ruby
26
- gem 'jekyll-dash', '~> 2.0.0'
38
+ gem 'jekyll-dash', '~> 2'
27
39
  ```
28
40
 
29
41
  And add this line to your Jekyll site's `_config.yml`:
@@ -58,10 +70,24 @@ tag_page_layout: tag_page
58
70
  tag_page_dir: tag
59
71
 
60
72
  dash:
73
+ # the way how dates should be displayed
61
74
  date_format: "%b %-d, %Y"
62
75
 
76
+ # (optional) discqus comment configuration
63
77
  disqus:
64
- shortname: <your-disqus-shortname>
78
+ shortname: <your-disqus-shortname>
79
+
80
+ # the animation speed of the post scroll-in effect
81
+ animation_speed: 50
82
+
83
+ # wether to enable Right-to-Left support or not
84
+ rtl: false
85
+
86
+ # Replaces the default avatar provider (gravatar)
87
+ #avatar_source: github
88
+ #github_username: bitbrain
89
+ #avatar_source: local
90
+ #avatar_path: /assets/avatar.png
65
91
 
66
92
  # generate social links in footer
67
93
  # supported colors: green, red, orange, blue, cyan, pink, teal, yellow, indigo, purple
@@ -75,21 +101,17 @@ dash:
75
101
  - url: https://github.com/bitbrain
76
102
  icon: github-square
77
103
  color: purple
78
-
104
+
105
+ # wether the author box should be displayed or not
79
106
  show_author: true
80
-
81
- # Replaces the default avatar provider (gravatar)
82
- #avatar_source: github
83
- #github_username: bitbrain
84
107
  ```
85
108
  ## Using this theme directly on Github Pages
86
109
 
87
- Please keep in mind that Github Pages does only support [a limited list of Jekyll plugins](https://help.github.com/en/articles/configuring-jekyll-plugins#default-plugins). You will be able to use this theme on Github Pages but some functionality might not be available, for example displaying tags. In order to use this theme to a full extend, you have to generate the `_site` externally, for example on [TravisCI](https://travis-ci.org).
110
+ Please keep in mind that Github Pages does only support [a limited list of Jekyll plugins](https://pages.github.com/versions/). You will be able to use this theme on Github Pages but some functionality might not be available, for example displaying tags. In order to use this theme to a full extend, you have to generate the `_site` [separately via Github Actions](https://jekyllrb.com/docs/continuous-integration/github-actions/).
88
111
 
89
- For example, you want to host your own blog on `https://<username>.github.io`. As a result, you require the following repositories:
112
+ * `<username>.github.io` - contains main source branch and orphan gh-pages branch ([see example](https://github.com/bitbrain/bitbrain.github.io))
90
113
 
91
- * `blog` - contains the actual Jekyll sources ([see example](https://github.com/bitbrain/blog))
92
- * `<username>.github.io` - contains generated webpage, pushed automatically via TravisCI ([see example](https://github.com/bitbrain/bitbrain.github.io))
114
+ I have created [a guide on how to set this up here](https://bitbra.in/2021/10/03/host-your-own-blog-for-free-with-custom-domain.html).
93
115
 
94
116
  You are not required to do this, but keep in mind that some functionality might not be available when using the Jekyll generator on Github directly!
95
117
 
@@ -121,6 +143,21 @@ gem "liquid-md5"
121
143
 
122
144
  **Solution**: as described above you have to add the tagging plugin. Additionally, tags do not work natively by Github Pages. You have to build your site on an external CI and push the `_site` artifacts to a hosting repository.
123
145
 
146
+ > I am getting an error that Bundler could not find compatible versions for gem
147
+
148
+ **Solution**
149
+
150
+ Make sure you are using a version of this theme that is compatible with Jekyll. Version 1.x is only compatible with Jekyll 3.x while Version 2.x is only compatible with Jekyll 4.x.
151
+
152
+ > I am getting an error 'cannot load such file --webrick' when trying to run `bundle exec jekyll serve`
153
+
154
+ **Solution**
155
+
156
+ As [explained here](https://github.com/jekyll/jekyll/issues/8523#issuecomment-751409319) this seems to be a bug with some recent Jekyll 4 version. To solve this simply run:
157
+ ```bash
158
+ bundle add webrick
159
+ ```
160
+
124
161
  ## Contributing
125
162
 
126
163
  Bug reports and pull requests are welcome on GitHub at https://github.com/bitbrain/jekyll-dash. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
@@ -134,6 +171,8 @@ Your theme is setup just like a normal Jekyll site! To test your theme, run `bun
134
171
  When your theme is released, only the files in `_layouts`, `_includes`, `_sass` and `assets` tracked with Git will be bundled.
135
172
  To add a custom directory to your theme-gem, please edit the regexp in `jekyll-dash.gemspec` accordingly.
136
173
 
174
+ > If you want to learn how Jekyll Dash gets deployed via Github Actions, feel free [to read this article](https://bitbra.in/2021/10/05/workflow-of-releasing-gem-based-jekyll-theme.html) written by me.
175
+
137
176
  ## License
138
177
 
139
178
  The theme is available as open source under the terms of the [Apache License 2.0](https://opensource.org/licenses/Apache-2.0).
@@ -1,15 +1,9 @@
1
1
  <div class="author-box">
2
- {% if site.avatar_source == "github" and site.github_username %}
3
- {% capture avatar_image %}
4
- https://github.com/{{ site.github_username }}.png
5
- {% endcapture %}
6
- {% elsif site.plugins contains "liquid-md5" %}
7
- {% capture avatar_image %}
8
- https://gravatar.com/avatar/{{ site.email | downcase | md5 }}?s=256
9
- {% endcapture %}
10
- {% endif %}
11
- {% if avatar_image %}
12
- <img src="{{ avatar_image }}" class="author-avatar" alt="Avatar" />
13
- {% endif %}
14
- {{ site.description }}
2
+ {% if site.dash.rtl %}
3
+ <div class="description">{{ site.description }}</div>
4
+ {%- include avatar.html -%}
5
+ {% else %}
6
+ {%- include avatar.html -%}
7
+ <div class="description">{{ site.description }}</div>
8
+ {% endif %}
15
9
  </div>
@@ -0,0 +1,16 @@
1
+ {% if site.dash.avatar_source == "github" and site.dash.github_username %}
2
+ {% capture avatar_image %}
3
+ https://github.com/{{ site.dash.github_username }}.png
4
+ {% endcapture %}
5
+ {% elsif site.dash.avatar_source == "local" and site.dash.avatar_path %}
6
+ {% capture avatar_image %}
7
+ {{site.dash.avatar_path}}
8
+ {% endcapture %}
9
+ {% elsif site.plugins contains "liquid-md5" %}
10
+ {% capture avatar_image %}
11
+ https://gravatar.com/avatar/{{ site.email | downcase | md5 }}?s=256
12
+ {% endcapture %}
13
+ {% endif %}
14
+ {% if avatar_image %}
15
+ <img src="{{ avatar_image }}" class="author-avatar" alt="Avatar" />
16
+ {% endif %}
data/_includes/head.html CHANGED
@@ -5,8 +5,11 @@
5
5
  {%- seo -%}
6
6
  <link rel="stylesheet" href="{{ "/assets/css/style.css" | relative_url }}">
7
7
  <link rel="icon" type="image/png" href="{{ "/assets/favicon.png" | relative_url }}" />
8
+ <link rel="stylesheet" href="{{ "/assets/css/magnific-popup.css" | relative_url }}">
8
9
  {%- feed_meta -%}
9
10
  {%- if jekyll.environment == 'production' and site.google_analytics -%}
10
11
  {%- include google-analytics.html -%}
11
12
  {%- endif -%}
13
+ <script src="https://code.jquery.com/jquery-3.2.0.min.js"></script>
14
+ <script src="{{ "/assets/js/jquery.magnific-popup.js" | relative_url }}"></script>
12
15
  </head>
@@ -2,7 +2,13 @@
2
2
  <div class="wrapper">
3
3
  <a class="site-title" rel="author" href="{{ "/" | relative_url }}">{{ site.title | escape }}<b class="command_prompt"></b><b class="blinking_cursor">_</b></a>
4
4
  <span class="social_links">
5
- {% for link in site.dash.social_links %}<a class="color-{{ link.color }}-hover" href="{{ link.url }}"><i class="fab fa-{{ link.icon }}"></i></a>{% endfor %}
5
+ {% for link in site.dash.social_links %}
6
+ {% if link.fa == true %}
7
+ <a class="color-{{ link.color }}-hover" href="{{ link.url }}"><i class="fa fa-{{ link.icon }}"></i></a>
8
+ {% else %}
9
+ <a class="color-{{ link.color }}-hover" href="{{ link.url }}"><i class="fab fa-{{ link.icon }}"></i></a>
10
+ {% endif %}
11
+ {% endfor %}
6
12
  </span>
7
13
  </div>
8
14
  </div>
@@ -1,5 +1,5 @@
1
1
  <!DOCTYPE html>
2
- <html lang="{{ page.lang | default: site.lang | default: "en" }}">
2
+ <html class="{% if site.dash.rtl %}direction--rtl{% else %}direction--ltr{% endif %}"lang="{{ page.lang | default: site.lang | default: "en" }}">
3
3
 
4
4
  {%- include head.html -%}
5
5
 
data/_layouts/home.html CHANGED
@@ -4,6 +4,7 @@ layout: default
4
4
  {% unless site.dash.show_author == false %}
5
5
  {% include author.html %}
6
6
  {% endunless %}
7
+ {{ content }}
7
8
  {% assign posts_count = paginator.posts | size %}
8
9
  {% if posts_count > 0 %}
9
10
  <h1>recent articles</h1>
@@ -20,8 +21,8 @@ layout: default
20
21
  {% endfor %}
21
22
  </div>
22
23
  {% endif %}
23
- {% if site.date_format %}
24
- {{ post.date | date: site.date_format }}
24
+ {% if site.dash.date_format %}
25
+ {{ post.date | date: site.dash.date_format }}
25
26
  {% else %}
26
27
  {{ post.date | date: "%b %-d, %Y" }}
27
28
  {% endif %}
data/_layouts/post.html CHANGED
@@ -15,7 +15,10 @@ layout: default
15
15
  {% endif %}
16
16
  <div class="post-date">Published on {{ page.date | date_to_string }}</div>
17
17
  {% if page.description != null %}
18
- <div class="post-description">{{ page.description }}</div>
18
+ <noscript>
19
+ <div class="post-description">{{ page.description }}</div>
20
+ </noscript>
21
+ <div id="animated-post-description" class="post-description" style="display: none;"></div>
19
22
  {% endif %}
20
23
  {{ content }}
21
24
  </div>
@@ -44,3 +47,45 @@ layout: default
44
47
  </div>
45
48
  {% endif %}
46
49
  {% include tagcloud.html %}
50
+
51
+ {% assign animation_speed = site.dash.animation_speed | default: 50 %}
52
+ <script>
53
+ let i = 0;
54
+ const text = '{{ page.description }}';
55
+ const speed = parseInt('{{ animation_speed }}');
56
+
57
+ function typeWriter() {
58
+ if (i < text.length) {
59
+ document.getElementById('animated-post-description').innerHTML += text.charAt(i);
60
+ i++;
61
+ setTimeout(typeWriter, speed);
62
+ }
63
+ }
64
+
65
+ document.getElementById('animated-post-description').style.display = 'initial';
66
+ typeWriter();
67
+
68
+ // Image modal
69
+ var $imgs = [];
70
+ $('img').each(function(idx) {
71
+ var obj = {
72
+ src: $(this).attr('src')
73
+ }
74
+ $imgs.push(obj);
75
+ var elem = $(this);
76
+ $(this).click(function() {
77
+ $('.modal').magnificPopup('open', idx);
78
+ });
79
+ });
80
+
81
+ $('.modal').magnificPopup({
82
+ items: $imgs,
83
+ type: 'image',
84
+ closeOnContentClick: true,
85
+ mainClass: 'mfp-img-mobile',
86
+ image: {
87
+ verticalFit: true
88
+ }
89
+
90
+ });
91
+ </script>
@@ -20,8 +20,8 @@ layout: default
20
20
  <a class="tag" href="/tag/{{ tag }}/">{{ tag }}</a>
21
21
  {% endfor %}
22
22
  </div>
23
- {% if site.date_format %}
24
- {{ post.date | date: site.date_format }}
23
+ {% if site.dash.date_format %}
24
+ {{ post.date | date: site.dash.date_format }}
25
25
  {% else %}
26
26
  {{ post.date | date: "%b %-d, %Y" }}
27
27
  {% endif %}
@@ -52,21 +52,75 @@
52
52
  }
53
53
 
54
54
  /**
55
- * Author box
55
+ * Right-to-Left support
56
56
  */
57
57
 
58
+ html.direction--rtl {
59
+ .author-box {
60
+ text-align: right;
61
+ & > .description {
62
+ direction: rtl;
63
+ }
64
+ & > img {
65
+ margin-right: 0em;
66
+ margin-left: 1em;
67
+ }
68
+ }
69
+ ol > li, ul > li {
70
+ text-align: right;
71
+ direction: rtl;
72
+ &::before {
73
+ float: right;
74
+ margin-left: 0.5em;
75
+ }
76
+ }
77
+ h1, h2, h3, h4, h5, h6 {
78
+ direction: rtl;
79
+ text-align: right;
80
+ }
81
+ .post-link-wrapper {
82
+ direction: rtl;
83
+ }
84
+ .post {
85
+ direction: rtl;
86
+ }
87
+ .pagination {
88
+ text-align: right;
89
+ }
90
+ .tag-cloud {
91
+ direction: rtl;
92
+ text-align: right;
93
+ }
94
+ .related-posts {
95
+ direction: rtl;
96
+ text-align: right;
97
+
98
+ & > li::before {
99
+ margin-right: 0;
100
+ margin-left: 0.5em;
101
+ }
102
+ }
103
+ pre {
104
+ direction: ltr;
105
+ text-align: left;
106
+ }
107
+ }
108
+
58
109
  .author-box {
59
110
  margin-bottom: 1em;
60
111
  text-align: left;
61
112
  min-height: 72px;
62
113
  font-style: italic;
114
+ display: inline-flex;
115
+ & > .description {
116
+ flex:8;
117
+ }
63
118
  & > .author-avatar {
64
- float: left;
65
- white-space: pre-line;
66
119
  margin-right: 1em;
67
120
  width: 72px;
68
- height: 72px;
121
+ height: 100%;
69
122
  border-radius: 0.3em;
123
+ flex: 1;
70
124
  }
71
125
  }
72
126
 
@@ -88,10 +142,8 @@
88
142
  @include themed() {
89
143
  color: t('foreground-color');
90
144
  }
91
- white-space: nowrap;
92
145
  overflow: hidden;
93
146
  width: 100%;
94
- animation: type 2s steps(60, end);
95
147
  margin-bottom: 1em;
96
148
  margin-left: 0.5em;
97
149
 
@@ -171,7 +223,7 @@
171
223
  }
172
224
 
173
225
  & > p {
174
- display: block;
226
+ display: inline-block;
175
227
  padding-left: 3em;
176
228
  }
177
229
 
@@ -184,6 +236,10 @@
184
236
  font-size: 2em;
185
237
  }
186
238
 
239
+ & > ul {
240
+ margin-left: 3em;
241
+ }
242
+
187
243
  li {
188
244
  @include themed() {
189
245
  color: t('quote-secondary');
@@ -371,4 +427,8 @@ ul.related-posts {
371
427
  }
372
428
  color: $color-yellow;
373
429
  }
430
+ }
431
+
432
+ .modal{
433
+ cursor: pointer;
374
434
  }
data/assets/avatar.png ADDED
Binary file