forked from kitian616/jekyll-TeXt-theme
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add hero component, article header
- Loading branch information
Showing
30 changed files
with
638 additions
and
392 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
{%- include snippets/get-article-title.html article=include.article-%} | ||
{%- assign _article_title = __return -%} | ||
|
||
{%- if include.html != false -%} | ||
|
||
{%- include snippets/assign.html | ||
target=site.data.variables.default.page.show_title | ||
source0=layout.show_title source1=include.article.show_title -%} | ||
{%- assign _show_title = __return -%} | ||
|
||
{%- include snippets/assign.html | ||
target=site.data.variables.default.page.show_edit_on_github | ||
source0=layout.show_edit_on_github source1=include.article.show_edit_on_github -%} | ||
{%- assign _show_edit_on_github = __return -%} | ||
|
||
<div class="article__header"> | ||
{%- if _show_title -%} | ||
<header><h1>{{ _article_title }}</h1></header> | ||
{%- else -%} | ||
<header style="display:none;"><h1>{{ _article_title }}</h1></header> | ||
{%- endif -%} | ||
{%- if _show_edit_on_github -%} | ||
{%- if site.repository and site.repository_tree -%} | ||
{%- include snippets/is_collection.html page=include.article -%} | ||
{%- assign _is_article_collection = __return -%} | ||
{%- include snippets/locale-to-string.html locale=site.data.locale.POST_ON_GITHUB -%} | ||
{%- assign _locale_post_on_github = __return -%} | ||
{%- if _is_article_collection -%} | ||
{%- include snippets/prepend-path.html path=include.article.path prepend_path=site.collections_dir -%} | ||
{%- assign _article_path = __return -%} | ||
{%- else -%} | ||
{%- assign _article_path = include.article.path -%} | ||
{%- endif -%} | ||
{%- assign _github_path = site.repository | append: '/tree/' | append: site.repository_tree | append: '/' | append: _article_path | replace:'//','/' -%} | ||
<span class="split-space"> </span> | ||
<a class="edit-on-github" | ||
title="{{ _locale_post_on_github }}" | ||
href="https://github.com/{{ _github_path }}"> | ||
<i class="far fa-edit"></i></a> | ||
{%- endif -%} | ||
{%- endif -%} | ||
</div> | ||
{%- endif -%} | ||
|
||
{%- if include.semantic != false -%} | ||
<meta itemprop="headline" content="{{ _article_title }}"> | ||
{%- endif -%} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,67 +1,96 @@ | ||
{%- include snippets/assign.html target=site.data.variables.default.pageview source0=page.pageview -%} | ||
{%- assign _pageview = __return -%} | ||
{%- assign _author = site.data.authors[include.article.author] | default: site.author -%} | ||
|
||
{%- assign _paths_archive = site.paths.archive | default: site.data.variables.default.paths.archive -%} | ||
{%- if include.html != false -%} | ||
|
||
{%- if include.article.author -%} | ||
{%- assign _author = site.data.authors[include.article.author] -%} | ||
{%- else -%} | ||
{%- assign _author = site.author -%} | ||
{%- endif -%} | ||
{%- include snippets/assign.html | ||
target=site.data.variables.default.page.show_date | ||
source0=layout.show_date source1=include.article.show_date -%} | ||
{%- assign _show_date = __return -%} | ||
{%- if _show_date and include.article.date -%} | ||
{%- assign _show_date = true -%} | ||
{%- else -%} | ||
{%- assign _show_date = false -%} | ||
{%- endif -%} | ||
|
||
{%- include snippets/assign.html | ||
target=site.data.variables.default.page.show_tags | ||
source0=layout.show_tags source1=include.article.show_tags -%} | ||
{%- assign _show_tags = __return -%} | ||
{%- if _show_tags and include.article.tags[0] -%} | ||
{%- assign _show_tags = true -%} | ||
{%- else -%} | ||
{%- assign _show_tags = false -%} | ||
{%- endif -%} | ||
|
||
<div class="article__info clearfix"> | ||
{%- assign _show_author = include.article.author -%} | ||
|
||
{%- if _author -%} | ||
<meta itemprop="author" content="{{ _author.name }}"/> | ||
{%- include snippets/assign.html target=site.data.variables.default.page.pageview | ||
source0=layout.pageview source1=page.pageview -%} | ||
{%- assign _pageview = __return -%} | ||
{%- if _pageview or include.show_pageview -%} | ||
{%- assign _pageview = true -%} | ||
{%- else -%} | ||
{%- assign _pageview = false -%} | ||
{%- endif -%} | ||
|
||
{%- if include.article.tags[0] -%} | ||
<ul class="left-col menu"> | ||
{%- assign _paths_archive = site.paths.archive | default: site.data.variables.default.paths.archive -%} | ||
|
||
{%- assign _tag_path = _paths_archive | append: '?tag=' -%} | ||
{%- include snippets/prepend-baseurl.html path=_tag_path -%} | ||
|
||
{%- for _tag in include.article.tags -%} | ||
{%- assign _tag_path = __return -%} | ||
{%- assign _tag_encode = _tag | strip | url_encode } -%} | ||
<li> | ||
<a class="button button--secondary button--pill button--sm" | ||
href="{{ _tag_path | append: _tag_encode | replace: '//', '/' }}">{{ _tag }}</a> | ||
</li> | ||
{%- endfor -%} | ||
{%- assign _keywords = include.article.tags | join: ',' %} | ||
</ul> | ||
<meta itemprop="keywords" content="{{ _keywords }}"> | ||
{%- endif -%} | ||
{%- if _show_tags or _show_author or _show_date or _pageview -%} | ||
<div class="article__info clearfix"> | ||
{%- if _show_tags -%} | ||
|
||
<ul class="left-col menu"> | ||
{%- assign _tag_path = _paths_archive | append: '?tag=' -%} | ||
{%- include snippets/prepend-baseurl.html path=_tag_path -%} | ||
|
||
{%- if include.article.author or include.article.date or _pageview or post -%} | ||
<ul class="right-col menu"> | ||
{%- if include.article.author -%} | ||
<li><i class="fas fa-user"></i> <span>{{ _author.name }}</span></li> | ||
{%- for _tag in include.article.tags -%} | ||
{%- assign _tag_path = __return -%} | ||
{%- assign _tag_encode = _tag | strip | url_encode } -%} | ||
<li> | ||
<a class="button button--secondary button--pill button--sm" | ||
href="{{ _tag_path | append: _tag_encode | replace: '//', '/' }}">{{ _tag }}</a> | ||
</li> | ||
{%- endfor -%} | ||
</ul> | ||
{%- endif -%} | ||
|
||
{%- if include.article.date -%} | ||
<li> | ||
{%- include snippets/locale-to-string.html locale=site.data.locale.ARTICLE_DATE_FORMAT -%} | ||
<i class="far fa-calendar-alt"></i> <span>{{ include.article.date | date: __return }}</span> | ||
<meta itemprop="datePublished" content="{{ include.article.date | date_to_xmlschema }}"> | ||
</li> | ||
{%- endif -%} | ||
{%- if _show_author or _show_date or _pageview -%} | ||
<ul class="right-col menu"> | ||
{%- if _show_author -%} | ||
<li><i class="fas fa-user"></i> <span>{{ _author.name }}</span></li> | ||
{%- endif -%} | ||
|
||
{%- if _show_date -%} | ||
<li> | ||
{%- include snippets/locale-to-string.html locale=site.data.locale.ARTICLE_DATE_FORMAT -%} | ||
<i class="far fa-calendar-alt"></i> <span>{{ include.article.date | date: __return }}</span> | ||
</li> | ||
{%- endif -%} | ||
|
||
{%- if _pageview or include.show_pageview -%} | ||
{%- if site.pageview.provider -%} | ||
{%- include snippets/locale-to-string.html locale=site.data.locale.VIEWS -%} | ||
{%- assign _locale_views = __return -%} | ||
<li itemprop="interactionStatistic" itemscope itemtype="http://schema.org/InteractionCounter"> | ||
<link itemprop="interactionType" href="http://schema.org/WatchAction"/> | ||
<i class="far fa-eye"></i> <span class="js-pageview" data-page-key="{{ include.article.key }}">0</span> {{ _locale_views }} | ||
</li> | ||
{%- endif -%} | ||
{%- if _pageview -%} | ||
{%- if site.pageview.provider -%} | ||
{%- include snippets/locale-to-string.html locale=site.data.locale.VIEWS -%} | ||
{%- assign _locale_views = __return -%} | ||
<li><i class="far fa-eye"></i> <span class="js-pageview" data-page-key="{{ include.article.key }}">0</span> {{ _locale_views }}</li> | ||
{%- endif -%} | ||
{%- endif -%} | ||
</ul> | ||
{%- endif -%} | ||
|
||
</ul> | ||
</div> | ||
{%- endif -%} | ||
{%- endif -%} | ||
|
||
|
||
</div> | ||
{%- if include.semantic != false -%} | ||
{%- if _author -%} | ||
<meta itemprop="author" content="{{ _author.name }}"/> | ||
{%- endif -%} | ||
{%- if include.article.date -%} | ||
<meta itemprop="datePublished" content="{{ include.article.date | date_to_xmlschema }}"> | ||
{%- endif -%} | ||
{%- if include.article.tags[0] -%} | ||
{%- assign _keywords = include.article.tags | join: ',' %} | ||
<meta itemprop="keywords" content="{{ _keywords }}"> | ||
{%- endif -%} | ||
{%- endif -%} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,40 @@ | ||
<header class="header"> | ||
<div class="main"> | ||
<div class="header__main"> | ||
<div class="logo"> | ||
{%- include svg/logo.svg -%} | ||
{%- assign _paths_root = site.paths.root | default: site.data.variables.default.paths.root -%} | ||
{%- include snippets/get-nav-url.html path=_paths_root -%} | ||
{%- if site.title -%} | ||
<a title="{%- if site.description -%}{{ site.description }}{%- endif -%}" href="{{ __return }}">{{ site.title }}</a> | ||
{%- endif -%} | ||
{%- if include.theme == 'dark' -%} | ||
<header class="header header--dark"> | ||
{%- elsif include.theme == 'light' -%} | ||
<header class="header header--light"> | ||
{%- else -%} | ||
<header class="header"> | ||
{%- endif -%} | ||
<div class="main"> | ||
<div class="header__main"> | ||
<div class="logo"> | ||
{%- include svg/logo.svg -%} | ||
{%- assign _paths_root = site.paths.root | default: site.data.variables.default.paths.root -%} | ||
{%- include snippets/get-nav-url.html path=_paths_root -%} | ||
{%- if site.title -%} | ||
<a title="{%- if site.description -%}{{ site.description }}{%- endif -%}" href="{{ __return }}">{{ site.title }}</a> | ||
{%- endif -%} | ||
</div> | ||
<button class="button button--secondary button--circle search-button js-search-toggle"><i class="fas fa-search"></i></button> | ||
</div> | ||
<button class="button button--secondary button--circle search-button js-search-toggle"><i class="fas fa-search"></i></button> | ||
{%- if site.data.navigation.header -%} | ||
<nav class="navigation"> | ||
<ul> | ||
{%- for _item in site.data.navigation.header -%} | ||
{%- include snippets/get-nav-url.html path=_item.url -%} | ||
{%- assign _nav_url = __return -%} | ||
{%- include snippets/get-nav-url.html path=page.url -%} | ||
{%- assign _page_url = __return -%} | ||
{%- include snippets/locale-to-string.html locale=_item.titles -%} | ||
{%- if _nav_url == _page_url -%} | ||
<li class="active"><a href="{{ _nav_url }}">{%- if _item.title -%}{{ _item.title }}{%- else -%}{{ __return }}{%- endif -%}</a></li> | ||
{%- else -%} | ||
<li><a href="{{ _nav_url }}">{%- if _item.title -%}{{ _item.title }}{%- else -%}{{ __return }}{%- endif -%}</a></li> | ||
{%- endif -%} | ||
{%- endfor -%} | ||
<li><button class="button button--secondary button--circle search-button js-search-toggle"><i class="fas fa-search"></i></button></li> | ||
</ul> | ||
</nav> | ||
{%- endif -%} | ||
</div> | ||
{%- if site.data.navigation.header -%} | ||
<nav class="navigation"> | ||
<ul> | ||
{%- for _item in site.data.navigation.header -%} | ||
{%- include snippets/get-nav-url.html path=_item.url -%} | ||
{%- assign _nav_url = __return -%} | ||
{%- include snippets/get-nav-url.html path=page.url -%} | ||
{%- assign _page_url = __return -%} | ||
{%- include snippets/locale-to-string.html locale=_item.titles -%} | ||
{%- if _nav_url == _page_url -%} | ||
<li class="active"><a href="{{ _nav_url }}">{%- if _item.title -%}{{ _item.title }}{%- else -%}{{ __return }}{%- endif -%}</a></li> | ||
{%- else -%} | ||
<li><a href="{{ _nav_url }}">{%- if _item.title -%}{{ _item.title }}{%- else -%}{{ __return }}{%- endif -%}</a></li> | ||
{%- endif -%} | ||
{%- endfor -%} | ||
<li><button class="button button--secondary button--circle search-button js-search-toggle"><i class="fas fa-search"></i></button></li> | ||
</ul> | ||
</nav> | ||
{%- endif -%} | ||
</div> | ||
</header> | ||
</header> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,17 @@ | ||
{%- include snippets/assign.html target=site.data.variables.default.chart source0=site.chart -%} | ||
{%- include snippets/assign.html target=__return source0=page.chart -%} | ||
|
||
{%- include snippets/assign.html target=site.data.variables.default.chart | ||
source0=site.chart source1=page.chart -%} | ||
{%- if __return == true -%} | ||
{%- include markdown-enhancements/chart.html -%} | ||
{%- endif -%} | ||
|
||
{%- include snippets/assign.html target=site.data.variables.default.mathjax source0=site.mathjax -%} | ||
{%- include snippets/assign.html target=__return source0=page.mathjax -%} | ||
|
||
{%- include snippets/assign.html target=site.data.variables.default.mathjax | ||
source0=site.mathjax source1=page.mathjax -%} | ||
{%- if __return == true -%} | ||
{%- include markdown-enhancements/mathjax.html -%} | ||
{%- endif -%} | ||
|
||
{%- include snippets/assign.html target=site.data.variables.default.mermaid source0=site.mermaid -%} | ||
{%- include snippets/assign.html target=__return source0=page.mermaid -%} | ||
|
||
{%- include snippets/assign.html target=site.data.variables.default.mermaid | ||
source0=site.mermaid source1=page.mermaid -%} | ||
{%- if __return == true -%} | ||
{%- include markdown-enhancements/mermaid.html -%} | ||
{%- endif -%} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.