Skip to content
Permalink
Browse files

Lorem ipsum, conf.py.sample, demo button

Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed May 11, 2017
1 parent 65d9527 commit 44c1f7682383eca91a066f5af729d057f8221a4c
@@ -0,0 +1,15 @@
.. title: Lorem Ipsum
.. slug: lorem-ipsum
.. date: 1970-01-01 00:00:00 UTC
.. tags: demo, lorem-ipsum
.. author: Cicero
.. category:
.. link:
.. description: Lorem ipsum, a common filler text.
.. type: text
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Cras sodales, purus id maximus tincidunt, leo ex venenatis ipsum, id blandit lorem nulla eget sapien. Nunc sit amet turpis sit amet sapien bibendum eleifend vitae a ligula. Donec sapien dui, gravida ac euismod nec, tincidunt quis ante. Cras elementum id neque at bibendum. Suspendisse potenti. Nullam convallis eu dui at cursus. Integer eget nulla sed nunc condimentum egestas.

Mauris hendrerit urna vel ipsum porttitor euismod. Vestibulum euismod sollicitudin bibendum. Nunc id tincidunt orci. Nullam a semper enim. Morbi ac magna consectetur, lobortis nisi id, finibus ante. In a risus elementum, varius eros vel, interdum mauris. Curabitur in varius leo, gravida tincidunt dolor. Integer iaculis mauris lectus, nec convallis est pellentesque vitae. Nam sagittis dignissim convallis. Nam sit amet lorem sed orci ultrices accumsan. Quisque semper sagittis mi non laoreet. Fusce non auctor ipsum. Nam eleifend arcu nisi, eget faucibus justo laoreet sit amet. Nunc blandit tincidunt augue, vel suscipit dui sollicitudin non. Phasellus eget lacinia leo, sed lobortis erat.
@@ -44,6 +44,9 @@
from urllib.parse import urljoin # NOQA


LOREM_BASE = "lorem-ipsum.rst"


@contextmanager
def cd(path):
old_dir = os.getcwd()
@@ -64,6 +67,7 @@ def build_demo(theme, themes_dir, demo_source, demo_destination):

conf_path = "/".join([demo_source, "conf.py"])
book_path = "/".join([demo_source, "templates", "book.tmpl"])
lorem_path = "/".join([demo_source, "posts", "lorem-ipsum.rst"])
# Get custom required settings from the theme
themes = utils.get_theme_chain(theme, themes_dirs=[themes_dir, 'themes'])
engine_path = utils.get_asset_path('engine', themes)
@@ -77,7 +81,9 @@ def build_demo(theme, themes_dir, demo_source, demo_destination):
shutil.copy('book-jinja.tmpl', book_path)

with io.open(conf_path, "a", encoding="utf-8") as conf:
conf.write(u"\n\n{2}\n\nTHEME = '{0}'\n\nUSE_BUNDLES = False\n\nOUTPUT_FOLDER = '{1}'\n\nSOCIAL_BUTTONS_CODE = ''\nUSE_BASE_TAG = False\n".format(theme, demo_destination, extra_conf))
conf.write(u"\n\nTHEME = '{0}'\nUSE_BUNDLES = False\nOUTPUT_FOLDER = '{1}'\nSOCIAL_BUTTONS_CODE = ''\nUSE_BASE_TAG = False\n\n{2}\n".format(theme, demo_destination, extra_conf))

shutil.copy(LOREM_BASE, lorem_path)

with cd(demo_source):
subprocess.check_call(["nikola", "build"], stdout=subprocess.PIPE)
@@ -114,6 +120,7 @@ def gen_tasks(self):
'pkgindex_handlers': self.site.config['PKGINDEX_HANDLERS'],
'pkgindex_config': self.site.config['PKGINDEX_CONFIG'],
'base_url': self.site.config['BASE_URL'],
'revision': '2',
}
yield self.group_task()
self.site.scan_posts()
@@ -165,6 +172,9 @@ def gen_tasks(self):
zip_files.append((os.path.join(root, file),
os.path.join(root[d:], file)))
file_dep.append(os.path.join(root, file))

# those are separate variables to avoid cyclic dependencies
file_dep += [LOREM_BASE]
file_dep_png = file_dep + [index]

yield utils.apply_filters({
@@ -19,7 +19,7 @@
% if post.meta('bootswatch'):
<p class="bootswatchline bootswatch">Supports <a href="https://bootswatch.com/">Bootswatch</a></p>
% endif
<p class="demoline demo"><a href="${post.meta('demo_link')}">See demo</a></p>
<p class="demoline demo"><a href="${post.meta('demo_link')}" class="btn btn-primary">See demo</a></p>
</div>
</header>
<div class="e-content entry-content" itemprop="articleBody text">

0 comments on commit 44c1f76

Please sign in to comment.