File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change 1414)
1515
1616def check_theme_and_plugins (c ):
17+ """Checks if the theme and plugins directories are present and clones them
18+ from Github if necessary.
19+ """
1720 if not Path ('./theme' ).exists ():
1821 c .run (THEME_CMD )
1922 if not Path ('./plugins' ).exists ():
2023 c .run (PLUGINS_CMD )
2124
2225@task
2326def build (c ):
27+ """Builds the local Pelican blog."""
2428 check_theme_and_plugins (c )
2529 c .run ('echo "Publishing your Pelican website"' )
2630 c .run (f'pipenv run pelican content -s pelicanconf.py -t { THEME } ' )
2731
2832@task
2933def publish (c ):
34+ """Builds the Pelican blog with deployment settings."""
3035 check_theme_and_plugins (c )
3136 c .run ('echo "Building your Pelican website"' )
3237 c .run (f'pipenv run pelican content -s publishconf.py -t { THEME } ' )
3338
3439@task
3540def autoreload (c ):
41+ """Starts the autoreload server to help during writing of blog articles."""
3642 c .run ('echo "Running autoreload server. Press CTRL+C to stop"' )
3743 c .run (f'pipenv run pelican -r content -s pelicanconf.py -t { THEME } ' )
3844
3945@task
4046def runserver (c ):
47+ """Starts the dev server to visualize the articles locally in a web browser
48+ at url http://localhost:8000.
49+ """
4150 c .run ('echo "Running development server. Press CTRL+C to stop"' )
4251 c .run (f'pipenv run python -m http.server -d output' )
4352
4453@task
4554def revert (c ):
55+ """Reverts the repository to the previous commit if not on a Pull Request
56+ on Travis.
57+ """
4658 if not os .getenv ('TRAVIS_PULL_REQUEST' ):
4759 c .run ('echo "Build errors were encountered. Reverting last commit..."' )
4860 c .run ('git revert HEAD -n' )
You can’t perform that action at this time.
0 commit comments