ockham 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: 984154d1203bcb67c7e038a2ecee334512a192acdd2df14c3daf918ec074fb04
4
+ data.tar.gz: 306255f4f4fa49b19febfb13e620ed7e8026756572f7aba30362774ed8104064
5
+ SHA512:
6
+ metadata.gz: 9148f7d67867d6fb34e2da71d98f1147eaacdbae199df74bc21ae1f71314250092ed2bfff86743f134c217a112ed4cde4137d7d4e9d545c644bf4538c1736a3c
7
+ data.tar.gz: 1fbd0b9048ede429486dedd99f19d902d34c34b06acea497eab15d2f03d0cc1d43b6b08573fcb3dd491a1baebe6f822a5264207967d78d473a501e37d8462a85
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2021 zivong
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,73 @@
1
+ # ockham
2
+
3
+ > Entia non sunt multiplicanda praeter necessitatem.
4
+ >
5
+ > -- William of Ockham
6
+
7
+ Ockham is a content-first minimalist Jekyll blog theme.
8
+
9
+ ![screenshot](screenshot.png)
10
+
11
+ ## Installation
12
+
13
+ Add this line to your Jekyll site's `Gemfile`:
14
+
15
+ ```ruby
16
+ gem "ockham"
17
+ ```
18
+
19
+ And add this line to your Jekyll site's `_config.yml`:
20
+
21
+ ```yaml
22
+ theme: ockham
23
+ ```
24
+
25
+ And then execute:
26
+
27
+ $ bundle
28
+
29
+ Or install it yourself as:
30
+
31
+ $ gem install ockham
32
+
33
+ If your website is hosted on GitHub Pages, you can install this theme via [`jekyll-remote-theme`](https://github.com/benbalter/jekyll-remote-theme).
34
+
35
+ Add the following to your `Gemfile`:
36
+
37
+ ```ruby
38
+ gem "jekyll-remote-theme"
39
+ ```
40
+
41
+ And add this line to your Jekyll site's `_config.yml`:
42
+
43
+ ```yml
44
+ plugins:
45
+ - jekyll-remote-theme
46
+ ```
47
+
48
+ Add the following to your site's `_config.yml`:
49
+
50
+ ```yml
51
+ remote_theme: zivong/ockham
52
+ ```
53
+
54
+ ## Usage
55
+
56
+ For more information about the usage of Ockham, please read the [tutorial](https://zivong.blog/ockham/tutorial/2021/09/12/tutorial.html).
57
+
58
+ ## Contributing
59
+
60
+ Bug reports and pull requests are welcome on GitHub at [https://github.com/zivong/ockham](https://github.com/zivong/ockham). 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.
61
+
62
+ ## Development
63
+
64
+ To set up your environment to develop this theme, run `bundle install`.
65
+
66
+ Your theme is setup just like a normal Jekyll site! To test your theme, run `bundle exec jekyll serve` and open your browser at `http://localhost:4000`. This starts a Jekyll server using your theme. Add pages, documents, data, etc. like normal to test your theme's contents. As you make modifications to your theme and to your content, your site will regenerate and you should see the changes in the browser after a refresh, just like normal.
67
+
68
+ When your theme is released, only the files in `_layouts`, `_includes`, `_sass` and `assets` tracked with Git will be bundled.
69
+ To add a custom directory to your theme-gem, please edit the regexp in `ockham.gemspec` accordingly.
70
+
71
+ ## License
72
+
73
+ The theme is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
@@ -0,0 +1,68 @@
1
+ {%- if page.type == 'categories' -%}
2
+ {%- assign taxonomies = site.categories -%}
3
+ {%- elsif page.type == 'tags' -%}
4
+ {%- assign taxonomies = site.tags -%}
5
+ {%- else -%}
6
+ {%- assign taxonomies = none -%}
7
+ {%- endif -%}
8
+
9
+ {%- assign max_count = 0 -%}
10
+ {%- for taxonomy in taxonomies -%}
11
+ {%- assign posts = taxonomy[1] -%}
12
+ {%- if posts.size > max_count -%}
13
+ {%- assign max_count = posts.size -%}
14
+ {%- endif -%}
15
+ {%- endfor -%}
16
+
17
+ <div class="taxonomies-wrapper">
18
+ <ul class="taxonomies">
19
+ {%- for i in (1..max_count) reversed -%}
20
+ {%- for taxonomy in taxonomies -%}
21
+ {%- assign taxonomy_name = taxonomy[0] -%}
22
+ {%- assign slugified_taxonomy_name = taxonomy_name | slugify -%}
23
+ {%- assign posts = taxonomy[1] -%}
24
+ {%- if posts.size == i -%}
25
+ <li>
26
+ {%- capture link -%}{{ page.permalink }}#{{ slugified_taxonomy_name }}{%- endcapture -%}
27
+ <a class="taxonomy" href="{{ link | relative_url }}">
28
+ <span>
29
+ {%- if page.type == 'tags' -%}
30
+ {{ slugified_taxonomy_name }}
31
+ {%- else -%}
32
+ {{ taxonomy_name }}
33
+ {%- endif -%}
34
+ </span>
35
+ <span class="taxonomy-count">{{ posts.size }}</span>
36
+ </a>
37
+ </li>
38
+ {%- endif -%}
39
+ {%- endfor -%}
40
+ {%- endfor -%}
41
+ </ul>
42
+ </div>
43
+
44
+ {%- for i in (1..max_count) reversed -%}
45
+ {%- for taxonomy in taxonomies -%}
46
+ {%- assign taxonomy_name = taxonomy[0] -%}
47
+ {%- assign slugified_taxonomy_name = taxonomy_name | slugify -%}
48
+ {%- assign posts = taxonomy[1] -%}
49
+ {%- if posts.size == i -%}
50
+ <h2 id="{{ slugified_taxonomy_name }}">
51
+ {%- if page.type == 'tags' -%}
52
+ {{ slugified_taxonomy_name }}
53
+ {%- else -%}
54
+ {{ taxonomy_name }}
55
+ {%- endif -%}
56
+ </h2>
57
+ <ul class="post-list-by-taxonomy">
58
+ {%- for post in posts -%}
59
+ <li>
60
+ <time datetime="{{ page.date | date_to_xmlschema }}">{{ post.date | date: "%Y-%m-%d" }}</time>
61
+ &raquo;
62
+ <a href="{{ post.url | relative_url }}">{{ post.title | escape }}</a>
63
+ </li>
64
+ {%- endfor -%}
65
+ </ul>
66
+ {%- endif -%}
67
+ {%- endfor -%}
68
+ {%- endfor -%}
@@ -0,0 +1,29 @@
1
+ {% assign taxonomies = site.posts | group_by_exp: "post", "post.date | date: '%Y'" %}
2
+
3
+ <div class="taxonomies-wrapper">
4
+ <ul class="taxonomies">
5
+ {%- for taxonomy in taxonomies -%}
6
+ <li>
7
+ {%- capture link -%}{{ page.permalink }}#{{ taxonomy.name }}{%- endcapture -%}
8
+ <a class="taxonomy" href="{{ link | relative_url }}">
9
+ <span>{{ taxonomy.name }}</span>
10
+ <span class="taxonomy-count">{{ taxonomy.size }}</span>
11
+ </a>
12
+ </li>
13
+ {%- endfor -%}
14
+ </ul>
15
+ </div>
16
+
17
+ {%- for taxonomy in taxonomies -%}
18
+ <h2 id="{{ taxonomy.name }}">{{ taxonomy.name }}</h2>
19
+ <ul class="post-list-by-taxonomy">
20
+ {%- assign posts = taxonomy.items -%}
21
+ {%- for post in posts -%}
22
+ <li>
23
+ <time datetime="{{ page.date | date_to_xmlschema }}">{{ post.date | date: "%Y-%m-%d" }}</time>
24
+ &raquo;
25
+ <a href="{{ post.url | relative_url }}">{{ post.title | escape }}</a>
26
+ </li>
27
+ {%- endfor -%}
28
+ </ul>
29
+ {%- endfor -%}
@@ -0,0 +1,3 @@
1
+ {% comment %}
2
+ A placeholder for customizing head.
3
+ {% endcomment %}
@@ -0,0 +1,17 @@
1
+ <div id="disqus_thread"></div>
2
+ <script>
3
+ var disqus_config = function () {
4
+ this.page.url = '{{ page.url | absolute_url }}';
5
+ this.page.identifier = '{{ page.url | absolute_url }}';
6
+ };
7
+
8
+ (function() {
9
+ var d = document, s = d.createElement('script');
10
+
11
+ s.src = 'https://{{ site.disqus }}.disqus.com/embed.js';
12
+
13
+ s.setAttribute('data-timestamp', +new Date());
14
+ (d.head || d.body).appendChild(s);
15
+ })();
16
+ </script>
17
+ <noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript" rel="nofollow">comments powered by Disqus.</a></noscript>
@@ -0,0 +1,9 @@
1
+ <!-- Global site tag (gtag.js) - Google Analytics -->
2
+ <script async src="https://www.googletagmanager.com/gtag/js?id={{ site.google_analytics }}"></script>
3
+ <script>
4
+ window.dataLayer = window.dataLayer || [];
5
+ function gtag(){dataLayer.push(arguments);}
6
+ gtag('js', new Date());
7
+
8
+ gtag('config', '{{ site.google_analytics }}');
9
+ </script>
@@ -0,0 +1,12 @@
1
+ <head>
2
+ <meta charset="UTF-8">
3
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
4
+
5
+ <link rel="stylesheet" href="{{ 'assets/css/normalize.css' | relative_url }}">
6
+ <link rel="stylesheet" href="{{ 'assets/css/open-color.css' | relative_url }}">
7
+ <link rel="stylesheet" href="{{ 'assets/css/ockham.css' | relative_url }}">
8
+ <script async src="{{ 'assets/js/ockham.js' | relative_url }}"></script>
9
+ <script async src="https://use.fontawesome.com/releases/v5.15.4/js/all.js"></script>
10
+
11
+ {% include custom-head.html %}
12
+ </head>
@@ -0,0 +1,2 @@
1
+ <script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
2
+ <script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
@@ -0,0 +1,30 @@
1
+ <input type="checkbox" class="sidebar-checkbox" id="sidebar-checkbox">
2
+ <div class="sidebar" id="sidebar">
3
+ <div class="sidebar-item">
4
+ <p>{{ site.description }}</p>
5
+ </div>
6
+
7
+ {% if site.data.navigation %}
8
+ <nav class="sidebar-nav">
9
+ <ul class="sidebar-nav-list">
10
+ {% for item in site.data.navigation %}
11
+ <li">
12
+ <a href="{{ item.url | relative_url }}" class="sidebar-nav-item {% if page.url == item.url %}active{% endif %}">
13
+ {{ item.title }}
14
+ </a>
15
+ </li>
16
+ {% endfor %}
17
+ </ul>
18
+ </nav>
19
+ {% endif %}
20
+
21
+ {% if site.data.social %}
22
+ <div class="sidebar-item">
23
+ {% for social in site.data.social %}
24
+ <a class="social-icon" href="{{ social.url }}" target="_blank">
25
+ <i class="{{ social.icon | default: 'fas fa-link' }}" title="{{ social.title }}"></i>
26
+ </a>
27
+ {% endfor %}
28
+ </div>
29
+ {% endif %}
30
+ </div>
@@ -0,0 +1,11 @@
1
+ ---
2
+ layout: page
3
+ ---
4
+
5
+ {{ content }}
6
+
7
+ {% if page.type == "years" %}
8
+ {% include archive-by-years.html %}
9
+ {% else %}
10
+ {% include archive-by-tagories.html %}
11
+ {% endif %}
@@ -0,0 +1,45 @@
1
+ <!DOCTYPE html>
2
+ <html lang="{{ page.lang | default: site.lang | default: 'en' }}">
3
+
4
+ {% include head.html %}
5
+
6
+ <body>
7
+ {% include sidebar.html %}
8
+
9
+ <div class="wrap">
10
+ <div class="container">
11
+
12
+ <header class="masthead">
13
+ <h3 class="masthead-title">
14
+ <a href="{{ '/' | relative_url }}" title="Home">{{ site.title }}</a>
15
+ <small>{{ site.tagline }}</small>
16
+ </h3>
17
+ </header>
18
+
19
+ <main>
20
+ {{ content }}
21
+ </main>
22
+
23
+ <footer class="footer">
24
+ <small>
25
+ &copy; <time datetime="{{ site.time | date_to_xmlschema }}">{{ site.time | date: '%Y' }}</time>
26
+ {%- if site.author -%}
27
+ &nbsp;<a href="{{ site.author.url }}" target="_blank">{{ site.author.name }}</a>
28
+ {%- endif -%}. All rights reserved. <br>
29
+ Powered by <a href="https://jekyllrb.com/" target="_blank">Jekyll</a> with <a href="https://github.com/zivong/ockham" target="_blank">Ockham</a>.
30
+ </small>
31
+ </footer>
32
+ </div>
33
+ </div>
34
+
35
+ <label for="sidebar-checkbox" class="sidebar-toggle"></label>
36
+
37
+ {% if page.math %}
38
+ {% include mathjax.html %}
39
+ {% endif %}
40
+
41
+ {% if jekyll.environment == 'production' and site.google_analytics %}
42
+ {% include google-analytics.html %}
43
+ {% endif %}
44
+ </body>
45
+ </html>
@@ -0,0 +1,44 @@
1
+ ---
2
+ layout: default
3
+ ---
4
+
5
+ {{ content }}
6
+
7
+ <div class="posts">
8
+ {% assign posts = site.posts %}
9
+ {% if paginator %}
10
+ {% assign posts = paginator.posts %}
11
+ {% endif %}
12
+ {% for post in posts %}
13
+ <div class="post-entry">
14
+ <time datetime="{{ post.date | date_to_xmlschema }}" class="post-meta">{{ post.date | date_to_string }}</time>
15
+ <h2 class="post-title">
16
+ <a href="{{ post.url | relative_url }}">
17
+ {{ post.title }}
18
+ </a>
19
+ </h2>
20
+ <p class="post-excerpt">
21
+ {% if post.description %}
22
+ {{ post.description | strip_html }}
23
+ {% else %}
24
+ {{ post.excerpt | strip_html }}
25
+ {% endif %}
26
+ </p>
27
+ </div>
28
+ {% endfor %}
29
+ </div>
30
+
31
+ {% if paginator %}
32
+ <div class="pagination">
33
+ {% if paginator.next_page %}
34
+ <a class="pagination-item older" href="{{ paginator.next_page_path | relative_url }}"><i class="fas fa-chevron-left"></i></a>
35
+ {% else %}
36
+ <span class="pagination-item older"><i class="fas fa-chevron-left"></i></span>
37
+ {% endif %}
38
+ {% if paginator.previous_page %}
39
+ <a class="pagination-item newer" href="{{ paginator.previous_page_path | relative_url }}"><i class="fas fa-chevron-right"></i></a>
40
+ {% else %}
41
+ <span class="pagination-item newer"><i class="fas fa-chevron-right"></i></span>
42
+ {% endif %}
43
+ </div>
44
+ {% endif %}
@@ -0,0 +1,8 @@
1
+ ---
2
+ layout: default
3
+ ---
4
+
5
+ <article class="page">
6
+ <h1 class="page-title">{{ page.title }}</h1>
7
+ {{ content }}
8
+ </article>
@@ -0,0 +1,51 @@
1
+ ---
2
+ layout: default
3
+ ---
4
+
5
+ <article class="post">
6
+ <h1 class="post-title">{{ page.title }}</h1>
7
+ <div class="post-meta">
8
+ <time datetime="{{ page.date | date_to_xmlschema }}" itemprop="datePublished">
9
+ {{ page.date | date_to_string }}
10
+ </time>
11
+ {%- if page.last_modified_at -%}
12
+ ~
13
+ {%- assign mdate = page.last_modified_at | date_to_xmlschema -%}
14
+ <time datetime="{{ mdate }}" itemprop="dateModified">
15
+ {{ mdate | date_to_string }}
16
+ </time>
17
+ {%- endif -%}
18
+ {%- if page.author -%}
19
+
20
+ {% for author in page.author %}
21
+ <span itemprop="author" itemscope itemtype="http://schema.org/Person">{{ author }}</span>
22
+ {%- if forloop.last == false %}, {% endif -%}
23
+ {% endfor %}
24
+ {%- endif -%}
25
+ </div>
26
+
27
+ {{ content }}
28
+
29
+ </article>
30
+
31
+ {% if jekyll.environment == "production" and site.disqus and page.comments != false %}
32
+ {% include disqus.html %}
33
+ {% endif %}
34
+
35
+ <div class="post-pagination">
36
+ {% if page.previous %}
37
+ <a class="post-pagination-item older" href="{{ page.previous.url | relative_url }}">
38
+ <i class="fas fa-chevron-left"></i> <span class="post-pagination-title">{{ page.previous.title | markdownify | strip_html }}</span>
39
+ </a>
40
+ {% else %}
41
+ <span class="post-pagination-item older"></span>
42
+ {% endif %}
43
+
44
+ {% if page.next %}
45
+ <a class="post-pagination-item newer" href="{{ page.next.url | relative_url }}">
46
+ <span class="post-pagination-title">{{ page.next.title | markdownify | strip_html }}</span> <i class="fas fa-chevron-right"></i>
47
+ </a>
48
+ {% else %}
49
+ <span class="post-pagination-item newer"></span>
50
+ {% endif %}
51
+ </div>
@@ -0,0 +1,80 @@
1
+ * {
2
+ box-sizing: border-box;
3
+ }
4
+
5
+ body {
6
+ font-family: var(--body-font);
7
+ font-size: var(--body-font-size);
8
+ line-height: var(--body-line-height);
9
+ color: var(--body-color);
10
+ background-color: var(--body-bg);
11
+ }
12
+
13
+ a {
14
+ color: var(--link-color);
15
+ text-decoration: none;
16
+
17
+ &:focus,
18
+ &:hover {
19
+ text-decoration: underline;
20
+ }
21
+ }
22
+
23
+ blockquote {
24
+ opacity: .5;
25
+ margin-left: 0;
26
+ margin-right: 0;
27
+ padding: 0 var(--spacer);
28
+ border-left: .1em solid;
29
+ }
30
+
31
+ figure {
32
+ margin: 0;
33
+ }
34
+
35
+ img {
36
+ display: block;
37
+ max-width: 100%;
38
+ margin: 1em 0;
39
+ border-radius: var(--border-radius);
40
+ }
41
+
42
+ code, pre {
43
+ font-family: var(--code-font);
44
+ }
45
+
46
+ code {
47
+ padding: .1em .25em;
48
+ background-color: var(--code-bg);
49
+ border-radius: var(--border-radius);
50
+ }
51
+
52
+ pre {
53
+ overflow: auto;
54
+ padding: 1em;
55
+ margin: 1em 0;
56
+
57
+ code {
58
+ padding: 0;
59
+ background-color: inherit;
60
+ }
61
+ }
62
+
63
+ table {
64
+ width: 100%;
65
+ border-collapse: collapse;
66
+ }
67
+
68
+ td, th {
69
+ padding: .25em .5em;
70
+ border-bottom: 1px solid var(--border-color);
71
+ }
72
+
73
+ thead th {
74
+ border-bottom-color: currentColor;
75
+ }
76
+
77
+ hr {
78
+ border: 0;
79
+ border-top: 1px solid var(--border-color);
80
+ }
@@ -0,0 +1,87 @@
1
+ .highlight table td { padding: 5px; }
2
+ .highlight table pre { margin: 0; }
3
+ .highlight, .highlight .w {
4
+ color: #fbf1c7;
5
+ background-color: #282828;
6
+ }
7
+ .highlight .err {
8
+ color: #fb4934;
9
+ background-color: #282828;
10
+ font-weight: bold;
11
+ }
12
+ .highlight .c, .highlight .ch, .highlight .cd, .highlight .cm, .highlight .cpf, .highlight .c1, .highlight .cs {
13
+ color: #928374;
14
+ font-style: italic;
15
+ }
16
+ .highlight .cp {
17
+ color: #8ec07c;
18
+ }
19
+ .highlight .nt {
20
+ color: #fb4934;
21
+ }
22
+ .highlight .o, .highlight .ow {
23
+ color: #fbf1c7;
24
+ }
25
+ .highlight .p, .highlight .pi {
26
+ color: #fbf1c7;
27
+ }
28
+ .highlight .gi {
29
+ color: #b8bb26;
30
+ background-color: #282828;
31
+ }
32
+ .highlight .gd {
33
+ color: #fb4934;
34
+ background-color: #282828;
35
+ }
36
+ .highlight .gh {
37
+ color: #b8bb26;
38
+ font-weight: bold;
39
+ }
40
+ .highlight .k, .highlight .kn, .highlight .kp, .highlight .kr, .highlight .kv {
41
+ color: #fb4934;
42
+ }
43
+ .highlight .kc {
44
+ color: #d3869b;
45
+ }
46
+ .highlight .kt {
47
+ color: #fabd2f;
48
+ }
49
+ .highlight .kd {
50
+ color: #fe8019;
51
+ }
52
+ .highlight .s, .highlight .sb, .highlight .sc, .highlight .dl, .highlight .sd, .highlight .s2, .highlight .sh, .highlight .sx, .highlight .s1 {
53
+ color: #b8bb26;
54
+ font-style: italic;
55
+ }
56
+ .highlight .si {
57
+ color: #b8bb26;
58
+ font-style: italic;
59
+ }
60
+ .highlight .sr {
61
+ color: #b8bb26;
62
+ font-style: italic;
63
+ }
64
+ .highlight .sa {
65
+ color: #fb4934;
66
+ }
67
+ .highlight .se {
68
+ color: #fe8019;
69
+ }
70
+ .highlight .nn {
71
+ color: #8ec07c;
72
+ }
73
+ .highlight .nc {
74
+ color: #8ec07c;
75
+ }
76
+ .highlight .no {
77
+ color: #d3869b;
78
+ }
79
+ .highlight .na {
80
+ color: #b8bb26;
81
+ }
82
+ .highlight .m, .highlight .mb, .highlight .mf, .highlight .mh, .highlight .mi, .highlight .il, .highlight .mo, .highlight .mx {
83
+ color: #d3869b;
84
+ }
85
+ .highlight .ss {
86
+ color: #83a598;
87
+ }