jekyll-theme-yat 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +21 -0
  3. data/README.md +52 -0
  4. data/_data/defaults.yml +4 -0
  5. data/_data/translate_langs.yml +30 -0
  6. data/_includes/extensions/comments/disqus.html +18 -0
  7. data/_includes/extensions/comments/gitment.html +15 -0
  8. data/_includes/extensions/geopattern.html +21 -0
  9. data/_includes/extensions/google-analytics.html +12 -0
  10. data/_includes/extensions/google-translate.html +98 -0
  11. data/_includes/extensions/hashlocate.html +39 -0
  12. data/_includes/extensions/mathjax.html +10 -0
  13. data/_includes/extensions/trianglify.html +23 -0
  14. data/_includes/functions/get_categories.html +12 -0
  15. data/_includes/functions/get_datetimes.html +18 -0
  16. data/_includes/functions/get_tags.html +12 -0
  17. data/_includes/functions/get_value.html +19 -0
  18. data/_includes/functions/log.html +17 -0
  19. data/_includes/functions.html +25 -0
  20. data/_includes/head.html +16 -0
  21. data/_includes/sidebar/archive-list.html +10 -0
  22. data/_includes/sidebar/article-menu.html +59 -0
  23. data/_includes/sidebar/category-list.html +9 -0
  24. data/_includes/sidebar/common-list.html +25 -0
  25. data/_includes/sidebar/google-translate.html +3 -0
  26. data/_includes/sidebar/tag-list.html +9 -0
  27. data/_includes/views/article.html +11 -0
  28. data/_includes/views/banner.html +66 -0
  29. data/_includes/views/footer.html +13 -0
  30. data/_includes/views/header.html +44 -0
  31. data/_includes/views/pagination.html +33 -0
  32. data/_includes/views/paginator.html +21 -0
  33. data/_includes/views/post-header.html +11 -0
  34. data/_includes/views/post-item.html +13 -0
  35. data/_includes/views/segments.html +21 -0
  36. data/_includes/views/site-brand.html +7 -0
  37. data/_layouts/404.html +25 -0
  38. data/_layouts/archives.html +18 -0
  39. data/_layouts/articles.html +14 -0
  40. data/_layouts/categories.html +16 -0
  41. data/_layouts/default.html +23 -0
  42. data/_layouts/framework.html +35 -0
  43. data/_layouts/home.html +8 -0
  44. data/_layouts/post.html +53 -0
  45. data/_layouts/tags.html +16 -0
  46. data/_sass/misc/article-menu.scss +47 -0
  47. data/_sass/misc/common-list.scss +49 -0
  48. data/_sass/misc/google-translate.scss +190 -0
  49. data/_sass/yat/_base.scss +258 -0
  50. data/_sass/yat/_layout.scss +388 -0
  51. data/_sass/yat/_syntax-highlighting.scss +105 -0
  52. data/_sass/yat.scss +69 -0
  53. data/assets/main.scss +25 -0
  54. metadata +179 -0
@@ -0,0 +1,66 @@
1
+ {%- include functions.html func='log' level='debug' msg='Get banner_html value' -%}
2
+ {% assign name = 'banner_html' %}
3
+ {%- include functions.html func='get_value' -%}
4
+ {% assign banner_html = return %}
5
+
6
+ {%- include functions.html func='log' level='debug' msg='Get banner value' -%}
7
+ {% assign name = 'banner' %}
8
+ {%- include functions.html func='get_value' -%}
9
+ {% assign banner = return %}
10
+
11
+ {%- include functions.html func='log' level='debug' msg='Get heading value' -%}
12
+ {% assign name = 'heading' %}
13
+ {%- include functions.html func='get_value' -%}
14
+ {% assign heading = return %}
15
+
16
+ {%- include functions.html func='log' level='debug' msg='Get subheading value' -%}
17
+ {% assign name = 'subheading' %}
18
+ {%- include functions.html func='get_value' -%}
19
+ {% assign subheading = return %}
20
+
21
+ {% if banner %}
22
+
23
+ {% assign auto_banner = true %}
24
+ {% assign array = banner | split: '//' %}
25
+ {% assign protocol = array[0] %}
26
+
27
+ {% if array.size > 1 and (protocol == '' or protocol == 'http:' or protocol == 'https:') %}
28
+ {% assign auto_banner = false %}
29
+ {% endif %}
30
+
31
+ <section class="page-banner">
32
+ <div class="page-banner-img">
33
+ {%- if auto_banner == false -%}
34
+ <div style="background-image: url({{ banner }})"></div>
35
+ {%- endif -%}
36
+ </div>
37
+ <div class="wrapper">
38
+ <div class="page-banner-inner">
39
+
40
+ {%- if banner_html -%}
41
+
42
+ {%- assign banner_html = 'views/' | append: banner_html -%}
43
+ {%- include {{ banner_html }} -%}
44
+
45
+ {%- else -%}
46
+
47
+ <h1 class="page-banner-heading">
48
+ {{ heading | default: page.title | escape }}
49
+ </h1>
50
+ <h3 class="page-banner-subheading">
51
+ {{ subheading | default: page.subtitle | escape }}
52
+ </h3>
53
+
54
+ {%- endif -%}
55
+ </div>
56
+ </div>
57
+ </section>
58
+
59
+ {%- if auto_banner -%}
60
+ {%- assign selector = ".page-banner-img" -%}
61
+ {%- assign seed = page.id | append: '-seed-' | append: banner -%}
62
+ {%- include extensions/trianglify.html -%}
63
+ {%- endif -%}
64
+
65
+ {%- endif -%}
66
+
@@ -0,0 +1,13 @@
1
+ <footer class="site-footer h-card">
2
+ <data class="u-url" href="{{ "/" | relative_url }}"></data>
3
+
4
+ <div class="wrapper">
5
+ <div class="site-footer-inner">
6
+ <div>{{ site.copyright }} @{{ site.author | escape }}</div>
7
+ <div>Powered by <a title="Jekyll is a simple, blog-aware, static site
8
+ generator." href="http://jekyllrb.com/">Jekyll</a> &amp; <a title="Yat, yet
9
+ another theme." href="https://github.com/jeffreytse/jekyll-theme-yat">Yat Theme</a>.</div>
10
+ <div class="footer-col rss-subscribe">Subscribe <a href="{{ "/feed.xml" | relative_url }}">via RSS</a></div>
11
+ </div>
12
+ </div>
13
+ </footer>
@@ -0,0 +1,44 @@
1
+ <header class="site-header" role="banner">
2
+
3
+ <div class="wrapper">
4
+ {%- assign default_paths = site.pages | where: "dir", "/" | map: "path" -%}
5
+ {%- assign page_paths = site.header_pages | default: default_paths -%}
6
+
7
+ <span class="site-brand">
8
+ {%- include views/site-brand.html -%}
9
+ </span>
10
+
11
+ {%- if page_paths -%}
12
+ <nav class="site-nav">
13
+ <input type="checkbox" id="nav-trigger" class="nav-trigger" />
14
+ <label for="nav-trigger">
15
+ <span class="menu-icon">
16
+ <svg viewBox="0 0 18 15" width="18px" height="15px">
17
+ <path d="M18,1.484c0,0.82-0.665,1.484-1.484,1.484H1.484C0.665,2.969,0,2.304,0,1.484l0,0C0,0.665,0.665,0,1.484,0 h15.032C17.335,0,18,0.665,18,1.484L18,1.484z M18,7.516C18,8.335,17.335,9,16.516,9H1.484C0.665,9,0,8.335,0,7.516l0,0 c0-0.82,0.665-1.484,1.484-1.484h15.032C17.335,6.031,18,6.696,18,7.516L18,7.516z M18,13.516C18,14.335,17.335,15,16.516,15H1.484 C0.665,15,0,14.335,0,13.516l0,0c0-0.82,0.665-1.483,1.484-1.483h15.032C17.335,12.031,18,12.695,18,13.516L18,13.516z"/>
18
+ </svg>
19
+ </span>
20
+ </label>
21
+
22
+ <div class="trigger">
23
+ {%- for path in page_paths -%}
24
+ {%- assign my_page = site.pages | where: "path", path | first -%}
25
+ {%- if my_page.title -%}
26
+ <a class="page-link" href="{{ my_page.url | relative_url }}">
27
+ {{ my_page.title | upcase | escape }}
28
+ </a>
29
+ {%- endif -%}
30
+ {%- endfor -%}
31
+
32
+ {%- assign name = 'translate_langs' -%}
33
+ {%- include functions.html func='get_value' -%}
34
+ {%- assign translate_langs = return -%}
35
+ {%- if translate_langs.size > 0 -%}
36
+ <span class="page-link">
37
+ {%- include extensions/google-translate.html -%}
38
+ </span>
39
+ {%- endif -%}
40
+ </div>
41
+ </nav>
42
+ {%- endif -%}
43
+ </div>
44
+ </header>
@@ -0,0 +1,33 @@
1
+ {%- if page.paginator -%}
2
+ {%- assign paginator = page.paginator -%}
3
+ {%- elsif paginator == nil -%}
4
+ {%- assign paginator = site -%}
5
+ {%- endif -%}
6
+
7
+ {%- if paginator.posts.size > 0 -%}
8
+ <div class="pagination">
9
+ <!-- Post list links -->
10
+ <ul class="post-list">
11
+ {%- for post in paginator.posts -%}
12
+ <li>
13
+ {%- assign date_format = site.yat.date_format | default: "%b %-d, %Y" -%}
14
+ <span class="post-meta">{{ post.date | date: date_format }}</span>
15
+ <h3>
16
+ {%- assign post_url = post.url | relative_url -%}
17
+ <a class="post-link" href="{{ post_url }}">
18
+ {{ post.title | escape }}
19
+ </a>
20
+ </h3>
21
+ <p class="post-excerpt">
22
+ {{ post.content | strip_html | truncatewords: 50 }}
23
+ </p>
24
+ </li>
25
+ {%- endfor -%}
26
+ </ul>
27
+
28
+ <!-- Pagination links -->
29
+ {%- if paginator.posts.size < site.posts.size -%}
30
+ {%- include views/paginator.html -%}
31
+ {%- endif -%}
32
+ </div>
33
+ {%- endif -%}
@@ -0,0 +1,21 @@
1
+ {% if include.paginator %}
2
+ {% assign paginator = include.paginator %}
3
+ {% endif %}
4
+
5
+ {% if paginator.posts.size > 0 %}
6
+ <div class="pagination">
7
+ {% if paginator.previous_page %}
8
+ <a href="{{ paginator.previous_page_path }}">&laquo; Prev</a>
9
+ {% else %}
10
+ <span>&laquo; Prev</span>
11
+ {% endif %}
12
+
13
+ <span> {{ paginator.page }}/{{ paginator.total_pages }}</span>
14
+
15
+ {% if paginator.next_page %}
16
+ <a href="{{ paginator.next_page_path }}">Next &raquo;</a>
17
+ {% else %}
18
+ <span>Next &raquo;</span>
19
+ {% endif %}
20
+ </div>
21
+ {% endif %}
@@ -0,0 +1,11 @@
1
+ <header class="post-header">
2
+ <h1 class="post-title p-name" itemprop="name headline">{{ heading | default: page.title | escape }}</h1>
3
+ <h3>{{ subheading | default: page.subtitle | escape }}</h3>
4
+
5
+ <p class="post-meta">
6
+ <time class="dt-published" datetime="{{ page.date | date_to_xmlschema }}" itemprop="datePublished">
7
+ {%- assign date_format = site.yat.date_format | default: "%b %-d, %Y" -%}
8
+ {{ page.date | date: date_format }}
9
+ </time>
10
+ </p>
11
+ </header>
@@ -0,0 +1,13 @@
1
+ {%- if include.item -%}
2
+ {%- assign item = include.item -%}
3
+ {%- endif -%}
4
+
5
+ {%- assign post = item -%}
6
+
7
+ {% assign date_format = site.yat.date_format | default: "%b %-d, %Y" %}
8
+ <span class="post-meta">{{ post.date | date: date_format }}</span>
9
+ <span>
10
+ <a class="post-link" href="{{ post.url | relative_url }}">
11
+ {{ post.title | escape }}
12
+ </a>
13
+ </span>
@@ -0,0 +1,21 @@
1
+ {%- if include.keys -%}
2
+ {%- assign keys = include.keys -%}
3
+ {%- endif -%}
4
+
5
+ {%- if include.field -%}
6
+ {%- assign field = include.field -%}
7
+ {%- endif -%}
8
+
9
+ <div class="page-segments">
10
+ <ul class="page-segments-list">
11
+ {% for key in keys %}
12
+ <h2 id="{{ key }}" class="segment-name">{{ key }}</h2>
13
+ {% assign items = site.posts | where: field, key %}
14
+ {% for item in items %}
15
+ {% if item != nil %}
16
+ <li> {% include views/post-item.html %} </li>
17
+ {% endif %}
18
+ {% endfor %}
19
+ {% endfor %}
20
+ </ul>
21
+ </div>
@@ -0,0 +1,7 @@
1
+ <a class="site-title" rel="author" href="{{ "/" | relative_url }}">
2
+ {%- if site.favicon -%}
3
+ <img class="site-favicon" title="{{ site.title | escape }}" src="{{
4
+ site.favicon }}">
5
+ {%- endif -%}
6
+ {{ site.title | escape }}
7
+ </a>
data/_layouts/404.html ADDED
@@ -0,0 +1,25 @@
1
+ ---
2
+ layout: default
3
+ ---
4
+
5
+ <style type="text/css" media="screen">
6
+ .container {
7
+ margin: 10px auto;
8
+ max-width: 600px;
9
+ text-align: center;
10
+ color: #3c3c3c;
11
+ }
12
+ h1 {
13
+ margin: 30px 0;
14
+ font-size: 4em;
15
+ line-height: 1;
16
+ letter-spacing: -1px;
17
+ }
18
+ </style>
19
+
20
+ <div class="container">
21
+ <h1>404</h1>
22
+
23
+ <p><strong>Page not found :(</strong></p>
24
+ <p>Try to check other pages through the menu. </p>
25
+ </div>
@@ -0,0 +1,18 @@
1
+ ---
2
+ layout: framework
3
+ sidebar: archive-list
4
+ ---
5
+
6
+ {%- if site.posts.size > 0 -%}
7
+
8
+ {% include functions.html func='log' level='debug' msg='Get datetimes value' %}
9
+
10
+ {% assign filter = '%Y' %}
11
+ {% include functions.html func='get_datetimes' %}
12
+ {% assign datetimes = return %}
13
+
14
+ {% assign keys = datetimes | reverse %}
15
+ {% assign field = 'date' %}
16
+ {% include views/segments.html %}
17
+
18
+ {%- endif -%}
@@ -0,0 +1,14 @@
1
+ ---
2
+ layout: framework
3
+ sidebar: category-list
4
+ ---
5
+
6
+ <div class="articles">
7
+ {% if page.banner == nil %}
8
+ {% assign banner = page.title %}
9
+ {% endif %}
10
+
11
+ {{ content }}
12
+
13
+ {% include views/pagination.html %}
14
+ <div>
@@ -0,0 +1,16 @@
1
+ ---
2
+ layout: framework
3
+ sidebar: category-list
4
+ ---
5
+
6
+ {%- if site.posts.size > 0 -%}
7
+
8
+ {%- include functions.html func='log' level='debug' msg='Get value' -%}
9
+ {%- include functions.html func='get_categories' -%}
10
+ {% assign categories = return %}
11
+
12
+ {% assign keys = categories %}
13
+ {% assign field = 'categories' %}
14
+ {%- include views/segments.html -%}
15
+
16
+ {%- endif -%}
@@ -0,0 +1,23 @@
1
+ <!DOCTYPE html>
2
+ <html lang="{{ page.lang | default: site.lang | default: "en" }}">
3
+
4
+ {%- include head.html -%}
5
+
6
+ <body>
7
+
8
+ {%- include views/header.html -%}
9
+
10
+ {%- include views/banner.html -%}
11
+
12
+ {%- include extensions/hashlocate.html -%}
13
+
14
+ <main class="page-content" aria-label="Content">
15
+ <div class="wrapper">
16
+ {{ content }}
17
+ </div>
18
+ </main>
19
+
20
+ {%- include views/footer.html -%}
21
+
22
+ </body>
23
+ </html>
@@ -0,0 +1,35 @@
1
+ ---
2
+ layout: default
3
+ ---
4
+
5
+ <div class="framework">
6
+ <section class="main">
7
+
8
+ {{ content }}
9
+
10
+ </section>
11
+ <section class="sidebar" style="margin-left: 15px;">
12
+ <!-- Get sidebar items -->
13
+ {%- if page.sidebar -%}
14
+ {%- assign sidebar = page.sidebar -%}
15
+ {%- elsif site.defaults[page.layout].sidebar -%}
16
+ {%- assign sidebar = site.defaults[page.layout].sidebar -%}
17
+ {%- elsif layout.sidebar -%}
18
+ {%- assign sidebar = layout.sidebar -%}
19
+ {%- endif -%}
20
+
21
+ {%- for item in sidebar -%}
22
+
23
+ {%- assign file = item -%}
24
+ {%- assign array = file | split: '.' -%}
25
+ {%- if array.size == 1 -%}
26
+ {%- assign file = file | append: '.html' -%}
27
+ {%- endif -%}
28
+
29
+ {%- assign file = 'sidebar/' | append: file -%}
30
+
31
+ {%- include {{ file }} %}
32
+
33
+ {%- endfor -%}
34
+ </section>
35
+ <div>
@@ -0,0 +1,8 @@
1
+ ---
2
+ layout: articles
3
+ heading: 'Your awesome heading'
4
+ subheading: 'Your awesome subheading'
5
+ banner: 'default'
6
+ ---
7
+
8
+ {{ content }}
@@ -0,0 +1,53 @@
1
+ ---
2
+ layout: framework
3
+ banner: 'default'
4
+ banner_html: post-header.html
5
+ sidebar:
6
+ - article-menu
7
+ ---
8
+
9
+ <div class="post">
10
+ <section>
11
+
12
+ {%- assign name = 'banner' -%}
13
+ {%- include functions.html func='get_value' -%}
14
+ {%- assign banner = return -%}
15
+
16
+ {%- if banner == nil -%}
17
+ {%- include views/post-header.html -%}
18
+ {%- endif -%}
19
+
20
+ {%- include views/article.html -%}
21
+
22
+ <div class="post-nav">
23
+ {%- if page.previous -%}
24
+ <a href="{{ page.previous.url }}" title="{{ page.previous.title | escape }}">&laquo; Prev</a>
25
+ {%- else -%}
26
+ <span></span>
27
+ {%- endif -%}
28
+
29
+ {%- if page.next -%}
30
+ <a href="{{ page.next.url }}" title="{{ page.next.title | escape }}">Next &raquo;</a>
31
+ {%- else -%}
32
+ <span></span>
33
+ {%- endif -%}
34
+ </div>
35
+
36
+ {%- if page.comments != false -%}
37
+
38
+ {%- if site.disqus.shortname -%}
39
+ {%- include extensions/comments/disqus.html -%}
40
+ {%- endif -%}
41
+
42
+ {%- if site.gitment.username -%}
43
+ {%- include extensions/comments/gitment.html -%}
44
+ {%- endif -%}
45
+
46
+ {%- endif -%}
47
+
48
+ </section>
49
+
50
+ {%- include extensions/mathjax.html -%}
51
+ </div>
52
+
53
+
@@ -0,0 +1,16 @@
1
+ ---
2
+ layout: framework
3
+ sidebar: tag-list
4
+ ---
5
+
6
+ {%- if site.posts.size > 0 -%}
7
+
8
+ {%- include functions.html func='log' level='debug' msg='Get tags value' -%}
9
+ {%- include functions.html func='get_tags' -%}
10
+ {% assign tags = return %}
11
+
12
+ {% assign keys = tags %}
13
+ {% assign field = 'tags' %}
14
+ {%- include views/segments.html -%}
15
+
16
+ {%- endif -%}
@@ -0,0 +1,47 @@
1
+ /*
2
+ * Post menu
3
+ */
4
+
5
+ .post-menu {
6
+ padding: 0 20px;
7
+ max-width: 250px;
8
+
9
+ .post-menu-title {
10
+ font-size: $base-font-size * 1.35;
11
+ margin-bottom: 6px;
12
+ font-weight: 600;
13
+ color: #4e4e4e;
14
+
15
+ &:before {
16
+ content: '\f02e';
17
+ margin-right: 5px;
18
+ font-size: $base-font-size * 1.15;
19
+ }
20
+ }
21
+
22
+ .post-menu-content {
23
+ ul {
24
+ @for $i from 2 to 7 {
25
+ .h-h#{$i} {
26
+ padding-left: ($i - 2) * $base-font-size * 0.9;
27
+ font-size: (7 - $i) + $base-font-size * 0.9;
28
+ }
29
+ }
30
+
31
+ a {
32
+ display: flex;
33
+ padding: 0px 8px;
34
+
35
+ * {
36
+ pointer-events: none;
37
+ }
38
+ }
39
+
40
+ .active {
41
+ color: white;
42
+ background: mix(invert($theme-color), darkorange);
43
+ transition: background 0.5s;
44
+ }
45
+ }
46
+ }
47
+ }
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Common list
3
+ */
4
+ .common-list {
5
+ @include relative-font-size(1.0);
6
+
7
+ background: #eaeaea;
8
+ box-shadow: 0px 0px 3px 0px #a9a9a9;
9
+ border-radius: 3px;
10
+ min-width: 200px;
11
+
12
+ ul {
13
+ list-style: none;
14
+ margin: 0;
15
+ }
16
+
17
+ li {
18
+ border-bottom: 1px solid $background-color;
19
+
20
+ &:last-child {
21
+ border-bottom: none;
22
+ }
23
+
24
+ a {
25
+ display: flex;
26
+ justify-content: space-between;
27
+ padding: 8px 12px;
28
+ text-decoration: none;
29
+ font-weight: 600;
30
+ color: mix($theme-color, #666);
31
+ transition: background 0.2s;
32
+
33
+ &:hover {
34
+ background: mix($theme-color, #fff, 20%);
35
+ }
36
+ }
37
+
38
+ span {
39
+ @include relative-font-size(0.8);
40
+ display: inline-block;
41
+ border-radius: 10px;
42
+ align-self: center;
43
+ background: darken(invert($theme-color), 20%);
44
+ padding: 0px 8px;
45
+ margin-left: 20px;
46
+ color: $white-color;
47
+ }
48
+ }
49
+ }