mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Add current date when publishing with ghp tool.
Re-submission of #2083 based on Invoke's task.py.
This commit is contained in:
parent
f2b429b7b7
commit
d965575f4a
1 changed files with 6 additions and 3 deletions
|
|
@ -3,6 +3,7 @@
|
|||
import os
|
||||
import shutil
|
||||
import sys
|
||||
import datetime
|
||||
try:
|
||||
import socketserver
|
||||
except ImportError:
|
||||
|
|
@ -29,6 +30,7 @@ CONFIG = {
|
|||
{% if github %}
|
||||
# Github Pages configuration
|
||||
'github_pages_branch': '{{github_pages_branch}}',
|
||||
'commit_message': "'Publish site on {}'".format(datetime.date.today().isoformat()),
|
||||
{% endif %}
|
||||
# Port for `serve`
|
||||
'port': 8000,
|
||||
|
|
@ -108,7 +110,8 @@ def publish(c):
|
|||
@task
|
||||
def gh_pages(c):
|
||||
"""Publish to GitHub Pages"""
|
||||
rebuild(c)
|
||||
c.run("ghp-import -b {github_pages_branch} {deploy_path} -p".format(
|
||||
**CONFIG))
|
||||
preview(c)
|
||||
c.run('ghp-import -b {github_pages_branch} '
|
||||
'-m {commit_message} '
|
||||
'{deploy_path} -p'.format(**CONFIG))
|
||||
{% endif %}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue