all repos — aaoth.xyz @ c34a1404a2ceb018834ff092fe3c87dd664c515d

aaoth.xyz website

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
commit

c34a1404a2ceb018834ff092fe3c87dd664c515d

parent

f51ad63fd743e228ed6819a055d0b05ec0d2cab5

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 _includes/footer.html_includes/footer.html

@@ -1,8 +1,8 @@

<footer> <p> - this work is licensed under a + licensed under <a href="http://creativecommons.org/licenses/by-sa/4.0/"> - creative commons attribution-sharealike 4.0 international license + cc-by-sa-4.0 </a> </p> <p>
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>
A _layouts/tagsort.html

@@ -0,0 +1,12 @@

+--- +layout: default +--- + +<h1>{{ page.tag }}</h1> + +<ul> + {% for post in site.tags[page.tag] %} + <li>{{ post.date | date: "%F" }}: <a href="{{ post.url }}"> {{ post.title }}</a> + </li> + {% endfor %} +</ul>
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.mdother.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>
A tags/fossil.md

@@ -0,0 +1,5 @@

+--- +layout: tagsort +tag: fossil +permalink: /tags/fossil/ +---
A tags/git.md

@@ -0,0 +1,5 @@

+--- +layout: tagsort +tag: git +permalink: /tags/git/ +---
A tags/tutorial.md

@@ -0,0 +1,5 @@

+--- +layout: tagsort +tag: tutorial +permalink: /tags/tutorial/ +---