Skip to content
This repository has been archived by the owner on Apr 16, 2019. It is now read-only.

css_dir evaluated in function definition #113

Open
wants to merge 3 commits into
base: plugins
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@
/blogofile/site_init/*.zip
_site/*
_documentation/themes/blogofile/layout.html
/.tox/*
/MANIFEST
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import codecs
import base64
import urllib
from xml.sax import saxutils

import pytz
import yaml
Expand Down Expand Up @@ -169,7 +170,8 @@ def __post_process(self):
datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S"))

if not self.slug:
self.slug = re.sub("[ ?]", "-", self.title).lower()
self.slug = saxutils.unescape(self.title)
self.slug = re.sub("[^a-zA-Z0-9$\-_\.+!*'(),]", "-", self.slug).lower()

if not self.date:
self.date = datetime.datetime.now(pytz.timezone(self.__timezone))
Expand Down
4 changes: 2 additions & 2 deletions blogofile/site_init/blog_filters/_filters/syntax_highlight.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ def parse_args(args):
return opts


def write_pygments_css(style, formatter,
location=bf.config.filters.syntax_highlight.css_dir):
def write_pygments_css(style, formatter, location = None):
location = location or bf.config.filters.syntax_highlight.css_dir
path = bf.util.path_join("_site", bf.util.fs_site_path_helper(location))
bf.util.mkdir(path)
css_file = "pygments_{0}.css".format(style)
Expand Down
4 changes: 2 additions & 2 deletions blogofile/writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,9 @@ def __write_files(self):
#Copy this non-template file
f_path = util.path_join(root, t_fn)
logger.debug("Copying file: " + f_path)
if self.config.site.overwrite_warning and os.path.exists(path):
logger.warn("Location is used more than once: {0}".format(f_path))
out_path = util.path_join(self.output_dir, f_path)
if self.config.site.overwrite_warning and os.path.exists(out_path):
logger.warn("Location is used more than once: {0}".format(f_path))
if self.bf.config.site.use_hard_links:
# Try hardlinking first, and if that fails copy
try:
Expand Down