update post pages and add fossil export post edit post layout to handle tags, add sort-by-tag page and edit stylesheet according post content updates
la-ninpre leobrekalini@gmail.com
Mon, 07 Dec 2020 02:51:58 +0300
11 files changed,
161 insertions(+),
23 deletions(-)
M
_config.yml
→
_config.yml
@@ -6,7 +6,13 @@ - LICENSE
- README.md defaults: - - scope: + - + scope: path: "" values: layout: "default" + - + scope: + path: "_posts" + values: + layout: "post"
M
_layouts/post.html
→
_layouts/post.html
@@ -2,11 +2,20 @@ ---
layout: default --- -<div class="post"> -<h1>{{ page.title }}</h1> -<hr> -<i>{{ page.date | date: "%Y-%m-%d %H:%M" }}</i> - +<div class="post-page"> + <div class="post-header"> + <h1>{{ page.title }}</h1> + <ul> + <li>{{ page.date | date: "%F" }}</li> + {% if page.tags.size > 0 %} + <li> | </li> + <li>tags:</li> + {% for tag in page.tags %} + <li><a href="/tags/{{ tag }}">{{ tag }}</a></li> + {% endfor %} + {% endif %} + </ul> + <hr> + </div> {{ content }} - </div>
D
_posts/2020-11-12-example.md
@@ -1,11 +0,0 @@
---- -title: example post -date: 2020-11-12T02:11:45+03:00 -layout: post ---- - -this is an example post. - -i have plans on moving my posts from telegram channel here, -so they are not restricted. but the script to automate this -process is work in progress yet.
A
_posts/2020-12-06-fossil-to-git.md
@@ -0,0 +1,51 @@
+--- +title: fossil export to git +author: la-ninpre +tags: [fossil, git, tutorial] +--- + +i was trying to export my website repo to fossil using suggested method from +[fossil website][1]: + +``` +git fast-export --all | fossil import --git repo.fossil +``` +[1]:https://www.fossil-scm.org/home/doc/trunk/www/inout.wiki + +but i didn't like that fossil recognizes my email as username and so commit +messages user was `user@example.com` instead of `user`. + +i then read a bit about options of `git fast-export` and found `--anonymize` +flag. but it's results weren't satisfying either. + +when i looked on a raw output of `git fast-export`, i noticed that commit author +is specified there as + +``` +author user <user@example.com> +``` + +and then it's flashed in my head: why not pipe git export through sed and just +replace the contents of `<>` with username instead of email. + +so the final command looks like this: + +``` +git fast-export --all | \ + sed -E 's/^((author)|(committer))[[:blank:]]+([[:graph:]]+)[[:blank:]]+(<[[:alnum:]]+@[[:alnum:]]+\.[[:alnum:]]+>)/\1 \4 <\4>/' | \ + fossil import --git repo.fossil +``` + +and it converts + +``` +author user <user@example.com> +``` + +to + +``` +author user <user> +``` + +which is odd, but fine for fossil import.
M
_sass/main.scss
→
_sass/main.scss
@@ -5,6 +5,7 @@ $color-dark-blue: #2e4054;
$color-main-grey: #e1e1e1; $color-main-grey-dark: #c4c4c4; $color-dark-grey: #1f1f1f; +$color-darker-grey: #101010; $color-link-idle: #707070; $color-link-hover: #999999; $color-nav-current: #333333;@@ -67,11 +68,14 @@
.post { padding: 1em; margin: 1em 0; - background: $color-main-grey; + //background: $color-main-grey; border-radius: 25px 25px 25px 0px; + border: 1px solid $color-main-grey; word-wrap: break-word; + small p { + display: inline; + } p { - margin-top: 0.15em; img { display: block; max-width: 100%;@@ -81,6 +85,25 @@ }
} } +.post-page .post-header { + ul { + margin: 0; + padding: 0; + display: flex; + flex-direction: row; + list-style-type: none; + li { + margin-right: 0.5em; + a { + background: $color-main-grey; + border-radius: 5px; + padding: 2px; + } + } + } +} + + blockquote { margin: 0.5em; padding: 1em;@@ -93,6 +116,18 @@ }
code { font-family: $code-font; + font-size: 0.9em; + &.language-plaintext.highlighter-rouge { + background: $color-darker-grey; + padding: 2px; + border-radius: 5px; + } +} +div.language-plaintext.highlighter-rouge { + overflow-x: auto; + background: $color-main-grey; + padding-left: 0.5em; + border-radius: 5px; } audio {@@ -101,6 +136,7 @@ border-radius: 25px;
} footer { + padding-top: 0.5em; border-top: $border-nav; text-align: center; font: 75% $body-font;@@ -138,9 +174,20 @@ ul {
border-bottom: $border-dark; } } + code.language-plaintext { + background: $color-darker-grey; + } + div.language-plaintext.highlighter-rouge { + background: $color-darker-grey; + } .post { + //background: $color-dark-grey; + border: 1px solid $color-dark-grey; + } + .post-page .post-header ul li a { background: $color-dark-grey; } + footer { border-top: $border-dark; }
M
other.md
→
other.md
@@ -10,8 +10,17 @@
<div class="posts"> {% for post in site.posts %} <div class="post"> + <h2><a href="{{ post.url}}">{{ post.title }}</a></h2> + <small> + <p>{{ post.date | date_to_string }}</p> + {% if post.tags.size > 0 %} + <p>| tags: </p> + {% for tag in post.tags %} + <a href="/tags/{{ tag }}">{{ tag }}</a> + {% endfor %} + {% endif %} + </small> {{ post.content }} - <a href="{{ post.url }}">{{ post.date | date_to_string }}</a> </div> {% endfor %} </div>