mirror of
https://git.ari.lt/ari.lt/blog.ari.lt.git
synced 2025-02-04 09:39:25 +01:00
update @ Sat 12 Mar 21:56:41 EET 2022
Signed-off-by: Ari Archer <ari.web.xyz@gmail.com>
This commit is contained in:
parent
17d1491976
commit
c21c900517
1 changed files with 6 additions and 4 deletions
10
scripts/blog
10
scripts/blog
|
@ -61,7 +61,7 @@ DEFAULT_CONFIG_FILE: str = "blog.json"
|
||||||
HISTORY_FILE: str = ".blog_history"
|
HISTORY_FILE: str = ".blog_history"
|
||||||
BLOG_VERSION: int = 1
|
BLOG_VERSION: int = 1
|
||||||
|
|
||||||
BLOG_MARKDOWN_TEMPLATE = """# %s
|
BLOG_MARKDOWN_TEMPLATEL: str = """# %s
|
||||||
|
|
||||||
<div class="info-bar" aria-hidden="true">
|
<div class="info-bar" aria-hidden="true">
|
||||||
%s | <a href="%s">back</a> | <a href="/">home</a> | <a href="%s">git</a>
|
%s | <a href="%s">back</a> | <a href="/">home</a> | <a href="%s">git</a>
|
||||||
|
@ -71,7 +71,7 @@ BLOG_MARKDOWN_TEMPLATE = """# %s
|
||||||
|
|
||||||
%s"""
|
%s"""
|
||||||
|
|
||||||
HTML_HEADER = """<head>
|
HTML_HEADER: str = """<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
@ -86,7 +86,7 @@ HTML_HEADER = """<head>
|
||||||
|
|
||||||
<link rel="stylesheet" href="/content/styles.min.css"/>"""
|
<link rel="stylesheet" href="/content/styles.min.css"/>"""
|
||||||
|
|
||||||
BLOG_HTML_TEMPLATE = f"""<!DOCTYPE html>
|
BLOG_HTML_TEMPLATE: str = f"""<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
{HTML_HEADER}
|
{HTML_HEADER}
|
||||||
<meta name="description" content="{{blog_description}}">
|
<meta name="description" content="{{blog_description}}">
|
||||||
|
@ -98,7 +98,7 @@ BLOG_HTML_TEMPLATE = f"""<!DOCTYPE html>
|
||||||
</body>
|
</body>
|
||||||
</html>"""
|
</html>"""
|
||||||
|
|
||||||
HOME_PAGE_HTML_TEMPLATE = f"""<!DOCTYPE html>
|
HOME_PAGE_HTML_TEMPLATE: str = f"""<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
{HTML_HEADER}
|
{HTML_HEADER}
|
||||||
<meta name="description" content="{{home_page_description}}" />
|
<meta name="description" content="{{home_page_description}}" />
|
||||||
|
@ -215,6 +215,8 @@ def new_blog(config: Dict) -> Tuple[int, Dict]:
|
||||||
with open(file, "r") as md:
|
with open(file, "r") as md:
|
||||||
blog["content"] = b64encode(md.read().encode()).decode()
|
blog["content"] = b64encode(md.read().encode()).decode()
|
||||||
|
|
||||||
|
os.remove(file)
|
||||||
|
|
||||||
if not blog["content"].strip(): # type: ignore
|
if not blog["content"].strip(): # type: ignore
|
||||||
return log("Blog cannot be empty"), config
|
return log("Blog cannot be empty"), config
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue