Skip to content

Commit

Permalink
rework sidebar
Browse files Browse the repository at this point in the history
  • Loading branch information
LazyRen committed Dec 15, 2020
1 parent 6d54aa8 commit 6987151
Show file tree
Hide file tree
Showing 23 changed files with 71 additions and 109 deletions.
3 changes: 1 addition & 2 deletions _featured_categories/devlog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ layout: list
type: category
title: Devlog
slug: devlog
menu: true
submenu: true
sidebar: true
order: 2
description: >
Anything about Development
Expand Down
3 changes: 1 addition & 2 deletions _featured_categories/review.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ layout: list
type: category
title: Review
slug: review
menu: true
submenu: false
sidebar: true
order: 3
description: >
Reviews on hardware/software
Expand Down
3 changes: 1 addition & 2 deletions _featured_tags/algorithm.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ type: tag
title: Algorithm
slug: algorithm
category: devlog
menu: false
submenu: true
sidebar: true
order: 1
description: >
Algorithm study / Problem solutions
Expand Down
3 changes: 1 addition & 2 deletions _featured_tags/blog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ type: tag
title: Blog
slug: blog
category: devlog
menu: false
submenu: false
sidebar: false
order: 9
description: >
Posts about blogging / jekyll theme.
Expand Down
3 changes: 1 addition & 2 deletions _featured_tags/bwtree.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ type: tag
title: Bw Tree
slug: bwtree
category: devlog
menu: false
submenu: true
sidebar: true
order: 2
description: >
[OpenBwTree](https://github.com/LazyRen/BwTree) Analysis for Grad Thesis
Expand Down
3 changes: 1 addition & 2 deletions _featured_tags/coding-interview.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ type: tag
title: Coding Interview
slug: coding-interview
category: devlog
menu: false
submenu: false
sidebar: false
description: >
Self-study for coding interview preparation.
---
3 changes: 1 addition & 2 deletions _featured_tags/concurrent-programming.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ type: tag
title: Concurrent Programming
slug: concurrent-programming
category: devlog
menu: false
submenu: true
sidebar: true
order: 3
description: >
Study of Hanyang Univ. Concurrent Programming(2019) Course.
Expand Down
3 changes: 1 addition & 2 deletions _featured_tags/data-structure.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ type: tag
title: Data Structure
slug: data-structure
category: devlog
menu: false
submenu: false
sidebar: false
description: >
STL-like Data Structure Implementations
---
3 changes: 1 addition & 2 deletions _featured_tags/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ type: tag
title: Development
slug: development
category: devlog
menu: false
submenu: true
sidebar: true
order: 4
description: >
Development Tips & Settings
Expand Down
3 changes: 1 addition & 2 deletions _featured_tags/git.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ type: tag
title: Git
slug: git
category: devlog
menu: false
submenu: false
sidebar: false
description: >
Any article related to Git.
---
4 changes: 1 addition & 3 deletions _featured_tags/hardware.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ type: tag
title: Hardware
slug: hardware
category: review
menu: false
submenu: false
order: 1
sidebar: false
description: >
Hardware reviews
---
3 changes: 1 addition & 2 deletions _featured_tags/mac.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ type: tag
title: Mac
slug: mac
category: devlog
menu: false
submenu: false
sidebar: false
description: >
Mac related articles
---
4 changes: 1 addition & 3 deletions _featured_tags/software.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ type: tag
title: Software
slug: software
category: review
menu: false
submenu: false
order: 2
sidebar: false
description: >
Software reviews
---
3 changes: 1 addition & 2 deletions _featured_tags/sublime-text.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ type: tag
title: Sublime Text
slug: sublime-text
category: devlog
menu: false
submenu: false
sidebar: false
description: >
Sublime Text related articles.
---
3 changes: 1 addition & 2 deletions _featured_tags/terminal.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ type: tag
title: Terminal
slug: terminal
category: devlog
menu: false
submenu: false
sidebar: false
description: >
Terminal related articles
---
3 changes: 1 addition & 2 deletions _featured_tags/translation.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ type: tag
title: Translation
slug: translation
category: devlog
menu: false
submenu: false
sidebar: false
description: >
English to Korean translated articles.
---
50 changes: 22 additions & 28 deletions _includes/body/nav.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,38 +15,32 @@
</li>
{% endfor %}
{% else %}
{% assign pages = site.pages %}
{% assign documents = site.documents %}
{% assign nodes = pages | concat: documents | where: "menu", true | sort: "order" %}
{% assign subnodes = pages | concat: documents | where: "menu", false | where: "submenu", true | sort: "order" %}

{% assign nodes = site.pages | concat: site.documents | where: "sidebar", true | sort: "order" %}
{% assign tag_nodes = nodes | where: "type", "tag" %}
{% for node in nodes %}
{% assign count = count | plus: 1 %}
{% unless node.redirect_to %}
<li>
<input type="checkbox" id="list-item-{{ count }}" />
<div class="list-wrapper">
<a
{% if forloop.first %}id="_navigation"{% endif %}
href="{{ node.url | relative_url }}"
class="sidebar-nav-item"
{% if node.rel %}rel="{{ node.rel }}"{% endif %}
>
{{ node.title }}
</a>
{% if node.submenu %}<label class="folder" for="list-item-{{ count }}"></label>{% endif %}
</div>
<ul class="list-body">
{% for subnode in subnodes %}
{% if subnode.category == node.slug %}
<li>
<a class="sidebar-nav-subitem{% if page.url == subnode.url %} active{% endif %}"
href="{{ subnode.url | relative_url }}">{{ subnode.title }}</a>
</li>
{% if node.type != "tag" %}
{% assign subnodes = tag_nodes | where_exp: "item", "item.category == node.slug" %}
{% assign count = count | plus: 1 %}
<li>
{% if subnodes != empty %}
<input type="checkbox" id="list-item-{{ count }}" />
{% endif %}
<div class="list-wrapper">
<a {% if forloop.first %}id="_navigation"{% endif %} href="{{ node.url | relative_url }}" class="sidebar-nav-item" {% if node.rel %}rel="{{ node.rel }}"{% endif %} >{{ node.title }}</a>
{% if subnodes != empty %}
<label class="folder" for="list-item-{{ count }}"></label>
{% endif %}
</div>
{% for subnode in subnodes %}
{% if forloop.first %}<ul class="list-body">{% endif %}
<li>
<a class="sidebar-nav-subitem" href="{{ subnode.url | relative_url }}">{{ subnode.title }}</a>
</li>
{% if forloop.last %}</ul>{% endif %}
{% endfor %}
</ul>
</li>
</li>
{% endif %}
{% else %}
<li>
<a href="{{ node.redirect_to }}" class="sidebar-nav-item external">{{ node.title }}</a>
Expand Down
4 changes: 2 additions & 2 deletions _includes/body/sidebar-sticky.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="sidebar-sticky">
<div class="sidebar-sticky" style="opacity:0">
<div class="sidebar-about">
{% if site.logo %}
<a class="no-hover" href="{{ '/' | relative_url }}" tabindex="-1">
Expand All @@ -22,4 +22,4 @@
<div class="sidebar-social">
{% include components/social.html author=author %}
</div>
</div>
</div>
14 changes: 3 additions & 11 deletions _layouts/tag-list.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,13 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

layout: base
layout: page
---

{% assign posts = site.tags[page.slug] %}

{% if page.title.size > 0 %}
<header>
<h1 class="page-title">{{ page.title }}</h1>
{% include components/message.html text=page.description hide=page.hide_description %}
</header>
<hr class="sr-only"/>
{% endif %}

{{ content }}

{% assign posts = site.tags[page.slug] %}

{% assign date_formats = site.data.strings.date_formats %}
{% assign list_group_by = date_formats.list_group_by | default:"%Y" %}
{% assign list_entry = date_formats.list_entry | default:"%d %b" %}
Expand Down
53 changes: 24 additions & 29 deletions _layouts/tags.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
---
layout: base
layout: page
---

{% if page.title.size > 0 %}
<header>
<h1 class="page-title">{{ page.title }}</h1>
{% include components/message.html text=page.description hide=page.hide_description %}
</header>
<hr class="sr-only"/>
{% endif %}
{{ content }}

{% assign documents = site.documents %}
{% assign featured_categories = documents | where: "type", "category" | sort %}
Expand All @@ -18,26 +12,27 @@ <h1 class="page-title">{{ page.title }}</h1>
{% assign tags = site.tags | sort %}

{% for category in featured_categories %}
<h1 id="{{ category.slug }}" class="hr">
<a href="{{ category.url | relative_url }}">{{ category.title }}</a>
{% for site_category in categories %}
{% if site_category[0] == category.slug %}
<span class="faded fine">{{ site_category | last | size }}</span>
<h2 id="{{ category.slug }}" class="hr">
<a href="{{ category.url | relative_url }}">{{ category.title }}</a>
{% for site_category in categories %}
{% if site_category[0] == category.slug %}
<span class="faded fine">{{ site_category | last | size }}</span>
{% endif %}
{% endfor %}
</h2>
<ul class="related-posts">
{% for tag in featured_tags %}
{% if tag.category == category.slug %}
<li class="h6">
<a href="{{ tag.url | relative_url }}">{{ tag.title }}</a>
{% for site_tag in tags %}
{% if site_tag[0] == tag.slug %}
<span class="faded fine">{{ site_tag | last | size }}</span>
{% break %}
{% endif %}
{% endfor %}
</h1>
<ul class="related-posts">
{% for tag in featured_tags %}
{% if tag.category == category.slug %}
<li class="h4">
<a href="{{ tag.url | relative_url }}">{{ tag.title }}</a>
{% for site_tag in tags %}
{% if site_tag[0] == tag.slug %}
<span class="faded fine">{{ site_tag | last | size }}</span>
{% endif %}
{% endfor %}
</li>
{% endif %}
{% endfor %}
</ul>
{% endfor %}
</li>
{% endif %}
{% endfor %}
</ul>
{% endfor %}
5 changes: 2 additions & 3 deletions _sass/my-style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,18 @@
position: absolute;
height: 95%;
padding-top: 5%;
opacity: 1 !important;
}

.sidebar-nav-item {
width:100%;
font-weight: normal;
padding: .25rem 0;
}

.sidebar-nav-subitem {
@extend .f4;
font-weight: normal;
width:100%;
display: inline-block;
line-height: 1.75;
padding: .25rem 0;
}

Expand Down
2 changes: 1 addition & 1 deletion about.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ layout: welcome
title: About
permalink: /about/
more_posts: posts.md
menu: true
sidebar: true
order: 1
---

Expand Down
2 changes: 1 addition & 1 deletion tags.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
layout: tags
title: Tags
permalink: /tags/
menu: true
sidebar: true
order: 4
description: >
List of all categories & tags of blog.
Expand Down

0 comments on commit 6987151

Please sign in to comment.