diff options
-rw-r--r-- | _config.yml | 2 | ||||
-rw-r--r-- | _includes/posts.html | 6 | ||||
-rw-r--r-- | _layouts/default.html | 11 | ||||
-rw-r--r-- | _plugins/filters.rb | 11 | ||||
-rw-r--r-- | _sass/code.scss | 10 | ||||
-rw-r--r-- | _sass/media.scss | 5 | ||||
-rw-r--r-- | _sass/theme.scss | 7 | ||||
-rw-r--r-- | index.md | 6 |
8 files changed, 39 insertions, 19 deletions
diff --git a/_config.yml b/_config.yml index f2546ec..6d8c836 100644 --- a/_config.yml +++ b/_config.yml @@ -6,7 +6,7 @@ exclude: - readme.md collections: items: - permalink: /post/:title/ + permalink: /post/:title output: true defaults: - scope: diff --git a/_includes/posts.html b/_includes/posts.html index 692e6ad..5385d1f 100644 --- a/_includes/posts.html +++ b/_includes/posts.html @@ -1,9 +1,9 @@ <table class="plainlink" width="100%"> <tr> - <th><a href="by-date.html" class="{% if include.sort == "date" %}sortcolumn{% endif %}">date</a></th> - <th><a href="by-title.html" class="{% if include.sort == "title" %}sortcolumn{% endif %}">title</a></th> + <th><a href="by-date" class="{% if include.sort == "date" %}sortcolumn{% endif %}">date</a></th> + <th><a href="by-title" class="{% if include.sort == "title" %}sortcolumn{% endif %}">title</a></th> </tr> - {% assign posts = site.items | sort: include.sort %} + {% assign posts = site.items | post_sort: include.sort %} {% for post in posts %} <tr> <td>{{ post.date | datefmt }}</td> diff --git a/_layouts/default.html b/_layouts/default.html index fe0fc36..a0f06cb 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -22,7 +22,7 @@ <nav class="invert plainlink"> <div class="limitwidth"> <a href="/" class="item {% if page.id == "index" %}active{% endif %}">home</a> - <a href="/posts" class="item {% if page.id == "posts" %}active{% endif %}">posts</a> + <a href="/posts/by-date" class="item {% if page.id == "posts" %}active{% endif %}">posts</a> <span class="right"> {% if page.toc %}<a href="#" class="item">top</a>{% endif %} {% if page.post %}<a href="#footer" class="item">bottom</a>{% endif %} @@ -38,14 +38,12 @@ <div class="limitwidth"> <div class="autocolumn"> <div class="column"> - <span class="title">about this post</span> + <span class="title">post info</span> <ul> + <li>last published on {{ page.meta.date | datefmt }}</li> <li>written by {{ page.authors | map: 'nick' | sentence_join }}</li> - <li>published on {{ page.meta.date | datefmt }}</li> - </ul> - <ul> - <li>edited {{ page.meta.edits }} times</li> <li>first published on {{ page.meta.date_initial | datefmt }}</li> + <li>edited {{ page.meta.edits | plural: 'time' }}</li> </ul> </div> <div class="column"> @@ -61,3 +59,4 @@ {% endif %} </body> </html> + diff --git a/_plugins/filters.rb b/_plugins/filters.rb index 2526573..9e9b026 100644 --- a/_plugins/filters.rb +++ b/_plugins/filters.rb @@ -8,6 +8,17 @@ module Filters return "#{items[0]}" if items.length == 1 return "#{items[0..-2].join(", ")} and #{items[-1]}" end + + def plural(num, counter) + return "#{num} #{counter}#{counter == 1 ? '' : 's'}" + end + + def post_sort(posts, sort_by) + # date (reverse chronological) + return posts.sort_by{ |post| -post.date.to_i } if sort_by == "date" + # title (case insensitive) + return posts.sort_by{ |post| post.title.downcase } if sort_by == "title" + end end Liquid::Template.register_filter(Filters) diff --git a/_sass/code.scss b/_sass/code.scss index abec864..cc27a5e 100644 --- a/_sass/code.scss +++ b/_sass/code.scss @@ -10,8 +10,6 @@ pre.highlight { %token_comment { font-style: italic; } %token_keyword { font-weight: 700; } -%token_comment { opacity: .7; } -%token_operator { opacity: .8; } %token_comment { color: var(--code-comment); } %token_keyword { color: var(--code-keyword); } @@ -19,3 +17,11 @@ pre.highlight { %token_number { color: var(--code-number); } %token_operator { color: var(--code-operator); } +:root { + --code-comment: #556885; + --code-keyword: #a72076; + --code-string: #755a1c; + --code-number: #c94f29; + --code-operator: #6327c1; +} + diff --git a/_sass/media.scss b/_sass/media.scss index 2b4fc8b..e7b4aee 100644 --- a/_sass/media.scss +++ b/_sass/media.scss @@ -19,9 +19,10 @@ background-color: #222; color: inherit; } + nav .item.active { - color: inherit; - background-color: black; + color: inherit !important; + background-color: black !important; text-decoration: underline; font-weight: bold; } diff --git a/_sass/theme.scss b/_sass/theme.scss index d599fc4..82e54d6 100644 --- a/_sass/theme.scss +++ b/_sass/theme.scss @@ -28,9 +28,10 @@ blockquote::before { background-color: black; color: white; } -nav a.active { - color: canvastext; - background-color: canvas; + +nav .item.active { + color: canvastext !important; + background-color: canvas !important; } // only show underline when hovering link @@ -6,8 +6,10 @@ toc: false post: false --- -Welcome to my blog! If I ever feel like writing something there's a good chance -it'll be posted here. As common with programmers, I have a serious +Welcome to my blog! + +If I ever feel like writing something there's a good chance it'll be posted +here. As common with programmers, I have a serious [bikeshedding](https://en.wiktionary.org/wiki/bikeshedding) problem, so beware of any outdated posts or references to unfinished projects. |