stylize blog posts
This commit is contained in:
parent
ab88052a92
commit
ca58ae786e
|
@ -37,6 +37,9 @@ a, .link{
|
|||
font-size: 2em;
|
||||
}
|
||||
|
||||
code{
|
||||
font-family: $main-font;
|
||||
}
|
||||
|
||||
@import "logo";
|
||||
@import "elements/page-links";
|
||||
|
@ -44,3 +47,4 @@ a, .link{
|
|||
@import "elements/contacts";
|
||||
@import "elements/portfolio-project";
|
||||
@import "elements/blog-post-preview";
|
||||
@import "elements/blog-post";
|
||||
|
|
23
assets/css/elements/blog-post.scss
Normal file
23
assets/css/elements/blog-post.scss
Normal 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;
|
||||
}
|
14
config.toml
14
config.toml
|
@ -2,3 +2,17 @@ baseURL = "https://site.horhik.xyz/"
|
|||
languageCode = "en-us"
|
||||
title = "Horhik.xyz"
|
||||
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
|
||||
|
|
52
content/posts/PyAutoGUI for simplifying anki routine.md
Normal file
52
content/posts/PyAutoGUI for simplifying anki routine.md
Normal 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`
|
|
@ -12,6 +12,8 @@
|
|||
|
||||
{{ with .Site.Params.description }}<meta name="description" 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 }}">
|
||||
|
||||
{{ with .OutputFormats.Get "RSS" -}}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
{{ define "main" }}
|
||||
<main>
|
||||
<article>
|
||||
<h1>{{ .Title }}</h1>
|
||||
<time>{{ .Date.Format "02.01.2006 15:04" }}</time>
|
||||
<article class="blog-post">
|
||||
<h1 class="blog-header">{{ .Title }}</h1>
|
||||
<sub><small><time>{{ .Date.Format "02.01.2006 15:04" }}</time></small></sub>
|
||||
<div>
|
||||
{{ .Content }}
|
||||
</div>
|
||||
|
@ -22,5 +22,4 @@
|
|||
{{ end }}
|
||||
</article>
|
||||
</main>
|
||||
{{ partial "sidebar.html" . }}
|
||||
{{ end }}
|
||||
|
|
|
@ -54,6 +54,9 @@ a, .link {
|
|||
font-family: 'Mononoki Bold', 'Fira Code SemiBold';
|
||||
font-size: 2em; }
|
||||
|
||||
code {
|
||||
font-family: "Mononoki", monospace; }
|
||||
|
||||
.logo--wrapper {
|
||||
display: grid;
|
||||
font-family: Mononoki, 'Fira Code',monospace, Ubuntu; }
|
||||
|
@ -289,3 +292,23 @@ a, .link {
|
|||
.blog-info__item--reading-time::before {
|
||||
content: url("../../svg/stopwatch.svg");
|
||||
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
1
themes/gruvboxed
Submodule
|
@ -0,0 +1 @@
|
|||
Subproject commit f4735db2aec9803f6b0587d8dd78f44d5acbbd6e
|
Loading…
Reference in a new issue