Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion kompost/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def generate(config):
cats = [cat.strip() for cat in cats if cat.strip() != '']
config['categories'] = cats

for path in ('cnd', 'siteurl'):
for path in ('cdn', 'siteurl'):
if os.path.exists(config[path]):
config[path] = os.path.abspath(config[path])

Expand Down
24 changes: 12 additions & 12 deletions kompost/generators/rst.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@

_FOOTER = """

.. |pen| image:: %(cnd)s/media/pen.png
.. |info| image:: %(cnd)s/media/info.png
.. |thumbsup| image:: %(cnd)s/media/thumbsup.png
.. |right| image:: %(cnd)s/media/right.png
.. |flash| image:: %(cnd)s/media/flash.png
.. |pen| image:: %(cdn)s/media/pen.png
.. |info| image:: %(cdn)s/media/info.png
.. |thumbsup| image:: %(cdn)s/media/thumbsup.png
.. |right| image:: %(cdn)s/media/right.png
.. |flash| image:: %(cdn)s/media/flash.png
.. |infosign| image:: icon-info-sign
"""

Expand Down Expand Up @@ -66,7 +66,7 @@ def render_simple_tag(node, document, title, config, tagname=None,
def _tree(node, document, title, config):
"""Renders a node in HTML.
"""
cnd = config['cnd']
cdn = config['cdn']
text = []
klass = node.__class__.__name__
if klass == 'transition':
Expand Down Expand Up @@ -207,7 +207,7 @@ def _tree(node, document, title, config):
text.append('<a href="%s">' % refuri)

if not uri.startswith('http'):
uri = '/'.join([config['cnd'], document.split('/')[1], uri])
uri = '/'.join([config['cdn'], document.split('/')[1], uri])
text.append('<img class="centered span12" src="%s"></img>' % uri)

# caption
Expand Down Expand Up @@ -274,7 +274,7 @@ def _tree(node, document, title, config):
index(document, title, 'author', value)
author_id = str2authorid(value)
text.append('<img class="subst" '
'src="%s/media/pen.png">' % cnd)
'src="%s/media/pen.png">' % cdn)
text.append('</img>')
text.append('<a href="%s/auteurs/%s.html">%s</a>' %
(config['siteurl'], author_id, value))
Expand All @@ -286,7 +286,7 @@ def _tree(node, document, title, config):
value = node.children[1].astext()
if name == 'category':
text.append('<img class="subst" '
'src="%s/media/info.png">' % cnd)
'src="%s/media/info.png">' % cdn)
text.append('</img>')
cats = value.split(',')
index(document, title, name, cats)
Expand All @@ -299,14 +299,14 @@ def _tree(node, document, title, config):
index(document, title, name, value)

text.append('<img class="subst" '
'src="%s/media/flash.png">' % cnd)
'src="%s/media/flash.png">' % cdn)
text.append('</img>')
text.append('<strong>Niveau</strong>: %s' % value.capitalize())
elif name == 'translator':
index(document, title, name, value)

text.append('<img class="subst" '
'src="%s/media/translation.png">' % cnd)
'src="%s/media/translation.png">' % cdn)
text.append('</img>')
author_id = str2authorid(value)
msg = ('<strong>Traduction</strong>: '
Expand Down Expand Up @@ -343,7 +343,7 @@ def __call__(self, path, target, url_target, **options):
target = os.path.splitext(target)[0] + '.html'

with open(path) as f:
content = f.read() + _FOOTER % {'cnd': self.config['cnd']}
content = f.read() + _FOOTER % {'cdn': self.config['cdn']}
doctree = publish_doctree(content)

title = doctree.children[0].astext()
Expand Down