aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorneodarz <neodarz@neodarz.net>2017-05-04 03:28:35 +0200
committerneodarz <neodarz@neodarz.net>2017-05-04 03:28:35 +0200
commit85f447df4bd2a1764858a14012d4b1365309a895 (patch)
treec3c251af35004175f4dfc69600ec1d801f99e93a
parent785bde84dd4888817bb9825ba5ab388ec2b7c4b7 (diff)
downloadmy_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-xpyblog10
1 files changed, 4 insertions, 6 deletions
diff --git a/pyblog b/pyblog
index 8d7fc377..461a9934 100755
--- a/pyblog
+++ b/pyblog
@@ -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)