diff --git a/layout/post.html b/layout/post.html index 1e6a5fb..0087b1e 100644 --- a/layout/post.html +++ b/layout/post.html @@ -7,7 +7,6 @@ {{ comments }} - diff --git a/makesite.py b/makesite.py index 8ec43e4..0adcf5b 100755 --- a/makesite.py +++ b/makesite.py @@ -50,21 +50,23 @@ locale.setlocale(locale.LC_ALL, "") # initialize markdown + class HighlightRenderer(mistune.Renderer): - - options = {'escape': False, 'hard_wrap':True} - + + options = {"escape": False, "hard_wrap": True} + def block_code(self, code, lang): if not lang: - return '\n
%s
\n' % \ - mistune.escape(code) + return "\n
%s
\n" % mistune.escape(code) lexer = get_lexer_by_name(lang, stripall=True) formatter = html.HtmlFormatter() return highlight(code, lexer, formatter) + renderer = HighlightRenderer() markdown = mistune.Markdown(renderer=renderer) + def fread(filename): """Read file and close the file.""" with open(filename, "r") as f: @@ -148,13 +150,19 @@ def read_content(filename): summary = markdown(clean_html_tag(text[:summary_index])) else: summary = truncate(markdown(clean_html_tag(text))) - clean_text = text.replace('', '') + clean_text = text.replace("", "") text = markdown(clean_text) else: summary = truncate(text) # Update the dictionary with content and RFC 2822 date. - content.update({"content": text, "rfc_2822_date": rfc_2822_format(content["date"]), "summary": summary}) + content.update( + { + "content": text, + "rfc_2822_date": rfc_2822_format(content["date"]), + "summary": summary, + } + ) return content @@ -216,7 +224,7 @@ def make_posts( page_params["post_url"] = page_params["year"] + "/" + page_params["slug"] # categories - categories = get_header_list_value('category', page_params) + categories = get_header_list_value("category", page_params) out_cats = [] for category in categories: out_cat = render(category_layout, category=category, url=slugify(category)) @@ -225,13 +233,12 @@ def make_posts( page_params["category_label"] = "".join(out_cats) # tags - tags = get_header_list_value('tag', page_params) + tags = get_header_list_value("tag", page_params) page_params["tags"] = tags - # stacosys comments page_params["comment_count"] = 0 - page_params["comments"] = '' + page_params["comments"] = "" if params["stacosys_url"]: req_url = params["stacosys_url"] + "/comments" query_params = dict( @@ -466,7 +473,6 @@ def main(): **params ) - # Create sitemap make_list( blog_posts, diff --git a/static/css/style.css b/static/css/style.css index d11f728..6985a1f 100644 --- a/static/css/style.css +++ b/static/css/style.css @@ -170,6 +170,10 @@ a:hover, a:active { display: none; } +#comment-form > form > fieldset > .remarque { + display: none; +} + .comment-separator { height:1px; background:#717171;