Skip to content

Commit

Permalink
sidebar add and etc
Browse files Browse the repository at this point in the history
  • Loading branch information
imreplay committed Jul 10, 2018
1 parent b2e7dc8 commit 16a0cc4
Show file tree
Hide file tree
Showing 14 changed files with 91 additions and 94 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ group :jekyll_plugins do
gem "jekyll-sitemap"
gem "jekyll-paginate"
gem "jekyll-algolia"
gem 'jemoji'
end
3 changes: 1 addition & 2 deletions _data/navigation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ main:
url: "/categories/"



# 블로그 만들기 포스트 사이드바
sidebar-blogging:
- title: "블로그를 만들자!"
Expand Down Expand Up @@ -37,5 +38,3 @@ sidebar-wargame:
children:
- title: "pwnable.kr"
url: "/tags/#pwnable-kr"
- title: "root-me"
url: "/tags/#root-me"
3 changes: 3 additions & 0 deletions _drafts/todo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## 이모지 사용법 알아보기

https://www.webpagefx.com/tools/emoji-cheat-sheet/
24 changes: 24 additions & 0 deletions _includes/nav_list_main
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<nav class="nav__list">
<input id="ac-toc" name="accordion-toc" type="checkbox" />
<label for="ac-toc">{{ site.data.ui-text[site.locale].menu_label | default: "Toggle Menu" }}</label>
<ul class="nav__items" id="category_tag_menu">
<li>
<span class="nav__sub-title" v-on:click='togglec()'>Categories</span>
<ul v-show="flag_c">
{% for category in site.categories %}
<li><a href="/categories/{{category[0] | slugify}}" class="">{{category[0] | capitalize}} ({{category[1].size}})</a></li>
{% endfor %}
</ul>

<span class="nav__sub-title" v-on:click='togglet()'>tags</span>
<ul v-show="flag_t">
{% for tag in site.tags %}
<li><a href="/tags/#{{tag[0] | slugify}}" class="">{{tag[0] | capitalize }} ({{tag[1].size}})</a></li>
{% endfor %}
</ul>

</li>

</ul>
</nav>

21 changes: 21 additions & 0 deletions _includes/scripts.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,24 @@

{% include analytics.html %}
{% include /comments-providers/scripts.html %}

<script src="https://cdn.jsdelivr.net/npm/vue"></script>

<script>
new Vue({
el : '#category_tag_menu',
data : {
flag_c : false,
flag_t : false
},
methods : {
togglec: function(){
this.flag_c = !this.flag_c;
},
togglet: function(){
this.flag_t = !this.flag_t;
}
}
});

</script>
5 changes: 5 additions & 0 deletions _includes/sidebar.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,10 @@
{% include nav_list nav=page.sidebar.nav %}
{% endif %}
{% endif %}

{% if page.sidebar_main %}
{% include nav_list_main %}
{% endif %}

</div>
{% endif %}
90 changes: 2 additions & 88 deletions _layouts/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,69 +2,6 @@
layout: archive
---

{% assign categories_max = 0 %}
{% for category in site.categories %}
{% if category[1].size > categories_max %}
{% assign categories_max = category[1].size %}
{% endif %}
{% endfor %}




<div id="category">
<h2 v-show="flag" v-on:click='toggle()'>
Categories ▲
</h2>

<h2 v-show="!flag" v-on:click='toggle()'>
Categories ▼
</h2>

<ul v-show="flag" class="taxonomy__index">
{% for i in (1..categories_max) reversed %}
{% for category in site.categories %}
{% if category[1].size == i %}
<li>
<a href="/categories/#{{ category[0] | slugify }}">
<strong>{{ category[0] }}</strong> <span class="taxonomy__count">{{ i }}</span>
</a>
</li>
{% endif %}
{% endfor %}
{% endfor %}
</ul>
</div>

{% assign tags_max = 0 %}
{% for tag in site.tags %}
{% if tag[1].size > tags_max %}
{% assign tags_max = tag[1].size %}
{% endif %}
{% endfor %}
<div id="tag">
<h2 v-show="flag" v-on:click='toggle()'>
Tags ▲
</h2>
<h2 v-show="!flag" v-on:click='toggle()'>
Tags ▼
</h2>

<ul v-show="flag" class="taxonomy__index">
{% for i in (1..tags_max) reversed %}
{% for tag in site.tags %}
{% if tag[1].size == i %}
<li>
<a href="/tags/#{{ tag[0] | slugify }}">
<strong>{{ tag[0] }}</strong> <span class="taxonomy__count">{{ i }}</span>
</a>
</li>
{% endif %}
{% endfor %}
{% endfor %}
</ul>

</div>

<h3 class="archive__subtitle">{{ site.data.ui-text[site.locale].recent_posts | default: "Recent Posts" }}</h3>

Expand All @@ -73,29 +10,6 @@ <h3 class="archive__subtitle">{{ site.data.ui-text[site.locale].recent_posts | d
{% endfor %}

{% include paginator.html %}
<script src="https://cdn.jsdelivr.net/npm/vue"></script>

<script>
new Vue({
el : '#category',
data : {
flag : false
},
methods : {
toggle: function(){
this.flag = !this.flag
}
}
});
new Vue({
el : '#tag',
data : {
flag : false
},
methods : {
toggle: function(){
this.flag = !this.flag
}
}
});
</script>


10 changes: 6 additions & 4 deletions _pages/about.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ toc: true

---



{% gist imreplay/a612c451ee371f3748ccbdfda8df2576 %}


Expand All @@ -38,8 +40,9 @@ toc: true

## History

* **18.06.27 블로그 개설**
* **18.07.07 블로그 기능 추가완료 및 Blogging 카테고리 글 작성 완료**
* **18.06.27 블로그 개설:+1:**
* **18.07.07 블로그 기능 추가완료 및 Blogging 카테고리 글 작성 완료:+1:**
* **18.07.10 사이드바 개선(카테고리 및 태그 자동표시):+1:**

## 짦은 소개
현재 공군 정보보호병 복무중[^rokaf]
Expand All @@ -49,7 +52,7 @@ toc: true

포스팅 계획:
* 블로그 만들기 과정 포스팅 (18.07.07 [완료](/categories/#blogging))
* 정보보안산업기사 공부내용 정리[^secu]
* 정보보안산업기사 공부내용 정리
* 보안관련 워게임 / 문제 풀이 기록[^wargame]
* 짤막한 이런저런 파이썬 코드 기록[^py]
* 책읽고 요약정리
Expand All @@ -60,7 +63,6 @@ toc: true

##### 각주[Footnote]

[^secu]: 분명 주문한지 일주일이 지났는데 왜 오질 않니...
[^wargame]: 아직 어떤 문제를 풀지, 어떤 분야를 풀지 고민중 그냥 다하는것도 재밌을거같다
[^py]: 코딩을 정말 더럽게 한다는 친구([UBUN](https://ubun.net))의 말이 있었다. UBUN曰 : "니 코드는 어휴..."
[^rokaf]: [UBUN](https://ubun.net) 이라는 친구와 대학동기인데 군대도 같은곳으로 왔다. 전역하고 2년이다 더 봐야한다니 어휴..
Expand Down
13 changes: 13 additions & 0 deletions _pages/categories/category-blogging.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
title: "Post about Blogging"
layout: archive
permalink: /categories/blogging
author_profile: true
sidebar_main: true
---


{% for post in site.categories.blogging %}
{% include archive-single.html type=page.entries_layout %}
{% endfor %}

12 changes: 12 additions & 0 deletions _pages/categories/category-wargame.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
title: "Post about Wargame"
layout: archive
permalink: /categories/wargame
author_profile: true
sidebar_main: true
---


{% for post in site.categories.Wargame %}
{% include archive-single.html type=page.entries_layout %}
{% endfor %}
1 change: 1 addition & 0 deletions _pages/category-archive.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ title: "Posts by Category"
layout: categories
permalink: /categories/
author_profile: true
sidebar_main: true
---
1 change: 1 addition & 0 deletions _pages/tag-archive.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ title: "Posts by Tag"
permalink: /tags/
layout: tags
author_profile: true
sidebar_main: true
---
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
layout: home
author_profile: true
sidebar_main: true
---

0 comments on commit 16a0cc4

Please sign in to comment.