From 15c05dbb86fe3d98ec6e6ebe7743fd85b860dcc6 Mon Sep 17 00:00:00 2001 From: NeodarZ Date: Mon, 1 May 2017 22:36:52 +0200 Subject: Add some test --- index-example.html | 6 +- pyblog | 74 +++-- source/css/theme.css | 69 ++++- source/fonts/3d.flf | 818 +++++++++++++++++++++++++++++++++++++++++++++++++++ source/index.md | 2 +- source/template.html | 36 ++- 6 files changed, 959 insertions(+), 46 deletions(-) create mode 100644 source/fonts/3d.flf diff --git a/index-example.html b/index-example.html index 4f732835..e8d5f6f0 100644 --- a/index-example.html +++ b/index-example.html @@ -188,7 +188,11 @@ wget http://snesmusic.org/hoot/kingshriek/$file done - + + + + + diff --git a/pyblog b/pyblog index efd7711b..8d7fc377 100755 --- a/pyblog +++ b/pyblog @@ -37,6 +37,8 @@ import dateutil.parser import dateutil.tz import lxml.etree as ET +from pyfiglet import Figlet + ############################# BLOG CONFIGURATIONS ############################## # Safe to customize BLOG_HOME = "http://neodarz.net/" @@ -598,34 +600,56 @@ def generate_sitemap(feed): ET.tostring(sitemap).decode('utf-8')) sys.stderr.write("wrote sitemap.xml\n") -def overide_title(): +def rewrite_title(): """Override the title of some page for a better render""" sys.stderr.write("Overriding some titles\n") - filenames =['build/index.html', - 'build/blog/index.html', - 'build/notes/index.html'] - - for root, dirs, files in os.walk(BUILDDIR): - for name in files: - if re.search(r'website($)',root): - if name.endswith(".html"): - try: - filenames.append("build"+os.path.join(root.split(BUILDDIR)[1], name)) - except IndexError: - filenames.append(name) + try: + f = Figlet(font='3d') + + filenames =['build/index.html', + 'build/blog/index.html', + 'build/notes/index.html'] + + for root, dirs, files in os.walk(BUILDDIR): + for name in files: + if re.search(r'website($)',root): + if name.endswith(".html"): + try: + filenames.append("build"+os.path.join(root.split(BUILDDIR)[1], name)) + except IndexError: + filenames.append(name) + if re.search(r'notes($)',root): + if name.endswith(".html"): + try: + filenames.append("build"+os.path.join(root.split(BUILDDIR)[1], name)) + except IndexError: + filenames.append(name) + if re.search(r'blog($)',root): + if name.endswith(".html"): + try: + filenames.append("build"+os.path.join(root.split(BUILDDIR)[1], name)) + except IndexError: + filenames.append(name) - fd, tmppath = tempfile.mkstemp() - os.close(fd) - for filename in filenames: - print (filename) - with open(tmppath, 'w', encoding='utf-8') as tmpfile: - if os.path.exists(filename): - with open(filename, 'r', encoding='utf-8') as indexmd: - lines = indexmd.readlines() - with open(filename, 'w', encoding='utf-8') as indexmd: - for line in lines: - indexmd.write(re.sub(r'\

(.+?)\<\/h1\>', "

Why is there always a cat on whatever you're editing?

", line)) + fd, tmppath = tempfile.mkstemp() + os.close(fd) + for filename in filenames: + print (filename) + soup = bs4.BeautifulSoup(open(filename), "lxml") + with open(tmppath, 'w', encoding='utf-8') as tmpfile: + if os.path.exists(filename): + with open(filename, 'r', encoding='utf-8') as indexmd: + lines = indexmd.readlines() + with open(filename, 'w', encoding='utf-8') as indexmd: + for line in lines: + indexmd.write(re.sub(r'\
\(.+?)\<\/code\>\<\/pre\>', '
'+f.renderText('Miou')+'(^._.^)ノ
', line)) + + except Exception: + sys.stderr.write("=== /!\ ERROR /!\ ===\n") + sys.stderr.write("You don't have install the 3d.flf font ! Type this command the following command:\n") + sys.stderr.write("sudo cp source/fonts/3d.flf /usr/lib/python3.6/site-packages/pyfiglet/fonts\n\n") + sys.exit(0) def absolutify_links(soup, baseurl): @@ -784,7 +808,7 @@ def generate_index_and_feed(): generate_menu() generate_blog_list(feed) generate_notes_list() - overide_title() + #rewrite_title() feed.updated_datetime = current_datetime() feed.updated = ET.Element("updated") diff --git a/source/css/theme.css b/source/css/theme.css index cd8d977f..e3e2125a 100644 --- a/source/css/theme.css +++ b/source/css/theme.css @@ -15,7 +15,8 @@ /*** Main theme ***/ body { - color: #000; + background-color: #000; + color: #fff; font-family: Times, "Times New Roman", /* Chinese fonts */ "Kaiti SC", /* macOS */ @@ -32,6 +33,12 @@ body { margin: 100px 0; } +.bodya { + border: 1px solid #fff; + margin-left: 20vw; + margin-right: 20vw; +} + @media only screen and (-webkit-min-device-pixel-ratio: 1.25), only screen and ( min-device-pixel-ratio: 1.25), @@ -136,6 +143,11 @@ h1 { font-weight: bold; } +.h1 { + text-align: center; +} + + h2 { text-align: center; font-size: 125%; @@ -150,10 +162,19 @@ h2 { } a { - color: inherit; + color: #fff; word-wrap: break-word; } +a .active { + color: #fff; +} + +p, h2, ul { + padding-left: 10vw; + padding-right: 10vw; +} + code { font-size: 90%; color: #333; @@ -168,10 +189,8 @@ h1 code, h2 code { } pre { - overflow-x: scroll; padding: 1em; - background: #fbfbfb; - border-left: 0.4em solid #ddd; + background: #000; } /* Pandoc wraps pre[class*=sourceCode] in a div tag, so it is necessary to @@ -182,7 +201,7 @@ pre[class*=sourceCode] { pre code { font-size: 85%; - color: #000; + color: #fff; white-space: pre; word-wrap: normal; } @@ -304,6 +323,44 @@ noscript a { font-size: 95%; } +.header { + display: table; + margin: 0 auto; +} + +.code-outer { + margin-left: 1vw; + width: 65%; + margin-left: 10vw; + margin-bottom: 1vw; + border: 1px solid #fff; + overflow: auto; + font-family: monospace; +} + +.left-h1 { + float: left; + font-weight: bold; + font-size: 24.4px; +} + +.right-h1 { + float: right; + margin-right: -1.6%; + font-weight: bold; + font-size: 24.4px; +} + +.title-h1 { + display: inline-block; + font-size: 24.4px; + font-weight: bold; +} + +.footer { + text-align: center; +} + /*** Wide screen ***/ @media screen and (min-width: 1441px) { diff --git a/source/fonts/3d.flf b/source/fonts/3d.flf new file mode 100644 index 00000000..8414f165 --- /dev/null +++ b/source/fonts/3d.flf @@ -0,0 +1,818 @@ +flf2a$ 8 8 20 -1 1 +3d font created by xero +$$@ +$$@ +$$@ +$$@ +$$@ +$$@ +$$@ +$$@@ + ██@ +░██@ +░██@ +░██@ +░██@ +░░ @ + ██@ +░░ @@ + █ █@ +░█ ░█@ +░ ░ @ + @ + @ + @ + @ + @@ + @ + ██ ██ @ + ████████████@ +░░░██░░░░██░ @ + ░██ ░██ @ + ████████████@ +░░░██░░░░██░ @ + ░░ ░░ @@ + █ @ + █████@ +░█░█░ @ +░█████@ +░░░█░█@ + █████@ +░░░█░ @ + ░ @@ + @ + ██ ██ @ +░░ ██ @ + ██ @ + ██ @ + ██ @ + ██ ██ @ +░░ ░░ @@ + ██ @ + █░ █ @ + ░ ██ @ + █░ █ █@ + █ ░ █ @ +░█ ░█ @ +░ ████ █@ + ░░░░ ░ @@ + ██@ +░░█@ + ░ @ + @ + @ + @ + @ + @@ + ██@ + ██ @ + ██ @ +░██ @ +░██ @ +░░██ @ + ░░██@ + ░░ @@ + ██ @ +░░██ @ + ░░██@ + ░██@ + ░██@ + ██ @ + ██ @ +░░ @@ + ██ @ + ██ ░██ ██ @ + ░░██ ░██ ██ @ + ██████████████@ +░░░██░░██░░██░ @ + ██ ░██ ░░██ @ + ░░ ░██ ░░ @ + ░░ @@ + @ + █ @ + ░█ @ + █████████@ + ░░░░░█░░░ @ + ░█ @ + ░ @ + @@ + @ + @ + @ + @ + @ + ██@ +░░█@ + ░ @@ + @ + @ + @ + █████@ +░░░░░ @ + @ + @ + @@ + @ + @ + @ + @ + @ + ██@ +░██@ +░░ @@ + ██@ + ██ @ + ██ @ + ██ @ + ██ @ + ██ @ + ██ @ +░░ @@ + ████ @ + █░░░██@ +░█ █░█@ +░█ █ ░█@ +░██ ░█@ +░█ ░█@ +░ ████ @ + ░░░░ @@ + ██ @ + ███ @ +░░██ @ + ░██ @ + ░██ @ + ░██ @ + ████@ +░░░░ @@ + ████ @ + █░░░ █@ +░ ░█@ + ███ @ + █░░ @ + █ @ +░██████@ +░░░░░░ @@ + ████ @ + █░░░ █@ +░ ░█@ + ███ @ + ░░░ █@ + █ ░█@ +░ ████ @ + ░░░░ @@ + ██ @ + █░█ @ + █ ░█ @ + ██████@ +░░░░░█ @ + ░█ @ + ░█ @ + ░ @@ + ██████@ +░█░░░░ @ +░█████ @ +░░░░░ █@ + ░█@ + █ ░█@ +░ ████ @ + ░░░░ @@ + ████ @ + █░░░ █@ +░█ ░ @ +░█████ @ +░█░░░ █@ +░█ ░█@ +░ ████ @ + ░░░░ @@ + ██████@ +░░░░░░█@ + ░█@ + █ @ + █ @ + █ @ + █ @ + ░ @@ + ████ @ + █░░░ █@ +░█ ░█@ +░ ████ @ + █░░░ █@ +░█ ░█@ +░ ████ @ + ░░░░ @@ + ████ @ + █░░░ █@ +░█ ░█@ +░ ████ @ + ░░░█ @ + █ @ + █ @ + ░ @@ + @ + @ + @ + @ + ██@ +░░ @ + ██@ +░░ @@ + @ + @ + @ + ██@ +░░ @ + ██@ +░░█@ + ░ @@ + ██@ + ██░ @ + ██░ @ + ██░ @ +░░ ██ @ + ░░ ██ @ + ░░ ██@ + ░░ @@ + @ + @ + ██████@ +░░░░░░ @ + ██████@ +░░░░░░ @ + @ + @@ + ██ @ +░░ ██ @ + ░░ ██ @ + ░░ ██@ + ██░ @ + ██░ @ + ██░ @ +░░ @@ + ████ @ + ██░░██@ +░██ ░██@ +░░ ██ @ + ██ @ + ░░ @ + ██ @ + ░░ @@ + ████ @ + █░░░ █@ +░█ ██░█@ +░█░█ ░█@ +░█░ ██ @ +░█ ░░ @ +░ █████@ + ░░░░░ @@ + ██ @ + ████ @ + ██░░██ @ + ██ ░░██ @ + ██████████@ +░██░░░░░░██@ +░██ ░██@ +░░ ░░ @@ + ██████ @ +░█░░░░██ @ +░█ ░██ @ +░██████ @ +░█░░░░ ██@ +░█ ░██@ +░███████ @ +░░░░░░░ @@ + ██████ @ + ██░░░░██@ + ██ ░░ @ +░██ @ +░██ @ +░░██ ██@ + ░░██████ @ + ░░░░░░ @@ + ███████ @ +░██░░░░██ @ +░██ ░██@ +░██ ░██@ +░██ ░██@ +░██ ██ @ +░███████ @ +░░░░░░░ @@ + ████████@ +░██░░░░░ @ +░██ @ +░███████ @ +░██░░░░ @ +░██ @ +░████████@ +░░░░░░░░ @@ + ████████@ +░██░░░░░ @ +░██ @ +░███████ @ +░██░░░░ @ +░██ @ +░██ @ +░░ @@ + ████████ @ + ██░░░░░░██@ + ██ ░░ @ +░██ @ +░██ █████@ +░░██ ░░░░██@ + ░░████████ @ + ░░░░░░░░ @@ + ██ ██@ +░██ ░██@ +░██ ░██@ +░██████████@ +░██░░░░░░██@ +░██ ░██@ +░██ ░██@ +░░ ░░ @@ + ██@ +░██@ +░██@ +░██@ +░██@ +░██@ +░██@ +░░ @@ + ██@ + ░██@ + ░██@ + ░██@ + ░██@ + ██ ░██@ +░░█████ @ + ░░░░░ @@ + ██ ██@ +░██ ██ @ +░██ ██ @ +░████ @ +░██░██ @ +░██░░██ @ +░██ ░░██@ +░░ ░░ @@ + ██ @ +░██ @ +░██ @ +░██ @ +░██ @ +░██ @ +░████████@ +░░░░░░░░ @@ + ████ ████@ +░██░██ ██░██@ +░██░░██ ██ ░██@ +░██ ░░███ ░██@ +░██ ░░█ ░██@ +░██ ░ ░██@ +░██ ░██@ +░░ ░░ @@ + ████ ██@ +░██░██ ░██@ +░██░░██ ░██@ +░██ ░░██ ░██@ +░██ ░░██░██@ +░██ ░░████@ +░██ ░░███@ +░░ ░░░ @@ + ███████ @ + ██░░░░░██ @ + ██ ░░██@ +░██ ░██@ +░██ ░██@ +░░██ ██ @ + ░░███████ @ + ░░░░░░░ @@ + ███████ @ +░██░░░░██@ +░██ ░██@ +░███████ @ +░██░░░░ @ +░██ @ +░██ @ +░░ @@ + ███████ @ + ██░░░░░██ @ + ██ ░░██ @ +░██ ░██ @ +░██ ██░██ @ +░░██ ░░ ██ @ + ░░███████ ██@ + ░░░░░░░ ░░ @@ + ███████ @ +░██░░░░██ @ +░██ ░██ @ +░███████ @ +░██░░░██ @ +░██ ░░██ @ +░██ ░░██@ +░░ ░░ @@ + ████████@ + ██░░░░░░ @ +░██ @ +░█████████@ +░░░░░░░░██@ + ░██@ + ████████ @ +░░░░░░░░ @@ + ██████████@ +░░░░░██░░░ @ + ░██ @ + ░██ @ + ░██ @ + ░██ @ + ░██ @ + ░░ @@ + ██ ██@ +░██ ░██@ +░██ ░██@ +░██ ░██@ +░██ ░██@ +░██ ░██@ +░░███████ @ + ░░░░░░░ @@ + ██ ██@ +░██ ░██@ +░██ ░██@ +░░██ ██ @ + ░░██ ██ @ + ░░████ @ + ░░██ @ + ░░ @@ + ██ ██@ +░██ ░██@ +░██ █ ░██@ +░██ ███ ░██@ +░██ ██░██░██@ +░████ ░░████@ +░██░ ░░░██@ +░░ ░░ @@ + ██ ██@ +░░██ ██ @ + ░░██ ██ @ + ░░███ @ + ██░██ @ + ██ ░░██ @ + ██ ░░██@ +░░ ░░ @@ + ██ ██@ +░░██ ██ @ + ░░████ @ + ░░██ @ + ░██ @ + ░██ @ + ░██ @ + ░░ @@ + ████████@ +░░░░░░██ @ + ██ @ + ██ @ + ██ @ + ██ @ + ████████@ +░░░░░░░░ @@ + █████@ +░██░░ @ +░██ @ +░██ @ +░██ @ +░██ @ +░█████@ +░░░░░ @@ + ██ @ +░░██ @ + ░░██ @ + ░░██ @ + ░░██ @ + ░░██ @ + ░░██@ + ░░ @@ + █████@ +░░░░██@ + ░██@ + ░██@ + ░██@ + ░██@ + █████@ +░░░░░ @@ + ██ @ + ██░ ██ @ + ██ ░░ ██@ +░░ ░░ @ + @ + @ + @ + @@ + @ + @ + @ + @ + @ + @ + █████@ +░░░░░ @@ + ██@ +░█ @ +░ @ + @ + @ + @ + @ + @@ + @ + @ + ██████ @ + ░░░░░░██ @ + ███████ @ + ██░░░░██ @ +░░████████@ + ░░░░░░░░ @@ + ██ @ +░██ @ +░██ @ +░██████ @ +░██░░░██@ +░██ ░██@ +░██████ @ +░░░░░ @@ + @ + @ + █████ @ + ██░░░██@ +░██ ░░ @ +░██ ██@ +░░█████ @ + ░░░░░ @@ + ██@ + ░██@ + ░██@ + ██████@ + ██░░░██@ +░██ ░██@ +░░██████@ + ░░░░░░ @@ + @ + @ + █████ @ + ██░░░██@ +░███████@ +░██░░░░ @ +░░██████@ + ░░░░░░ @@ + ████@ + ░██░ @ + ██████@ +░░░██░ @ + ░██ @ + ░██ @ + ░██ @ + ░░ @@ + @ + █████ @ + ██░░░██@ +░██ ░██@ +░░██████@ + ░░░░░██@ + █████ @ + ░░░░░ @@ + ██ @ +░██ @ +░██ @ +░██████ @ +░██░░░██@ +░██ ░██@ +░██ ░██@ +░░ ░░ @@ + ██@ +░░ @ + ██@ +░██@ +░██@ +░██@ +░██@ +░░ @@ + ██@ + ░░ @ + ██@ + ░██@ + ░██@ + ██░██@ +░░███ @ + ░░░ @@ + ██ @ +░██ @ +░██ ██@ +░██ ██ @ +░████ @ +░██░██ @ +░██░░██@ +░░ ░░ @@ + ██@ + ░██@ + ░██@ + ░██@ + ░██@ + ░██@ + ███@ +░░░ @@ + @ + @ + ██████████ @ +░░██░░██░░██@ + ░██ ░██ ░██@ + ░██ ░██ ░██@ + ███ ░██ ░██@ +░░░ ░░ ░░ @@ + @ + @ + ███████ @ +░░██░░░██@ + ░██ ░██@ + ░██ ░██@ + ███ ░██@ +░░░ ░░ @@ + @ + @ + ██████ @ + ██░░░░██@ +░██ ░██@ +░██ ░██@ +░░██████ @ + ░░░░░░ @@ + @ + ██████ @ +░██░░░██@ +░██ ░██@ +░██████ @ +░██░░░ @ +░██ @ +░░ @@ + @ + ████ @ + ██░░██ @ +░██ ░██ @ +░░█████ @ + ░░░░██ @ + ░███@ + ░░░ @@ + @ + @ + ██████@ +░░██░░█@ + ░██ ░ @ + ░██ @ +░███ @ +░░░ @@ + @ + @ + ██████@ + ██░░░░ @ +░░█████ @ + ░░░░░██@ + ██████ @ +░░░░░░ @@ + ██ @ + ░██ @ + ██████@ +░░░██░ @ + ░██ @ + ░██ @ + ░░██ @ + ░░ @@ + @ + @ + ██ ██@ +░██ ░██@ +░██ ░██@ +░██ ░██@ +░░██████@ + ░░░░░░ @@ + @ + @ + ██ ██@ +░██ ░██@ +░░██ ░██ @ + ░░████ @ + ░░██ @ + ░░ @@ + @ + @ + ███ ██@ +░░██ █ ░██@ + ░██ ███░██@ + ░████░████@ + ███░ ░░░██@ +░░░ ░░░ @@ + @ + @ + ██ ██@ +░░██ ██ @ + ░░███ @ + ██░██ @ + ██ ░░██@ +░░ ░░ @@ + @ + ██ ██@ + ░░██ ██ @ + ░░███ @ + ░██ @ + ██ @ + ██ @ + ░░ @@ + @ + @ + ██████@ +░░░░██ @ + ██ @ + ██ @ + ██████@ +░░░░░░ @@ + ███@ + ██░ @ + ░██ @ + ███ @ +░░░██ @ + ░██ @ + ░░███@ + ░░░ @@ + █@ +░█@ +░█@ +░ @ + █@ +░█@ +░█@ +░ @@ + ███ @ +░░░██ @ + ░██ @ + ░░███@ + ██░ @ + ░██ @ + ███ @ +░░░ @@ + ██ ███ @ +░░███░░██@ + ░░░ ░░ @ + @ + @ + @ + @ + @@ +@ +@ +@ +@ +@ +@ +@ +@@ +@ +@ +@ +@ +@ +@ +@ +@@ +@ +@ +@ +@ +@ +@ +@ +@@ +@ +@ +@ +@ +@ +@ +@ +@@ +@ +@ +@ +@ +@ +@ +@ +@@ +@ +@ +@ +@ +@ +@ +@ +@@ +@ +@ +@ +@ +@ +@ +@ +@@ diff --git a/source/index.md b/source/index.md index 7f25a971..89b421dc 100644 --- a/source/index.md +++ b/source/index.md @@ -1,5 +1,5 @@ --- -title: Why is there always a cat on whatever you're editing? +title: "Why is there always a cat on whatever you're editing?" custom-css: " .blog-index-year-title { text-align: left; diff --git a/source/template.html b/source/template.html index 06cc4f8d..705a2b3c 100644 --- a/source/template.html +++ b/source/template.html @@ -36,7 +36,21 @@ $endif$
  • code
  • -
    +
    
    +    ████   ██               ██                 ██               ██   ████
    +   ░░░░   ░░██             ██  ██   ██     ██ ░░██             ██   ░░░░
    +           ░░██           ██  ░░██ ░░██   ██   ░░██           ██
    +            ░░██         ░██   ░░   ░░   ██     ░██          ██
    +             ░░██        ░██            ██      ░██         ██
    +              ░░██       ░░██         ██        ██         ██
    +               ░░██ █████ ░░██     ███         ██   █████ ██
    +                ░░ ░░░░░   ░░     ░░░         ░░   ░░░░░ ░░
    +        
    +
    + + +
    +
    $if(title)$

    $title$

    @@ -49,23 +63,19 @@ $if(author)$ $endif$ $if(date_display)$ +$endif$ +$if(updated)$ + + + $endif$
    $endif$ $body$
    -
    -
    -$if(updated)$ - - - -$endif$ - - - neodarz - -
    + + + -- cgit v1.2.1