stylize blog posts

This commit is contained in:
Horhik 2021-01-24 18:14:34 +02:00
parent ab88052a92
commit ca58ae786e
8 changed files with 122 additions and 4 deletions

View file

@ -37,6 +37,9 @@ a, .link{
font-size: 2em; font-size: 2em;
} }
code{
font-family: $main-font;
}
@import "logo"; @import "logo";
@import "elements/page-links"; @import "elements/page-links";
@ -44,3 +47,4 @@ a, .link{
@import "elements/contacts"; @import "elements/contacts";
@import "elements/portfolio-project"; @import "elements/portfolio-project";
@import "elements/blog-post-preview"; @import "elements/blog-post-preview";
@import "elements/blog-post";

View file

@ -0,0 +1,23 @@
.blog-header{
color: $header-color;
font-family: $main-font;
font-size: 2em;
display: inline-flex;
justify-content: center;
text-align:center;
margin: 0 auto;
}
.blog-post{
time{
font-family: $main-font;
display: flex;
align-content: center;
justify-content: center;
font-size: 0.9em;
}
padding: 0px 30px;
font-size: 22px;
font-family: Ubuntu;
}

View file

@ -2,3 +2,17 @@ baseURL = "https://site.horhik.xyz/"
languageCode = "en-us" languageCode = "en-us"
title = "Horhik.xyz" title = "Horhik.xyz"
summaryLength=10 summaryLength=10
[markup]
[markup.highlight]
anchorLineNos = false
codeFences = true
guessSyntax = true
hl_Lines = ""
lineAnchors = ""
lineNoStart = 1
lineNos = true
lineNumbersInTable = true
noClasses = true
style = "dracula"
tabWidth = 2

View file

@ -0,0 +1,52 @@
---
title: "PyAutoGUI for simplifying anki routine"
date: 2021-01-21T10:26:19+03:00
---
I had been adding some cards to Anki.
It was lowercase word and word with stress in russian. like *торты тОрты.*
I'm lazy and i wrote two simple scripts. All what i have to do is input words with stress into a file.
First script for creating file with list of sequence of word with stress and lowercase word
```python
import os
f = open("/home/horhik/text.txt", 'r+')
lines = f.readlines()
for ind, line in enumerate(lines):
print(line.lower(), " ", line)
```
After, i just pushed output to file and opened it it Emacs.
Second script automatizing adding cards to A**nki**.
I split my window by **Anki** "add card" window and **Emacs**. As i use `evil` mode in Emacs, script looks like that:
```python
import pyautogui
import os
while(True):
pyautogui.hotkey("winleft", 'j') # toggle window
pyautogui.press(["v", "$", "y"]) # copy string
pyautogui.hotkey("winleft", 'j') # toggle window
pyautogui.hotkey("ctrl", 'v') # past text
pyautogui.press("tab") # next input field
pyautogui.hotkey("winleft", 'j') # toggle window
pyautogui.press(["j","0", "w", "v" , "$", "y", "0", "j", "j" ])
# move to next line beginning, copy it and go to next occurence
pyautogui.hotkey("winleft", 'j') # toggle window
pyautogui.hotkey("ctrl", 'v') # paste text
pyautogui.press("tab") # ...
pyautogui.press("tab") # ...
pyautogui.press("tab") # ...
pyautogui.press("tab") # ... way to submit button
pyautogui.press("space") # pressing submit button
```
`while true` was my mistake. I launched script in terminal, with `sleep` 3 seconds before.
But i couldn't shut script down without any strange effect when i opening not only 2 windows in my Window Manager.
Some strange things happen before I cached terminal and pressed `Ctrl+C`

View file

@ -12,6 +12,8 @@
{{ with .Site.Params.description }}<meta name="description" content="{{ . }}">{{ end }} {{ with .Site.Params.description }}<meta name="description" content="{{ . }}">{{ end }}
{{ with .Site.Params.author }}<meta name="author" content="{{ . }}">{{ end }} {{ with .Site.Params.author }}<meta name="author" content="{{ . }}">{{ end }}
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Ubuntu:ital,wght@0,400;0,500;0,700;1,300&display=swap" rel="stylesheet">
<link rel="stylesheet" href="{{ $style.Permalink }}"> <link rel="stylesheet" href="{{ $style.Permalink }}">
{{ with .OutputFormats.Get "RSS" -}} {{ with .OutputFormats.Get "RSS" -}}

View file

@ -1,8 +1,8 @@
{{ define "main" }} {{ define "main" }}
<main> <main>
<article> <article class="blog-post">
<h1>{{ .Title }}</h1> <h1 class="blog-header">{{ .Title }}</h1>
<time>{{ .Date.Format "02.01.2006 15:04" }}</time> <sub><small><time>{{ .Date.Format "02.01.2006 15:04" }}</time></small></sub>
<div> <div>
{{ .Content }} {{ .Content }}
</div> </div>
@ -22,5 +22,4 @@
{{ end }} {{ end }}
</article> </article>
</main> </main>
{{ partial "sidebar.html" . }}
{{ end }} {{ end }}

View file

@ -54,6 +54,9 @@ a, .link {
font-family: 'Mononoki Bold', 'Fira Code SemiBold'; font-family: 'Mononoki Bold', 'Fira Code SemiBold';
font-size: 2em; } font-size: 2em; }
code {
font-family: "Mononoki", monospace; }
.logo--wrapper { .logo--wrapper {
display: grid; display: grid;
font-family: Mononoki, 'Fira Code',monospace, Ubuntu; } font-family: Mononoki, 'Fira Code',monospace, Ubuntu; }
@ -289,3 +292,23 @@ a, .link {
.blog-info__item--reading-time::before { .blog-info__item--reading-time::before {
content: url("../../svg/stopwatch.svg"); content: url("../../svg/stopwatch.svg");
margin-right: 10px; } margin-right: 10px; }
.blog-header {
color: var(--green);
font-family: "Mononoki", monospace;
font-size: 2em;
display: inline-flex;
justify-content: center;
text-align: center;
margin: 0 auto; }
.blog-post {
padding: 0px 30px;
font-size: 22px;
font-family: Ubuntu; }
.blog-post time {
font-family: "Mononoki", monospace;
display: flex;
align-content: center;
justify-content: center;
font-size: 0.9em; }

1
themes/gruvboxed Submodule

@ -0,0 +1 @@
Subproject commit f4735db2aec9803f6b0587d8dd78f44d5acbbd6e