From cb234542f7d9f312f793d9f6032083d7301d9de9 Mon Sep 17 00:00:00 2001 From: Ailin Nemui Date: Wed, 24 May 2017 15:23:58 +0200 Subject: - replace "whatsnew" with yaml - replace settings nav with php - add 404 --- 404.html | 21 ++ _articles/2015-02-12-hacking-irssi.org.markdown | 4 +- _data/sb_whatsnew.yml | 15 + _includes/head.html | 1 - _includes/sb_sidebar_settings.html | 474 ++++-------------------- _includes/sb_whatsnew.html | 23 +- _layouts/default.html | 2 +- assets/css/style.css | 11 + 8 files changed, 151 insertions(+), 400 deletions(-) create mode 100644 404.html create mode 100644 _data/sb_whatsnew.yml diff --git a/404.html b/404.html new file mode 100644 index 0000000..1e8db87 --- /dev/null +++ b/404.html @@ -0,0 +1,21 @@ +--- +layout: default +title: Page not found +--- + +
+
+

{{ page.title }}

+

File not found

+ +

+ The site configured at this address does not + contain the requested file. +

+ +

+ Sorry. :-( +

+ +

Please return to the start page.

+
diff --git a/_articles/2015-02-12-hacking-irssi.org.markdown b/_articles/2015-02-12-hacking-irssi.org.markdown index fe93aef..1e37e73 100644 --- a/_articles/2015-02-12-hacking-irssi.org.markdown +++ b/_articles/2015-02-12-hacking-irssi.org.markdown @@ -38,4 +38,6 @@ Notes -All urls should be prefixed with `{{ "{{" }} site.baseurl {{ }} }}`. +{% raw %} +All urls should be prefixed with `{{ site.baseurl }}`. +{% endraw %} diff --git a/_data/sb_whatsnew.yml b/_data/sb_whatsnew.yml new file mode 100644 index 0000000..d8aca34 --- /dev/null +++ b/_data/sb_whatsnew.yml @@ -0,0 +1,15 @@ +- + key: fuzzing-irssi + title: Introduction to fuzzing Irssi +- + key: test-sideways-splits + tag: Test + title: horizontal/vertical splits +- + key: poll-non-utf8-discontinuation + tag: Poll + title: Non-UTF-8 discontinuation +- + key: irssi-1.0.2-released + tag: Security + diff --git a/_includes/head.html b/_includes/head.html index 72c308f..2ec44bf 100644 --- a/_includes/head.html +++ b/_includes/head.html @@ -4,7 +4,6 @@ {% if page.title %}{% unless page.title contains 'Irssi' %}Irssi - {% endunless %}{{ page.title }}{% else %}{{ site.title }}{% endif %} - diff --git a/_includes/sb_sidebar_settings.html b/_includes/sb_sidebar_settings.html index dd3ec52..5f04c92 100644 --- a/_includes/sb_sidebar_settings.html +++ b/_includes/sb_sidebar_settings.html @@ -1,399 +1,87 @@

Quick Nav

- -

-

- -

+{% assign temp = page.content | split: " +" +%}{% for line in temp +%}{% assign header = line | normalize_whitespace | truncate: 4, "" +%}{% if header == "## [" +%}{% assign category = line | normalize_whitespace | replace: "## [" | replace: "]" +%}{% assign all_categories = all_categories | append: " " | append: category +%}{% endif +%}{% endfor +%}{% assign all_categories = all_categories | split: " " | sort | join: " " | prepend: "ALL " | split: " " +%}{% for cat in all_categories +%} + {% if cat == "ALL" %}

{% endif %} +{% endfor +%}

{% comment %} + + + + + + + +{% endcomment %}

Appendices

- A: Levels -
- B: Special Variables and Expandos -
- C: Time Formats -
- D: Color Codes -
- E: Credits and copyright +{% comment %} + + + + + + + +{% endcomment +%}{% assign is_next = 0 +%}{% assign app_title = +%}{% for line in temp +%}{% assign is_app = line | normalize_whitespace | truncate: 12, "" +%}{% assign is_anchor = line | normalize_whitespace | truncate: 3, "" +%}{% if is_app == "## Appendix " +%}{% assign app_title = line | normalize_whitespace | replace: "## Appendix " +%}{% elsif is_anchor == "{:#" and app_title +%}{% assign anchor = line | normalize_whitespace | replace: "{:#" | replace: "}" +%}{% if is_next == 1 %}
{% else %}{% assign is_next = 1 %}{% endif %} + {{ app_title }} +{% else +%}{% assign app_title = +%}{% assign anchor = +%}{% endif +%}{% endfor %}

diff --git a/_includes/sb_whatsnew.html b/_includes/sb_whatsnew.html index b09ad75..ea74fc5 100644 --- a/_includes/sb_whatsnew.html +++ b/_includes/sb_whatsnew.html @@ -1,4 +1,19 @@ -

2017-05-12 Introduction to fuzzing Irssi

-

2017-05-06 Test horizontal/vertical splits

-

2017-03-12 Poll Non-UTF-8 discontinuation

-

2017-03-11 Security Irssi 1.0.2 released!

+{% comment %} + +Edit /_data/sb_whatsnew.yml to generate the content of this sidebar + +{% endcomment +%}{% for new in site.data.sb_whatsnew +%}{% assign found = 0 +%}{% for post in site.posts +%}{% if post.slug == new.key +%} +

{{ post.date | date: "%Y-%m-%d" }} {% if new.tag %}{{ new.tag }} {% endif %}{% if new.title %}{{ new.title }}{% else %}{{ post.title }}{% endif %}

{% assign found = 1 %}{% break +%}{% endif +%}{% endfor +%}{% if found == 0 +%} +

#error# {{ new.key }} not found

{% + endif +%}{% endfor +%} diff --git a/_layouts/default.html b/_layouts/default.html index cc2c463..86e9d2d 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -11,7 +11,7 @@
{{ content }}
-
+

{% include {{page.sidebar}} %}
diff --git a/assets/css/style.css b/assets/css/style.css index 951e83e..71f80a1 100644 --- a/assets/css/style.css +++ b/assets/css/style.css @@ -70,6 +70,7 @@ p.center { position: inherit; } #___gcse_0:before { display: inline; } +#___gcse_0 div.gsc-adBlock { display: none ! important; } /* This is for mobile devices and the size of the youtube video */ iframe { @@ -196,6 +197,16 @@ blockquote { height: 80vh !important; } +.sticken { + position: sticky; + top: 50px; + height: calc(100vh - 50px); +} + +.page > .sticken { + overflow-y: auto; +} + /* news archive */ .container.home h3, .container.home .h3 { -- cgit v1.2.3