diff options
| author | la-ninpre <leobrekalini@gmail.com> | 2020-12-07 02:51:58 +0300 |
|---|---|---|
| committer | la-ninpre <leobrekalini@gmail.com> | 2020-12-07 02:51:58 +0300 |
| commit | c34a1404a2ceb018834ff092fe3c87dd664c515d (patch) | |
| tree | 6ef5080766e937ad8d5a108e6f06b73d4dbf9a9d | |
| parent | f51ad63fd743e228ed6819a055d0b05ec0d2cab5 (diff) | |
| download | aaoth.xyz-c34a1404a2ceb018834ff092fe3c87dd664c515d.tar.gz aaoth.xyz-c34a1404a2ceb018834ff092fe3c87dd664c515d.zip | |
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
| -rw-r--r-- | _config.yml | 8 | ||||
| -rw-r--r-- | _includes/footer.html | 4 | ||||
| -rw-r--r-- | _layouts/post.html | 21 | ||||
| -rw-r--r-- | _layouts/tagsort.html | 12 | ||||
| -rw-r--r-- | _posts/2020-11-12-example.md | 11 | ||||
| -rw-r--r-- | _posts/2020-12-06-fossil-to-git.md | 51 | ||||
| -rw-r--r-- | _sass/main.scss | 51 | ||||
| -rw-r--r-- | other.md | 11 | ||||
| -rw-r--r-- | tags/fossil.md | 5 | ||||
| -rw-r--r-- | tags/git.md | 5 | ||||
| -rw-r--r-- | tags/tutorial.md | 5 |
11 files changed, 161 insertions, 23 deletions
diff --git a/_config.yml b/_config.yml index 7d89b26..a9692bb 100644 --- a/_config.yml +++ b/_config.yml @@ -6,7 +6,13 @@ exclude: - README.md defaults: - - scope: + - + scope: path: "" values: layout: "default" + - + scope: + path: "_posts" + values: + layout: "post" diff --git a/_includes/footer.html b/_includes/footer.html index 6172487..a44e767 100644 --- a/_includes/footer.html +++ b/_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> diff --git a/_layouts/post.html b/_layouts/post.html index e94ff43..30029a8 100644 --- a/_layouts/post.html +++ b/_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> diff --git a/_layouts/tagsort.html b/_layouts/tagsort.html new file mode 100644 index 0000000..f9cd008 --- /dev/null +++ b/_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> diff --git a/_posts/2020-11-12-example.md b/_posts/2020-11-12-example.md deleted file mode 100644 index ddc3c32..0000000 --- a/_posts/2020-11-12-example.md +++ /dev/null @@ -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. diff --git a/_posts/2020-12-06-fossil-to-git.md b/_posts/2020-12-06-fossil-to-git.md new file mode 100644 index 0000000..c32e2da --- /dev/null +++ b/_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. diff --git a/_sass/main.scss b/_sass/main.scss index 742a11e..fa32ab0 100644 --- a/_sass/main.scss +++ b/_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 @@ h1, h2, h3, h4, h5, h6 { .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 @@ h1, h2, h3, h4, h5, h6 { } } +.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 @@ blockquote { 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 @@ audio { } footer { + padding-top: 0.5em; border-top: $border-nav; text-align: center; font: 75% $body-font; @@ -138,9 +174,20 @@ footer { 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; } @@ -10,8 +10,17 @@ here will be some misc stuff <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> diff --git a/tags/fossil.md b/tags/fossil.md new file mode 100644 index 0000000..f99a714 --- /dev/null +++ b/tags/fossil.md @@ -0,0 +1,5 @@ +--- +layout: tagsort +tag: fossil +permalink: /tags/fossil/ +--- diff --git a/tags/git.md b/tags/git.md new file mode 100644 index 0000000..b493264 --- /dev/null +++ b/tags/git.md @@ -0,0 +1,5 @@ +--- +layout: tagsort +tag: git +permalink: /tags/git/ +--- diff --git a/tags/tutorial.md b/tags/tutorial.md new file mode 100644 index 0000000..23fa884 --- /dev/null +++ b/tags/tutorial.md @@ -0,0 +1,5 @@ +--- +layout: tagsort +tag: tutorial +permalink: /tags/tutorial/ +--- |
