-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pelican migration #20
Conversation
The theory here is that we can exploit the Markdown processor's capability of passing through HTML to render the imported-from-wordpress posts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Worth considering. View full project report here.
@task | ||
def build(c): | ||
"""Build local version of site""" | ||
pelican_run("-s {settings_base}".format(**CONFIG)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
f-string is easier to read, write, and less computationally expensive than legacy string formatting. More info.
@task | ||
def rebuild(c): | ||
"""`build` with the delete switch""" | ||
pelican_run("-d -s {settings_base}".format(**CONFIG)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Likewise, Consider using f-string instead.
@task | ||
def regenerate(c): | ||
"""Automatically regenerate site upon file modification""" | ||
pelican_run("-r -s {settings_base}".format(**CONFIG)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As above, Consider using f-string instead.
# Open site in default browser | ||
import webbrowser | ||
|
||
webbrowser.open("http://{host}:{port}".format(**CONFIG)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above: Consider using f-string instead.
|
||
webbrowser.open("http://{host}:{port}".format(**CONFIG)) | ||
|
||
sys.stderr.write("Serving at {host}:{port} ...\n".format(**CONFIG)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above: Consider using f-string instead.
@task | ||
def preview(c): | ||
"""Build production version of site""" | ||
pelican_run("-s {settings_publish}".format(**CONFIG)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above: Consider using f-string instead.
|
||
content_file_extensions = [".md", ".rst"] | ||
for extension in content_file_extensions: | ||
content_glob = "{}/**/*{}".format(SETTINGS["PATH"], extension) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As above, Consider using f-string instead.
# Open site in default browser | ||
import webbrowser | ||
|
||
webbrowser.open("http://{host}:{port}".format(**CONFIG)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above: Consider using f-string instead.
@task | ||
def publish(c): | ||
"""Publish to production via rsync""" | ||
pelican_run("-s {settings_publish}".format(**CONFIG)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Likewise, Consider using f-string instead.
No description provided.