diff options
author | neodarz <neodarz@neodarz.net> | 2017-05-04 03:28:35 +0200 |
---|---|---|
committer | neodarz <neodarz@neodarz.net> | 2017-05-04 03:28:35 +0200 |
commit | 85f447df4bd2a1764858a14012d4b1365309a895 (patch) | |
tree | c3c251af35004175f4dfc69600ec1d801f99e93a | |
parent | 785bde84dd4888817bb9825ba5ab388ec2b7c4b7 (diff) | |
download | my_new_personal_website-85f447df4bd2a1764858a14012d4b1365309a895.tar.xz my_new_personal_website-85f447df4bd2a1764858a14012d4b1365309a895.zip |
Drop some usless code and add some usfull code
Diffstat (limited to '')
-rwxr-xr-x | pyblog | 10 |
1 files changed, 4 insertions, 6 deletions
@@ -37,8 +37,6 @@ 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/" @@ -643,7 +641,8 @@ def rewrite_title(): lines = indexmd.readlines() with open(filename, 'w', encoding='utf-8') as indexmd: for line in lines: - indexmd.write(re.sub(r'\<pre class="header"\>\<code\>(.+?)\<\/code\>\<\/pre\>', '<pre class="header"><code>'+f.renderText('Miou')+'(^._.^)ノ</code></pre>', line)) + #indexmd.write(re.sub(r'\<pre class="header"\>\<code\>(.+?)\<\/code\>\<\/pre\>', '<pre class="header"><code>'+f.renderText('Miou')+'(^._.^)ノ</code></pre>', line)) + indexmd.write(re.suv(r'\<code class="sourceCode diff"\>', '\<code class="sourceCode diff" id="AsourceCode"\>', line)) except Exception: sys.stderr.write("=== /!\ ERROR /!\ ===\n") @@ -651,7 +650,6 @@ def rewrite_title(): 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): """Make links in an article absolute. @@ -1031,7 +1029,7 @@ def generate_blog(fresh=False, report_total_errors=True): continue extension = name.split(".")[-1] - if extension not in ["css", "html", "jpg", "md", "png", "svg", "ico", "txt", + if extension not in ["css", "js", "asc", "html", "jpg", "md", "png", "svg", "ico", "txt", "eot", "ttf", "woff", "woff2"]: continue @@ -1048,7 +1046,7 @@ def generate_blog(fresh=False, report_total_errors=True): anything_modified = True if srcpath == INDEXMD: continue # index will be processed separately - if extension in ["css", "html", "jpg", "png", "svg", "ico", "txt", + if extension in ["css", "js", "asc", "html", "jpg", "png", "svg", "ico", "txt", "eot", "ttf", "woff", "woff2"]: sys.stderr.write("copying %s\n" % relpath) shutil.copy(srcpath, dstpath) |