Skip to content

Commit

Permalink
feat: ADd layout for about
Browse files Browse the repository at this point in the history
  • Loading branch information
anso33 committed Nov 14, 2023
1 parent b432104 commit 951ca97
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 2 deletions.
2 changes: 1 addition & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ header_pages:
- archives.html
- categories.html
- tags.html
- about.md
# - about.md

# Page default value
# defaults:
Expand Down
2 changes: 1 addition & 1 deletion _layouts/about.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
layout: post
layout: aboutlayouts
hidden:
- header
- navigator
Expand Down
74 changes: 74 additions & 0 deletions _layouts/aboutlayouts.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
---
layout: framework
banner:
banner_html: post-header.html
hidden: []
<!-- sidebar:
- article-menu -->
---

<div class="post">
<section>
{%- assign name = 'banner' -%} {%- include functions.html func='get_value'
-%} {%- assign banner = return -%} {%- assign name = 'hidden' -%} {%-
include functions.html func='get_value' -%} {%- assign hidden = return -%}
{%- assign result = hidden | where_exp: "item", "item == 'header'" -%} {%-
if banner == nil and result.size == 0 -%} {%- include views/post-header.html
-%} {%- endif -%} {%- include views/article.html -%} {%- assign result =
hidden | where_exp: "item", "item == 'navigator'" -%} {%- if result.size ==
0 -%}
<div class="post-nav">
{%- if page.previous -%}
<a
class="previous"
href="{{ page.previous.url | relative_url }}"
title="{{
page.previous.title | escape }}"
>{{ page.previous.title | escape | truncatewords: 6 }}</a
>
{%- else -%}
<span></span>
{%- endif -%} {%- if page.next -%}
<a
class="next"
href="{{ page.next.url | relative_url }}"
title="{{ page.next.title | escape }}"
>{{ page.next.title | escape | truncatewords: 6 }}</a
>
{%- else -%}
<span></span>
{%- endif -%}
</div>
{%- endif -%} {%- assign result = hidden | where_exp: "item", "item ==
'related_posts'" -%} {%- if result.size == 0 -%}
<div class="post-related">
<div>Related Articles</div>
<ul>
{% assign posts = site[page.collection] | sample:4 %} {%- for post in
posts -%} {%- assign post_item_class = "" -%} {%- if post.top -%} {%-
assign post_item_class = "top-post" -%} {%- endif -%}
<li class="{{ post_item_class }}">
<a
class="post-link"
href="{{ post.url | relative_url }}"
title="{{ post.title | escape }}"
>
{{ post.title | escape | truncatewords: 12 }} {%- include
views/post-badges.html -%}
</a>
</li>
{%- endfor -%}
</ul>
</div>
{%- endif -%} {%- assign result = hidden | where_exp: "item", "item ==
'comments'" -%} {%- if result.size == 0 -%}
<div class="post-comments">
{%- if page.comments != false -%} {%- if site.disqus.shortname -%} {%-
include extensions/comments/disqus.html -%} {%- endif -%} {%- if
site.gitment.username -%} {%- include extensions/comments/gitment.html -%}
{%- endif -%} {%- if site.utterances.repo -%} {%- include
extensions/comments/utterances.html -%} {%- endif -%} {%- endif -%}
</div>
{%- endif -%}
</section>
</div>

0 comments on commit 951ca97

Please sign in to comment.