diff options
author | Jeffrey Tse <jeffreytse.mail@gmail.com> | 2019-09-11 12:19:34 +0800 |
---|---|---|
committer | Jeffrey Tse <jeffreytse.mail@gmail.com> | 2019-09-11 12:21:17 +0800 |
commit | 61eae5c5f9881cab29712f6e696085baa977e1f9 (patch) | |
tree | bb301b58b94fee5dcefbdfae8f0c8fc13ee5bd21 /_layouts | |
parent | cd3a8163dd997d0a7c4d320816651efa8f7dce60 (diff) |
release: v1.0.0
Diffstat (limited to '_layouts')
-rw-r--r-- | _layouts/404.html | 25 | ||||
-rw-r--r-- | _layouts/archives.html | 18 | ||||
-rw-r--r-- | _layouts/articles.html | 14 | ||||
-rw-r--r-- | _layouts/categories.html | 16 | ||||
-rw-r--r-- | _layouts/default.html | 24 | ||||
-rw-r--r-- | _layouts/framework.html | 35 | ||||
-rw-r--r-- | _layouts/home.html (renamed from _layouts/page.html) | 2 | ||||
-rw-r--r-- | _layouts/post.html | 52 | ||||
-rw-r--r-- | _layouts/tags.html | 16 |
9 files changed, 198 insertions, 4 deletions
diff --git a/_layouts/404.html b/_layouts/404.html new file mode 100644 index 0000000..2bda249 --- /dev/null +++ b/_layouts/404.html @@ -0,0 +1,25 @@ +--- +layout: default +--- + +<style type="text/css" media="screen"> + .container { + margin: 10px auto; + max-width: 600px; + text-align: center; + color: #3c3c3c; + } + h1 { + margin: 30px 0; + font-size: 4em; + line-height: 1; + letter-spacing: -1px; + } +</style> + +<div class="container"> + <h1>404</h1> + + <p><strong>Page not found :(</strong></p> + <p>Try to check other pages through the menu. </p> +</div> diff --git a/_layouts/archives.html b/_layouts/archives.html new file mode 100644 index 0000000..bbe9ebb --- /dev/null +++ b/_layouts/archives.html @@ -0,0 +1,18 @@ +--- +layout: framework +sidebar: archive-list +--- + +{%- if site.posts.size > 0 -%} + + {% include functions.html func='log' level='debug' msg='Get datetimes value' %} + + {% assign filter = '%Y' %} + {% include functions.html func='get_datetimes' %} + {% assign datetimes = return %} + + {% assign keys = datetimes | reverse %} + {% assign field = 'date' %} + {% include views/segments.html %} + +{%- endif -%} diff --git a/_layouts/articles.html b/_layouts/articles.html new file mode 100644 index 0000000..89e9d86 --- /dev/null +++ b/_layouts/articles.html @@ -0,0 +1,14 @@ +--- +layout: framework +sidebar: category-list +--- + +<div class="articles"> + {% if page.banner == nil %} + {% assign banner = page.title %} + {% endif %} + + {{ content }} + + {% include views/pagination.html %} +<div> diff --git a/_layouts/categories.html b/_layouts/categories.html new file mode 100644 index 0000000..7d37d89 --- /dev/null +++ b/_layouts/categories.html @@ -0,0 +1,16 @@ +--- +layout: framework +sidebar: category-list +--- + +{%- if site.posts.size > 0 -%} + + {%- include functions.html func='log' level='debug' msg='Get value' -%} + {%- include functions.html func='get_categories' -%} + {% assign categories = return %} + + {% assign keys = categories %} + {% assign field = 'categories' %} + {%- include views/segments.html -%} + +{%- endif -%} diff --git a/_layouts/default.html b/_layouts/default.html index cddd070..1823491 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -1 +1,23 @@ -{{ content }} +<!DOCTYPE html> +<html lang="{{ page.lang | default: site.lang | default: "en" }}"> + + {%- include head.html -%} + + <body> + + {%- include views/header.html -%} + + {%- include views/banner.html -%} + + {%- include extensions/hashlocate.html -%} + + <main class="page-content" aria-label="Content"> + <div class="wrapper"> + {{ content }} + </div> + </main> + + {%- include views/footer.html -%} + + </body> +</html> diff --git a/_layouts/framework.html b/_layouts/framework.html new file mode 100644 index 0000000..f7186c6 --- /dev/null +++ b/_layouts/framework.html @@ -0,0 +1,35 @@ +--- +layout: default +--- + +<div class="framework"> + <section class="main"> + + {{ content }} + + </section> + <section class="sidebar" style="margin-left: 15px;"> + <!-- Get sidebar items --> + {%- if page.sidebar -%} + {%- assign sidebar = page.sidebar -%} + {%- elsif site.defaults[page.layout].sidebar -%} + {%- assign sidebar = site.defaults[page.layout].sidebar -%} + {%- elsif layout.sidebar -%} + {%- assign sidebar = layout.sidebar -%} + {%- endif -%} + + {%- for item in sidebar -%} + + {%- assign file = item -%} + {%- assign array = file | split: '.' -%} + {%- if array.size == 1 -%} + {%- assign file = file | append: '.html' -%} + {%- endif -%} + + {%- assign file = 'sidebar/' | append: file -%} + + {%- include {{ file }} %} + + {%- endfor -%} + </section> +<div> diff --git a/_layouts/page.html b/_layouts/home.html index 5e71126..5b677fe 100644 --- a/_layouts/page.html +++ b/_layouts/home.html @@ -1,5 +1,5 @@ --- -layout: default +layout: articles --- {{ content }} diff --git a/_layouts/post.html b/_layouts/post.html index 5e71126..cae5476 100644 --- a/_layouts/post.html +++ b/_layouts/post.html @@ -1,5 +1,53 @@ --- -layout: default +layout: framework +banner: 'default' +banner_html: post-header.html +sidebar: + - article-menu --- -{{ content }} +<div class="post"> + <section> + + {%- assign name = 'banner' -%} + {%- include functions.html func='get_value' -%} + {%- assign banner = return -%} + + {%- if banner == nil -%} + {%- include views/post-header.html -%} + {%- endif -%} + + {%- include views/article.html -%} + + <div class="post-nav"> + {%- if page.previous -%} + <a href="{{ page.previous.url }}" title="{{ page.previous.title | escape }}">« Prev</a> + {%- else -%} + <span></span> + {%- endif -%} + + {%- if page.next -%} + <a href="{{ page.next.url }}" title="{{ page.next.title | escape }}">Next »</a> + {%- else -%} + <span></span> + {%- endif -%} + </div> + + {%- if page.comments != false -%} + + {%- if site.disqus.shortname -%} + {%- include extensions/comments/disqus.html -%} + {%- endif -%} + + {%- if site.gitment.username -%} + {%- include extensions/comments/gitment.html -%} + {%- endif -%} + + {%- endif -%} + + </section> + + {%- include extensions/mathjax.html -%} +</div> + + diff --git a/_layouts/tags.html b/_layouts/tags.html new file mode 100644 index 0000000..dfd1fa6 --- /dev/null +++ b/_layouts/tags.html @@ -0,0 +1,16 @@ +--- +layout: framework +sidebar: tag-list +--- + +{%- if site.posts.size > 0 -%} + + {%- include functions.html func='log' level='debug' msg='Get tags value' -%} + {%- include functions.html func='get_tags' -%} + {% assign tags = return %} + + {% assign keys = tags %} + {% assign field = 'tags' %} + {%- include views/segments.html -%} + +{%- endif -%} |