jekyll-theme-seanh 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: eb01b5a5d3e9372272d5ce0f6b59a808d6b5fdd2a283f746c975c1e36d46c944
4
+ data.tar.gz: c2e0ae6b73e37f833c209f9fe0801244c0b9af8555cf0a7c2872099e87373b98
5
+ SHA512:
6
+ metadata.gz: e95ec39760e3ed6bb599de1e870b61091d5b34a41b2eb041a591032d80762ef1b0b1ba68d07c0d25be45e16b575a9ad4c6fa1c30cd24077d4a98bac516994446
7
+ data.tar.gz: 7c9e11c46754cffa77c85205686a93366e92e6cfd1b2c7a2a035ec705b8d1069412abe0bb11d08a821ae2546329a9c72ae98e2b66fc351cd4068b7b8b8f37b3b
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2019 Sean Hammond
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,66 @@
1
+ jekyll-theme-seanh
2
+ ==================
3
+
4
+ My Jekyll theme, as used on [seanh.cc](https://seanh.cc/).
5
+ A very plain and simple [Jekyll](https://jekyllrb.com/) / [GitHub Pages](https://pages.github.com/)
6
+ theme with a system font stack and hopefully decent typography. Has a lot of
7
+ typographical details like `<kbd>` and `<samp>` support, figures with captions,
8
+ and emojis.
9
+
10
+ Demo site: <https://seanh.github.io/jekyll-theme-seanh/>
11
+
12
+ Installation
13
+ ------------
14
+
15
+ Add this line to your Jekyll site's `Gemfile`:
16
+
17
+ ```ruby
18
+ gem "jekyll-theme-seanh"
19
+ ```
20
+
21
+ And add this line to your Jekyll site's `_config.yml`:
22
+
23
+ ```yaml
24
+ theme: jekyll-theme-seanh
25
+ ```
26
+
27
+ And then execute:
28
+
29
+ ```console
30
+ $ bundle
31
+ ```
32
+
33
+ Or install it yourself as:
34
+
35
+ ```console
36
+ $ gem install jekyll-theme-seanh
37
+ ```
38
+
39
+ Usage
40
+ -----
41
+
42
+ TODO: Write usage instructions here. Describe your available layouts, includes, sass and/or assets.
43
+
44
+ Contributing
45
+ ------------
46
+
47
+ Bug reports and pull requests are welcome on GitHub at <https://github.com/seanh/jekyll-theme-seanh/>.
48
+
49
+ Development
50
+ -----------
51
+
52
+ To set up your environment to develop this theme:
53
+
54
+ ```console
55
+ $ git clone https://github.com/seanh/jekyll-theme-seanh.git
56
+ $ cd jekyll-theme-seanh
57
+ $ bundle install --path vendor/bundle
58
+ $ bundle exec jekyll serve
59
+ ```
60
+
61
+ ...and open your browser at <http://localhost:4000>.
62
+
63
+ License
64
+ -------
65
+
66
+ The theme is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
@@ -0,0 +1,100 @@
1
+ {% capture headingsWorkspace %}
2
+ {% comment %}
3
+ Version 1.0.3
4
+ https://github.com/allejo/jekyll-anchor-headings
5
+
6
+ "Be the pull request you wish to see in the world." ~Ben Balter
7
+
8
+ Usage:
9
+ {% include anchor_headings.html html=content %}
10
+
11
+ Parameters:
12
+ * html (string) - the HTML of compiled markdown generated by kramdown in Jekyll
13
+
14
+ Optional Parameters:
15
+ * beforeHeading (bool) : false - Set to true if the anchor should be placed _before_ the heading's content
16
+ * anchorBody (string) : '' - The content that will be placed inside the anchor; the `%heading%` placeholder is available
17
+ * anchorClass (string) : '' - The class(es) that will be used for each anchor. Separate multiple classes with a space
18
+ * anchorTitle (string) : '' - The `title` attribute that will be used for anchors
19
+ * h_min (int) : 1 - The minimum header level to build an anchor for; any header lower than this value will be ignored
20
+ * h_max (int) : 6 - The maximum header level to build an anchor for; any header greater than this value will be ignored
21
+ * bodyPrefix (string) : '' - Anything that should be inserted inside of the heading tag _before_ its anchor and content
22
+ * bodySuffix (string) : '' - Anything that should be inserted inside of the heading tag _after_ its anchor and content
23
+
24
+ Output:
25
+ The original HTML with the addition of anchors inside of all of the h1-h6 headings.
26
+ {% endcomment %}
27
+
28
+ {% assign minHeader = include.h_min | default: 1 %}
29
+ {% assign maxHeader = include.h_max | default: 6 %}
30
+ {% assign beforeHeading = include.beforeHeading %}
31
+ {% assign nodes = include.html | split: '<h' %}
32
+
33
+ {% capture edited_headings %}{% endcapture %}
34
+
35
+ {% for _node in nodes %}
36
+ {% capture node %}{{ _node | strip }}{% endcapture %}
37
+
38
+ {% if node == "" %}
39
+ {% continue %}
40
+ {% endif %}
41
+
42
+ {% assign nextChar = node | replace: '"', '' | strip | slice: 0, 1 %}
43
+ {% assign headerLevel = nextChar | times: 1 %}
44
+
45
+ <!-- If the level is cast to 0, it means it's not a h1-h6 tag, so let's try to fix it -->
46
+ {% if headerLevel == 0 %}
47
+ {% if nextChar != '<' and nextChar != '' %}
48
+ {% capture node %}<h{{ node }}{% endcapture %}
49
+ {% endif %}
50
+
51
+ {% capture edited_headings %}{{ edited_headings }}{{ node }}{% endcapture %}
52
+ {% continue %}
53
+ {% endif %}
54
+
55
+ {% assign _workspace = node | split: '</h' %}
56
+ {% assign _idWorkspace = _workspace[0] | split: 'id="' %}
57
+ {% assign _idWorkspace = _idWorkspace[1] | split: '"' %}
58
+ {% assign html_id = _idWorkspace[0] %}
59
+
60
+ {% capture _hAttrToStrip %}{{ _workspace[0] | split: '>' | first }}>{% endcapture %}
61
+ {% assign header = _workspace[0] | replace: _hAttrToStrip, '' %}
62
+
63
+ <!-- Build the anchor to inject for our heading -->
64
+ {% capture anchor %}{% endcapture %}
65
+
66
+ {% if html_id and headerLevel >= minHeader and headerLevel <= maxHeader %}
67
+ {% capture anchor %}href="#{{ html_id}}"{% endcapture %}
68
+
69
+ {% if include.anchorClass %}
70
+ {% capture anchor %}{{ anchor }} class="{{ include.anchorClass }}"{% endcapture %}
71
+ {% endif %}
72
+
73
+ {% if include.anchorTitle %}
74
+ {% capture anchor %}{{ anchor }} title="{{ include.anchorTitle | replace: '%heading%', header }}"{% endcapture %}
75
+ {% endif %}
76
+
77
+ {% capture anchor %}<a {{ anchor }}>{{ include.anchorBody | replace: '%heading%', header | default: '' }}</a>{% endcapture %}
78
+
79
+ <!-- In order to prevent adding extra space after a heading, we'll let the 'anchor' value contain it -->
80
+ {% if beforeHeading %}
81
+ {% capture anchor %}{{ anchor }} {% endcapture %}
82
+ {% else %}
83
+ {% capture anchor %} {{ anchor }}{% endcapture %}
84
+ {% endif %}
85
+ {% endif %}
86
+
87
+ {% capture new_heading %}
88
+ <h{{ _hAttrToStrip }}
89
+ {{ include.bodyPrefix }}
90
+ {% if beforeHeading %}
91
+ {{ anchor }}{{ header }}
92
+ {% else %}
93
+ {{ header }}{{ anchor }}
94
+ {% endif %}
95
+ {{ include.bodySuffix }}
96
+ </h{{ _workspace | last }}
97
+ {% endcapture %}
98
+ {% capture edited_headings %}{{ edited_headings }}{{ new_heading }}{% endcapture %}
99
+ {% endfor %}
100
+ {% endcapture %}{% assign headingsWorkspace = '' %}{{ edited_headings | strip }}
@@ -0,0 +1,9 @@
1
+ {::nomarkdown}
2
+ </div><!-- .content__inner-container -->
3
+ </div><!-- .content__outer-container -->
4
+ <div style="margin-bottom: 26px;">
5
+ {{ include.content }}
6
+ </div>
7
+ <div class="content__outer-container">
8
+ <div class="content__inner-container">
9
+ {:/}
@@ -0,0 +1,8 @@
1
+ {% capture script %}
2
+ {% if include.file %}
3
+ <script src="https://gist.github.com/{{ include.sha }}.js?file={{ include.file }}"></script>
4
+ {% else %}
5
+ <script src="https://gist.github.com/{{ include.sha }}.js"></script>
6
+ {% endif %}
7
+ {% endcapture %}
8
+ {% include wide.html content=script %}
@@ -0,0 +1,9 @@
1
+ <li class="posts-list__item">
2
+ <p>
3
+ <a href="{{ post.url | relative_url }}">{{ post.title }}</a>
4
+ <span class="muted">{{ post.date | date: "%b&nbsp;%Y" }}</span>
5
+ {% for tag in post.tags %}
6
+ <a href="{{ "/tags" | relative_url }}#{{ tag }}" class="pill">{{ tag }}</a>
7
+ {% endfor %}
8
+ </p>
9
+ </li>
@@ -0,0 +1,5 @@
1
+ {::nomarkdown}
2
+ </div><!-- .content__inner-container -->
3
+ {{ include.content }}
4
+ <div class="content__inner-container">
5
+ {:/}
@@ -0,0 +1,22 @@
1
+ {% capture precode %}
2
+ <pre><code>{{ include.content }}</code></pre>
3
+ {% endcapture %}
4
+
5
+ {% if include.figcaption %}
6
+ {% capture content %}
7
+ <figure>
8
+ {{ precode }}
9
+ <figcaption>
10
+ {{ include.figcaption }}
11
+ </figcaption>
12
+ </figure>
13
+ {% endcapture %}
14
+ {% assign precode=content %}
15
+ {% endif %}
16
+
17
+ {% if include.fullbleed %}
18
+ {% include fullbleed.html content=precode %}
19
+ {% else %}
20
+ {% include wide.html content=precode %}
21
+ <p></p>
22
+ {% endif %}
@@ -0,0 +1,21 @@
1
+ {% capture img %}
2
+ <img src="{{ include.src | relative_url }}" {% if include.alt %}alt="{{ include.alt }}"{% endif %} {% if include.title %}title="{{ include.title }}"{% endif %}/>
3
+ {% endcapture %}
4
+
5
+ {% if include.figcaption %}
6
+ {% capture content %}
7
+ <figure>
8
+ {{ img }}
9
+ <figcaption>
10
+ {{ include.figcaption }}
11
+ </figcaption>
12
+ </figure>
13
+ {% endcapture %}
14
+ {% assign img=content %}
15
+ {% endif %}
16
+
17
+ {% if include.fullbleed %}
18
+ {% include fullbleed.html content=img %}
19
+ {% else %}
20
+ {% include wide.html content=img %}
21
+ {% endif %}
@@ -0,0 +1,61 @@
1
+ <!DOCTYPE html>
2
+ <html lang="{{ site.lang | default: "en" }}">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
6
+ <meta name="viewport" content="width=device-width, initial-scale=1">
7
+ {% feed_meta %}
8
+ <link rel="stylesheet" href="{{ '/assets/css/main.css' | relative_url }}" />
9
+ {% if page.robots %}
10
+ <meta name="robots" content="{{ page.robots }}">
11
+ {% elsif layout.robots %}
12
+ <meta name="robots" content="{{ layout.robots }}">
13
+ {% endif %}
14
+ {% seo %}
15
+ </head>
16
+ <body>
17
+ <header class="site-header">
18
+ <nav class="site-header__navbar">
19
+ <ul class="site-header__nav-links">
20
+ {% for item in site.data.header_links %}
21
+ <li class="site-header__nav-item">
22
+ {% if item.url == page.url %}
23
+ <a class="site-header__nav-link site-header__nav-link--active">{{ item.title }}</a>
24
+ {% else %}
25
+ <a class="site-header__nav-link" href="{{ item.url | relative_url }}">{{ item.title }}</a>
26
+ {% endif %}
27
+ </li>
28
+ {% endfor %}
29
+ </ul>
30
+ </nav>
31
+ </header>
32
+ {% include anchor_headings.html html=content anchorBody="§" anchorClass="anchor" %}
33
+
34
+ <footer class="site-footer">
35
+ <ul class="site-footer__links">
36
+ <li class="site-footer__links-item"><a href="https://raw.githubusercontent.com/{{ site.github.repository_nwo }}/master/{{ page.path }}" title="Source code for this page" name="View the sSource code for this page">View source</a></li>
37
+ <li class="site-footer__links-item"><a href="{{ site.github.repository_url }}/edit/master/{{ page.path }}" title="Edit this page on GitHub" name="Edit this page on GitHub" target="_blank">Edit</a></li>
38
+ <li class="site-footer__links-item">
39
+ <label for="new-post" title="Create a new post">New post:</label>
40
+ <input id="new-post" class="js-new-post site-footer__new-post-input" type="text" spellcheck="true" onchange="doNewPost()" title="Create a new post">
41
+ </li>
42
+ </ul>
43
+ </footer>
44
+
45
+ <script>
46
+ function doNewPost() {
47
+ const inputEl = document.querySelector('.js-new-post');
48
+ const today = new Date();
49
+ const year = today.getFullYear();
50
+ const month = ('0' + (today.getMonth() + 1)).slice(-2);
51
+ const day = ('0' + today.getDate()).slice(-2);
52
+ const date = year + '-' + month + '-' + day;
53
+ const title = inputEl.value;
54
+ const filename = '_posts/' + date + '-' + title.replace(/ /g, '-').toLowerCase() + '.md';
55
+ const message = 'Add%20%22' + title + '%22';
56
+ const underline = '%3D'.repeat(title.length);
57
+ window.open('{{ site.github.repository_url }}/new/master/?filename=' + filename + '&value=---%0Adraft%3A%20true%0Asitemap%3A%20false%0Arobots%3A%20noindex%2C%20nofollow%0A---%0A%0A' + title + '%0A' + underline + '%0A%0A&message=' + message);
58
+ }
59
+ </script>
60
+ </body>
61
+ </html>
@@ -0,0 +1,13 @@
1
+ ---
2
+ layout: default
3
+ ---
4
+ <main class="content">
5
+ <div class="content__outer-container">
6
+ <header class="content__header">
7
+ <h1 class="content__title">{{ page.title }}</h1>
8
+ </header>
9
+ <div class="content__inner-container">
10
+ {{ content }}
11
+ </div><!-- content__inner-container -->
12
+ </div><!-- content__outer-container -->
13
+ </main>
@@ -0,0 +1,19 @@
1
+ ---
2
+ layout: default
3
+ ---
4
+ <main>
5
+ <article class="content">
6
+ <div class="content__outer-container">
7
+ <header class="content__header">
8
+ <h1 class="content__title">{{ page.title }}</h1>
9
+ </header>
10
+ <div class="content__inner-container">
11
+ {{ content }}
12
+ <footer class="post-footer">
13
+ — <a class="post-footer__link" href="{{ "/" | relative_url }}">Sean Hammond</a>,
14
+ <time class="post-footer__time" datetime="{{ page.date | date: '%Y-%m-%d' }}" pubdate>{{ page.date | date: "%b %Y" }}</time>
15
+ </footer>
16
+ </div><!-- content__inner-container -->
17
+ </div><!-- content__outer-container -->
18
+ </article>
19
+ </main>
@@ -0,0 +1,103 @@
1
+ .admonition,
2
+ .attention,
3
+ .caution,
4
+ .danger,
5
+ .error,
6
+ .important,
7
+ .warning,
8
+ .hint,
9
+ .tip,
10
+ .note,
11
+ .seealso,
12
+ .todo {
13
+ padding: .75rem 1.25rem;
14
+ border: 1px solid transparent;
15
+ border-radius: .25rem;
16
+ }
17
+
18
+ .admonition *:last-child,
19
+ .attention *:last-child,
20
+ .caution *:last-child,
21
+ .danger *:last-child,
22
+ .error *:last-child,
23
+ .important *:last-child,
24
+ .warning *:last-child,
25
+ .hint *:last-child,
26
+ .tip *:last-child,
27
+ .note *:last-child,
28
+ .seealso *:last-child,
29
+ .todo *:last-child {
30
+ margin-bottom: 0;
31
+ }
32
+
33
+ .admonition {
34
+ background-color: #d6d8d9;
35
+ border-color: #c6c8ca;
36
+ color: #1b1e21;
37
+ }
38
+
39
+ .admonition a {
40
+ color: #040505;
41
+ }
42
+
43
+ .attention,
44
+ .caution,
45
+ .danger,
46
+ .error,
47
+ .important,
48
+ .warning {
49
+ background-color: #f8d7da;
50
+ border-color: #f5c6cb;
51
+ color: #721c24;
52
+ }
53
+
54
+ .attention a,
55
+ .caution a,
56
+ .danger a,
57
+ .error a,
58
+ .important a,
59
+ .warning a {
60
+ color: #491217;
61
+ }
62
+
63
+ .hint,
64
+ .tip {
65
+ background-color: #d1ecf1;
66
+ border-color: #bee5eb;
67
+ color: #0c5460;
68
+ }
69
+
70
+ .hint a,
71
+ .tip a {
72
+ color: #062c33;
73
+ }
74
+
75
+ .note {
76
+ background-color: #e2e3e5;
77
+ border-color: #d6d8db;
78
+ color: #383d41;
79
+ }
80
+
81
+ .note a {
82
+ color: #202326;
83
+ }
84
+
85
+ .todo {
86
+ background-color: #cce5ff;
87
+ border-color: #b8daff;
88
+ color: #004085;
89
+ }
90
+
91
+ .todo a {
92
+ color: #002752;
93
+ }
94
+
95
+ .seealso {
96
+ background-color: #fff3cd;
97
+ border-color: #ffeeba;
98
+ color: #856404;
99
+ }
100
+
101
+ .seealso a {
102
+ color: #533f03;
103
+ }