diff options
author | Karl Hallsby <karl@hallsby.com> | 2020-09-27 14:31:36 -0500 |
---|---|---|
committer | Karl Hallsby <karl@hallsby.com> | 2020-09-27 14:32:00 -0500 |
commit | 61b34a5f260db45575d448d766ea29c0fb273ed3 (patch) | |
tree | 4ac84fa917df0c69fb0fc6d587750514e7d0d813 /_layouts | |
parent | c3cafe3c3817f52d4c588b5b0d6e71e07e06145e (diff) |
Add jekyll-text-theme YAML files
Diffstat (limited to '_layouts')
-rw-r--r-- | _layouts/404.html | 13 | ||||
-rw-r--r-- | _layouts/archive.html | 39 | ||||
-rw-r--r-- | _layouts/article.html | 29 | ||||
-rw-r--r-- | _layouts/articles.html | 89 | ||||
-rw-r--r-- | _layouts/base.html | 25 | ||||
-rw-r--r-- | _layouts/home.html | 42 | ||||
-rw-r--r-- | _layouts/landing.html | 178 | ||||
-rw-r--r-- | _layouts/none.html | 1 | ||||
-rw-r--r-- | _layouts/page.html | 270 |
9 files changed, 686 insertions, 0 deletions
diff --git a/_layouts/404.html b/_layouts/404.html new file mode 100644 index 0000000..4dd94a6 --- /dev/null +++ b/_layouts/404.html @@ -0,0 +1,13 @@ +--- +layout: page +title: 404 +show_title: false +--- +<div class="layout--404"> + <div class="sign"> + <h1>404</h1> + <p>Page not found :(</p> + </div> +</div> + +{{ content }} diff --git a/_layouts/archive.html b/_layouts/archive.html new file mode 100644 index 0000000..02412a6 --- /dev/null +++ b/_layouts/archive.html @@ -0,0 +1,39 @@ +--- +layout: page +titles: + # @start locale config + en : &EN Archive + en-GB : *EN + en-US : *EN + en-CA : *EN + en-AU : *EN + zh-Hans : &ZH_HANS 归档 + zh : *ZH_HANS + zh-CN : *ZH_HANS + zh-SG : *ZH_HANS + zh-Hant : &ZH_HANT 歸檔 + zh-TW : *ZH_HANT + zh-HK : *ZH_HANT + ko : &KO 아카이브 + ko-KR : *KO + fr : &FR Archives + fr-BE : *FR + fr-CA : *FR + fr-CH : *FR + fr-FR : *FR + fr-LU : *FR + # @end locale config +--- + +<div class="layout--archive js-all"> + {%- include tags.html -%} + <div class="js-result layout--archive__result d-none"> + {%- include article-list.html articles=site.posts type='brief' show_info=true reverse=true group_by='year' -%} + </div> +</div> + +<script> + {%- include scripts/archieve.js -%} +</script> + +{{ content }} diff --git a/_layouts/article.html b/_layouts/article.html new file mode 100644 index 0000000..80f3b3c --- /dev/null +++ b/_layouts/article.html @@ -0,0 +1,29 @@ +--- +layout: page +type: article +--- + +{%- include snippets/assign.html + target = site.data.variables.default.page.sharing + source0=layout.sharing source1=page.sharing -%} +{%- assign _sharing = __return -%} + +<div class="layout--article"> + {%- include article/top/custom.html -%} + + <div class="article__content" itemprop="articleBody">{{ content }}</div> + + {%- if _sharing -%} + <section class="article__sharing d-print-none">{%- include sharing.html -%}</section> + {%- endif -%} + + <div class="d-print-none"> + {%- include article-footer.html -%} + {%- include article-section-navigator.html -%} + </div> + +</div> + +<script> + {%- include scripts/article.js -%} +</script> diff --git a/_layouts/articles.html b/_layouts/articles.html new file mode 100644 index 0000000..00738a1 --- /dev/null +++ b/_layouts/articles.html @@ -0,0 +1,89 @@ +--- +layout: page +--- + +{%- assign _page_articles_data_source = page.articles.data_source | default: layout.articles.data_source -%} + +{%- if _page_articles_data_source -%} +{%- assign _keys = _page_articles_data_source | split: '.' -%} +{%- endif -%} + +{%- assign _articles = nil -%} +{%- for _key in _keys -%} + {%- if forloop.first -%} + {%- case _key -%} + {%- when 'site' -%} + {%- assign _articles = site -%} + {%- when 'page' -%} + {%- assign _articles = page -%} + {%- when 'layout' -%} + {%- assign _articles = layout -%} + {%- when 'paginator' -%} + {%- assign _articles = paginator -%} + {%- else -%} + {%- assign _articles = site[_key] -%} + {%- else -%} + {%- endcase -%} + {%- else -%} + {%- assign _articles = _articles[_key] -%} + {%- endif -%} +{%- endfor -%} + +{%- assign _type = page.articles.type | default: layout.articles.type -%} + +{%- if _articles -%} + + <div class="layout--articles"> + + {%- if _type == 'grid' -%} + {%- if page.articles.size == 'sm' -%} + {%- include article-list.html articles=_articles type='grid' size='sm' -%} + {%- else -%} + {%- include article-list.html articles=_articles type='grid' -%} + {%- endif -%} + + {%- elsif _type == 'brief' -%} + {%- include snippets/assign.html + target=site.data.variables.default.page.articles.show_info + source0=layout.articles.show_info source1=page.articles.show_info -%} + {%- assign _show_info = __return -%} + + {%- include article-list.html articles=_articles type='brief' show_info=_show_info -%} + + {%- else -%} + {%- include snippets/assign.html + target=site.data.variables.default.page.articles.show_cover + source0=layout.articles.show_cover source1=page.articles.show_cover -%} + {%- assign _show_cover = __return -%} + + {%- include snippets/assign.html + target=site.data.variables.default.page.articles.show_excerpt + source0=layout.articles.show_excerpt source1=page.articles.show_excerpt -%} + {%- assign _show_excerpt = __return -%} + + {%- include snippets/assign.html + target=site.data.variables.default.page.articles.show_readmore + source0=layout.articles.show_readmore source1=page.articles.show_readmore -%} + {%- assign _show_readmore = __return -%} + + {%- include snippets/assign.html + target=site.data.variables.default.page.articles.show_info + source0=layout.articles.show_info source1=page.articles.show_info -%} + {%- assign _show_info = __return -%} + + {%- assign _article_type = page.articles.article_type | default: layout.articles.article_type -%} + {%- assign _cover_size = page.articles.cover_size | default: layout.articles.cover_size -%} + {%- assign _excerpt_type = page.articles.excerpt_type | default: layout.articles.excerpt_type -%} + + {%- include article-list.html articles=_articles type='item' + article_type=_article_type + show_cover=_show_cover cover_size=_cover_size + show_excerpt=_show_excerpt excerpt_type=_excerpt_type + show_readmore=_show_readmore show_info=_show_info -%} + + {%- endif -%} + + </div> +{%- endif -%} + +{{ content }} diff --git a/_layouts/base.html b/_layouts/base.html new file mode 100644 index 0000000..8a02572 --- /dev/null +++ b/_layouts/base.html @@ -0,0 +1,25 @@ +--- +layout: none +--- +<!DOCTYPE html> +{%- include snippets/get-lang.html -%} +<html lang="{{ __return }}"> + <head> + {%- include analytics.html -%} + {%- include head.html -%} + <script> + {%- include scripts/utils/utils.js -%} + {%- include scripts/lib/throttle.js -%} + {%- include scripts/lib/lazyload.js -%} + </script> + {%- include scripts/variables.html -%} + </head> + <body> + <div class="root" data-is-touch="false"> + {{ content }} + </div> + <script> + {%- include scripts/common.js -%} + </script> + </body> +</html> diff --git a/_layouts/home.html b/_layouts/home.html new file mode 100644 index 0000000..e587d6f --- /dev/null +++ b/_layouts/home.html @@ -0,0 +1,42 @@ +--- +layout: articles +titles: + # @start locale config + en : &EN Home + en-GB : *EN + en-US : *EN + en-CA : *EN + en-AU : *EN + zh-Hans : &ZH_HANS 主页 + zh : *ZH_HANS + zh-CN : *ZH_HANS + zh-SG : *ZH_HANS + zh-Hant : &ZH_HANT 主頁 + zh-TW : *ZH_HANT + zh-HK : *ZH_HANT + ko : &KO 홈 + ko-KR : *KO + fr : &FR Accueil + fr-BE : *FR + fr-CA : *FR + fr-CH : *FR + fr-FR : *FR + fr-LU : *FR + # @end locale config +show_title: false +articles: + data_source: paginator.posts + article_type: BlogPosting + show_cover: false + show_excerpt: true + show_readmore: true + show_info: true +--- +<div class="layout--home"> + {%- include paginator.html -%} +</div> +<script> + {%- include scripts/home.js -%} +</script> + +{{ content }} diff --git a/_layouts/landing.html b/_layouts/landing.html new file mode 100644 index 0000000..306067b --- /dev/null +++ b/_layouts/landing.html @@ -0,0 +1,178 @@ +--- +layout: page +header: false +full_width: true +article_header: + type: overlay + align: center + height: 80vh +--- +<div class="layout--landing"> + <div class="heros"> + {%- for _section in page.data.sections -%} + {%- include snippets/get-nav-url.html path=_section.background_image.src -%} + {%- assign _url = __return -%} + {%- if _section.theme == 'light' -%} + <section class="hero hero--center hero--light" id="hero-{{ forloop.index }}" + {%- elsif _section.theme == 'dark' -%} + <section class="hero hero--center hero--dark" id="hero-{{ forloop.index }}" + {%- else -%} + <section class="hero hero--center" id="hero-{{ forloop.index }}" + {%- endif -%} + {%- if _section.background_color -%} + style="background-image: url({{ _url }}); background-color: {{ _section.background_color }};"> + {%- else -%} + style="background-image: url({{ _url }});"> + {%- endif -%} + + <div class="hero__content"> + <div class="mb-5"> + + <h3>{{ _section.title }}</h3> + {%- if _section.excerpt-%} + <p>{{ _section.excerpt }}</p> + {%- endif -%} + + {%- if _section.actions -%} + <ul class="menu"> + {%- for _action in _section.actions -%} + {%- include snippets/get-nav-url.html path=_action.url -%} + {%- assign _url = __return -%} + {%- assign _type = _action.type | default: 'outline-info' -%} + <li><a class="button button--{{ _type }} button--pill button--lg" href="{{ _url }}">{{ _action.text }}</a></li> + {%- endfor -%} + </ul> + {%- endif -%} + + </div> + + {%- if _section.children -%} + {%- assign _size = _section.children | size -%} + <div class="grid--container"> + <div class="grid grid--p-3"> + + {%- for child in _section.children -%} + + {%- if _size >= 2 -%} + {%- assign _cell_md_col = 6 -%} + {%- else -%} + {%- assign _cell_md_col = 12 | divided_by: _size -%} + {%- endif -%} + + {%- if _size >= 4 -%} + {%- assign _cell_lg_col = 3 -%} + {%- else -%} + {%- assign _cell_lg_col = 12 | divided_by: _size -%} + {%- endif -%} + + <div class="cell cell--12 cell--md-{{ _cell_md_col }} cell--lg-{{ _cell_lg_col }} "> + + <div class="mb-5"> + <h4>{{ child.title }}</h4> + + {%- if child.excerpt-%} + <p>{{ child.excerpt }}</p> + {%- endif -%} + + {%- if child.actions -%} + <ul class="menu"> + {%- for _action in child.actions -%} + {%- include snippets/get-nav-url.html path=_action.url -%} + {%- assign _url = __return -%} + {%- assign _type = _action.type | default: 'outline-info' -%} + <li><a class="button button--{{ _type }} button--pill button--lg" href="{{ _url }}">{{ _action.text }}</a></li> + {%- endfor -%} + </ul> + {%- endif -%} + </div> + + {%- if child.image and child.image.src -%} + + {%- if child.image.url -%} + {%- include snippets/get-nav-url.html path=child.image.url -%} + {%- assign _item_image_url = __return -%} + {%- else -%} + {%- assign _item_image_url = nil -%} + {%- endif -%} + + {%- include snippets/get-nav-url.html path=child.image.src -%} + {%- assign _item_image_src = __return -%} + + {%- if child.image.is_row -%} + <div class="mb-5"> + {%- endif -%} + <div class="mx-auto" style="{{ child.image.style }}"> + {%- if _item_image_url -%} + <a href="{{ _item_image_url }}"> + {%- endif -%} + <img src="{{ _item_image_src }}"/> + {%- if _item_image_url -%} + </a> + {%- endif -%} + </div> + {%- if child.image.is_row -%} + </div> + {%- endif -%} + {%- endif -%} + + {%- if child.content-%} + <p>{{ child.content }}</p> + {%- endif -%} + + </div> + {%- endfor-%} + + </div> + </div> + {%- endif -%} + + {%- if _section.image.full_width == true -%} + </div> {% comment %} end hero__content {% endcomment %} + {%- endif -%} + + {%- if _section.image and _section.image.src -%} + + {%- if _section.image.url -%} + {%- include snippets/get-nav-url.html path=_section.image.url -%} + {%- assign _section_image_url = __return -%} + {%- else -%} + {%- assign _section_image_url = nil -%} + {%- endif -%} + + {%- include snippets/get-nav-url.html path=_section.image.src -%} + {%- assign _section_image_src = __return -%} + + {%- if _section.image.is_row -%} + <div class="mb-5"> + {%- endif -%} + <div class="mx-auto" style="{{ _section.image.style }}"> + {%- if _section_image_url -%} + <a href="{{ _section_image_url }}"> + {%- endif -%} + {%- if _section.image.full_width == true -%} + <img class="hero__cover hero__cover--full-width" src="{{ _section_image_src }}"/> + {%- else -%} + <img class="hero__cover" src="{{ _section_image_src }}"/> + {%- endif -%} + {%- if _section_image_url -%} + </a> + {%- endif -%} + </div> + {%- if _section.image.is_row -%} + </div> + {%- endif -%} + {%- endif -%} + + {%- if _section.image.full_width != true -%} + </div> {% comment %} end hero__content {% endcomment %} + {%- endif -%} + + {%- if _section.content-%} + <p>{{ _section.content }}</p> + {%- endif -%} + </section> + {%- endfor -%} + </div> +</div> + +{{ content }} diff --git a/_layouts/none.html b/_layouts/none.html new file mode 100644 index 0000000..cddd070 --- /dev/null +++ b/_layouts/none.html @@ -0,0 +1 @@ +{{ content }} diff --git a/_layouts/page.html b/_layouts/page.html new file mode 100644 index 0000000..de6b7b2 --- /dev/null +++ b/_layouts/page.html @@ -0,0 +1,270 @@ +--- +layout: base +--- +{%- assign _page_mode = page.mode | default: layout.mode | default: site.data.variables.default.page.mode -%} +{%- assign _page_type = page.type | default: layout.type | default: site.data.variables.default.page.type -%} +{%- assign _article_header_type = page.article_header.type | default: layout.article_header.type -%} + +{%- include snippets/assign.html + target=layout.header source0=page.header -%} +{%- assign _header = __return -%} + +{%- include snippets/assign.html + target=layout.footer source0=page.footer -%} +{%- assign _footer = __return -%} + +{%- include snippets/assign.html + target=layout.lightbox source0=page.lightbox -%} +{%- assign _lightbox = __return -%} + +{%- include snippets/assign.html + target = site.data.variables.default.page.full_width + source0=layout.full_width source1=page.full_width -%} +{%- assign _full_width = __return -%} + +{%- include snippets/assign.html + target = site.data.variables.default.page.comment + source0=layout.comment source1=page.comment -%} +{%- assign _comment = __return -%} + + +{%- assign _article_header_excerpt_truncate = include.excerpt_truncate | default: 200 -%} + +{%- if page.sidebar -%} +<div class="layout--page layout--page--sidebar clearfix js-page-root"> + <div class="page__mask d-print-none js-page-mask js-sidebar-hide"></div> + <div class="page__viewport"> + <div class="page__actions d-print-none"> + <div class="button button--circle button--lg box-shadow-2 sidebar-button js-sidebar-show"> + <i class="fas fa-bars icon--show"></i> + </div> + </div> + + <div class="grid page__grid"> + + <div class="page__sidebar d-print-none"> + {%- include sidebar/toc.html -%} + </div> + +{%- else -%} +<div class="layout--page js-page-root"> +{%- endif -%} + + {%- assign _page_main_class = 'page__main js-page-main' -%} + {%- if _page_mode == 'immersive' -%} + {%- assign _page_main_class = _page_main_class | append: ' page__main--immersive' -%} + {%- endif -%} + {%- unless page.sidebar -%} + {%- assign _page_main_class = _page_main_class | append: ' page__viewport' -%} + {%- endunless -%} + {%- if _footer == false -%} + {%- assign _page_main_class = _page_main_class | append: ' hide-footer' -%} + {%- endif -%} + {%- if page.aside -%} + {%- assign _page_main_class = _page_main_class | append: ' has-aside' -%} + {%- elsif _full_width -%} + {%- assign _page_main_class = _page_main_class | append: ' full-width' -%} + {%- endif -%} + <div class="{{ _page_main_class }} cell cell--auto"> + + <div class="page__main-inner"> + {%- if _header != false -%} + <div class="page__header d-print-none"> + {%- assign _header_theme = page.header.theme | default: layout.header.theme -%} + {%- if _header_theme == 'dark'-%} + {%- include header.html theme='dark' background=page.header.background -%} + {%- elsif _header_theme == 'light' -%} + {%- include header.html theme='light' background=page.header.background -%} + {%- else -%} + {%- include header.html -%} + {%- endif -%} + </div> + {%- endif -%} + + + <div class="page__content"> + {%- if _article_header_type == 'overlay' or _article_header_type == 'cover' -%} + + {%- if _article_header_type == 'overlay' -%} + + {%- assign _article_header_height = page.article_header.height | default: layout.article_header.height -%} + {%- assign _article_header_align = page.article_header.align | default: layout.article_header.align | default: site.data.variables.default.page.article_header.align -%} + {%- assign _article_header_theme = page.article_header.theme | default: layout.article_header.theme | default: site.data.variables.default.page.article_header.theme -%} + + {%- if page.article_header.background_image.src -%} + {%- assign _header_background_image_src = page.article_header.background_image.src -%} + {%- elsif page.article_header.background_image != false and page.cover -%} + {%- assign _header_background_image_src = page.cover -%} + {%- endif -%} + + {%- if page.article_header.background_image.gradient -%} + {%- assign _header_background_image = page.article_header.background_image.gradient -%} + {%- if _header_background_image_src -%} + {%- assign _header_background_image = _header_background_image | append: ',' -%} + {%- endif -%} + {%- endif -%} + + {%- if _header_background_image_src -%} + {%- include snippets/get-nav-url.html path=_header_background_image_src -%} + {%- assign _header_background_image_src = __return -%} + {%- assign _header_background_image = _header_background_image + | append: 'url(' | append: _header_background_image_src | append: ')'-%} + {%- endif -%} + + {%- assign _header_style = 'background-image:' | append: _header_background_image | append: ';' -%} + + {%- if page.article_header.background_color -%} + {%- assign _header_style = _header_style | append: 'background-color:' | append: page.article_header.background_color | append: ';' -%} + {%- endif -%} + + {%- if _article_header_height -%} + {%- assign _header_style = _header_style | append: 'min-height:' | append: _article_header_height | append: ';' -%} + {%- endif -%} + + <div class="article__header--overlay"> + + {%- if _article_header_theme == 'light' -%} + {%- if _article_header_align == 'center' -%} + <div class="hero hero--center hero--light overlay" style="{{ _header_style }}"> + {%- else -%} + <div class="hero hero--light overlay" style="{{ _header_style }}"> + {%- endif -%} + {%- elsif _article_header_theme == 'dark' -%} + {%- if _article_header_align == 'center' -%} + <div class="hero hero--center hero--dark overlay" style="{{ _header_style }}"> + {%- else -%} + <div class="hero hero--dark overlay" style="{{ _header_style }}"> + {%- endif -%} + {%- else -%} + {%- if _article_header_align == 'center' -%} + <div class="hero hero--center overlay" style="{{ _header_style }}"> + {%- else -%} + <div class="hero overlay" style="{{ _header_style }}"> + {%- endif -%} + {%- endif -%} + <div class="hero__content"> + {%- if _full_width == false -%} + <div class ="main"> + {%- endif -%} + {%- include article-info.html article=page semantic=false -%} + {%- include article-header.html article=page semantic=false -%} + {%- if page.excerpt -%} + <p class="overlay__excerpt">{{ page.excerpt | strip_html | strip_newlines | strip | truncate: _article_header_excerpt_truncate }}</p> + {%- endif -%} + {%- if page.article_header.actions -%} + <ul class="menu"> + {%- for _action in page.article_header.actions -%} + {%- include snippets/get-nav-url.html path=_action.url -%} + {%- assign _url = __return -%} + {%- assign _type = _action.type | default: 'info' -%} + <li><a class="button button--{{ _type }} button--rounded button--xl" href="{{ _url }}">{{ _action.text }}</a></li> + {%- endfor -%} + </ul> + {%- endif -%} + {%- if _full_width == false -%} + </div> + {%- endif -%} + </div> + </div> + </div> + {%- elsif _article_header_type == 'cover' -%} + {%- if page.article_header.image.src -%} + {%- include snippets/get-nav-url.html path=page.article_header.image.src -%} + {%- assign _header_image_src = __return -%} + <img class="article__header--cover" src="{{ _header_image_src }}"></img> + {%- endif -%} + {%- endif -%} + + {%- endif -%} + + + {%- if _full_width == false -%} + <div class ="main"> + {%- endif -%} + <div class="grid grid--reverse"> + + <div class="col-aside d-print-none js-col-aside"> + {%- if page.aside -%} + <aside class="page__aside js-page-aside"> + {%- include aside/toc.html -%} + </aside> + {%- endif -%} + </div> + + <div class="col-main cell cell--auto"> + {%- include main/top/custom.html -%} + {%- if _page_type == 'article' -%} + <article itemscope itemtype="http://schema.org/Article"> + {%- elsif _page_type == 'webpage' -%} + <article itemscope itemtype="http://schema.org/WebPage"> + {%- else -%} + <article> + {%- endif -%} + + {%- if _article_header_type == 'overlay' or page.article_header == false -%} + {%- include article-header.html article=page html=false -%} + {%- include article-info.html article=page html=false -%} + {%- else -%} + {%- include article-header.html article=page -%} + {%- include article-info.html article=page -%} + {%- endif -%} + + <div class="js-article-content">{{ content }}</div> + {%- if _comment != false -%} + <section class="page__comments d-print-none">{%- include comments.html -%}</section> + {%- endif -%} + </article> + {%- include main/bottom/custom.html -%} + </div> + </div> + + {%- if _full_width == false -%} + </div> + {%- endif -%} + </div> + + {%- if _footer != false -%} + <div class="page__footer d-print-none">{%- include footer.html -%}</div> + {%- endif -%} + </div> + </div> {%- comment -%} end page__main {%- endcomment -%} +{%- if page.sidebar -%} + </div> {%- comment -%} end grid {%- endcomment -%} + </div> {%- comment -%} end page__viewport {%- endcomment -%} +{%- endif -%} + +<script>{%- include scripts/lib/modal.js -%}</script> +{%- if _lightbox == true -%} + <div class="modal d-print-none js-page-gallery-modal"><div class="gallery"></div></div> +{%- endif -%} +{%- if _header != false -%} + <div class="modal modal--overflow page__search-modal d-print-none js-page-search-modal">{%- include search.html -%}</div> +{%- endif -%} +</div> + + +<script> + {%- include scripts/lib/scroll-to.js -%} + {%- include scripts/lib/affix.js -%} + {%- include scripts/lib/toc.js -%} + {%- if _lightbox == true -%} + {%- include scripts/lib/gallery.js -%} + {%- include scripts/components/lightbox.js -%} + {%- endif -%} + {%- include scripts/page.js -%} +</script> + +{%- if page.sidebar -%} +<script>{%- include scripts/components/sidebar.js -%}</script> +{%- endif -%} + +{%- if page.aside -%} +<script> + /* toc must before affix, since affix need to konw toc' height. */ + {%- if page.aside.toc -%}{%- include scripts/aside/toc.js -%}{%- endif -%} + {%- include scripts/aside/affix.js -%} +</script> +{%- endif -%} + +{%- include markdown-enhancements.html -%} +{%- include pageview.html -%} |