Last active
October 7, 2019 20:26
-
-
Save johnewart/d4e488835046fc440b7d8dc505dee3ab to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try: | |
from urllib.parse import urlparse | |
except ImportError: | |
from urlparse import urlparse | |
from livereload import Server, shell | |
from pelican import Pelican | |
from pelican.settings import read_settings | |
settings = read_settings('pelicanconf.py') | |
p = Pelican(settings) | |
def compile(): | |
try: | |
p.run() | |
except SystemExit as e: | |
pass | |
server = Server() | |
server.watch(p.settings['PATH'], compile) | |
server.watch(p.settings['THEME'], compile) | |
server.watch('./pelicanconf.py', compile) | |
host_port = p.settings.get('SITEURL') or 'http://localhost:5500' | |
details = urlparse(host_port) | |
host, port = details[1].split(':') | |
server.serve(host=host, port=port, root=settings['OUTPUT_PATH']) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- # | |
from __future__ import unicode_literals | |
import os | |
base_dir = os.path.dirname(os.path.realpath(__file__)) | |
AUTHOR = u'John Ewart' | |
SITENAME = u'John Ewart' | |
SITEURL = '' | |
DEFAULT_DATE = 'fs' | |
SLUGIFY_SOURCE = 'title' | |
#CACHE_CONTENT=True | |
#CONTENT_CACHING_LAYER='reader' | |
#LOAD_CONTENT_CACHE=True | |
PATH = 'content' | |
TIMEZONE = 'America/Los_Angeles' | |
THEME = os.path.join(base_dir, "theme") | |
DEFAULT_LANG = u'en' | |
# Feed generation is usually not desired when developing | |
FEED_ALL_ATOM = None | |
CATEGORY_FEED_ATOM = None | |
TRANSLATION_FEED_ATOM = None | |
AUTHOR_FEED_ATOM = None | |
AUTHOR_FEED_RSS = None | |
#PAGE_URL = '{path}' | |
#PAGE_SAVE_AS = '{path}' | |
#PATH_METADATA= 'pages/(?P<dirname>.*)/(?P<basename>.*)\..i*' | |
PAGE_SAVE_AS= '{outputdir}/index.html' | |
PAGE_URL= '{dirname}/{basename}/' | |
PAGE_PATHS = ['pages'] | |
STATIC_PATHS = ['assets'] | |
DEFAULT_PAGINATION = 10 | |
# Uncomment following line if you want document-relative URLs when developing | |
#RELATIVE_URLS = True | |
MARKUP = ('md') | |
PLUGINS = [] | |
PLUGIN_PATHS = ['./plugins'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
backcall==0.1.0 | |
bleach==2.1.4 | |
blinker==1.4 | |
decorator==4.3.0 | |
docutils==0.14 | |
entrypoints==0.2.3 | |
feedgenerator==1.9 | |
html5lib==1.0.1 | |
ipykernel==4.9.0 | |
ipython==6.5.0 | |
ipython-genutils==0.2.0 | |
ipywidgets==7.4.1 | |
jedi==0.12.1 | |
Jinja2==2.10 | |
jsonschema==2.6.0 | |
jupyter==1.0.0 | |
jupyter-client==5.2.3 | |
jupyter-console==5.2.0 | |
jupyter-core==4.4.0 | |
livereload==2.5.2 | |
Markdown==2.6.11 | |
MarkupSafe==1.0 | |
mistune==0.8.3 | |
nbconvert==5.3.1 | |
nbformat==4.4.0 | |
notebook==5.6.0 | |
pandocfilters==1.4.2 | |
parso==0.3.1 | |
pelican==3.7.1 | |
pexpect==4.6.0 | |
pickleshare==0.7.4 | |
pkg-resources==0.0.0 | |
prometheus-client==0.3.1 | |
prompt-toolkit==1.0.15 | |
ptyprocess==0.6.0 | |
Pygments==2.2.0 | |
python-dateutil==2.7.3 | |
pytz==2018.5 | |
PyYAML==3.13 | |
pyzmq==17.1.2 | |
qtconsole==4.4.1 | |
Send2Trash==1.5.0 | |
simplegeneric==0.8.1 | |
six==1.11.0 | |
terminado==0.8.1 | |
testpath==0.3.1 | |
tornado==5.1 | |
traitlets==4.3.2 | |
Unidecode==1.0.22 | |
wcwidth==0.1.7 | |
webencodings==0.5.1 | |
widgetsnbextension==3.4.1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment