Skip to content

Commit 914468d

Browse files
author
Thierry Chappuis
committed
Modified configuration files to handle theme and plugins
1 parent 8888928 commit 914468d

File tree

4 files changed

+24
-6
lines changed

4 files changed

+24
-6
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ theme*/
33
*.swp
44
__pycache__/
55
output/
6+
plugins/

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ install:
55
- pip3 install pipenv
66
- pipenv install
77
script:
8-
- git clone https://github.com/alexandrevicenzi/Flex.git theme/active
98
- pipenv run invoke publish
109
after_failure:
1110
- pipenv run invoke revert

pelicanconf.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,14 @@
1919
MENUITEMS = [
2020
('News', 'category/news.html'),
2121
('Articles', 'category/articles.html'),
22-
('Tutoriels', '/category/tutoriels.html'),
23-
('Livres', '/category/livres.html'),
24-
('Catégories', '/categories.html'),
25-
('Tags', '/tags.html'),
22+
('Tutoriels', 'category/tutoriels.html'),
23+
('Catégories', 'categories.html'),
24+
('Tags', 'tags.html'),
2625
]
2726

27+
PLUGIN_PATHS = ['plugins']
28+
PLUGINS = ['summary']
29+
2830
TIMEZONE = 'Europe/Paris'
2931

3032
# Translate to German.

tasks.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,33 @@
11
import os
2+
from pathlib import Path
23

34
from invoke import task
45

56

6-
THEME = 'theme/active'
7+
THEME = './theme/active'
8+
THEME_CMD = f'git clone https://github.com/alexandrevicenzi/Flex.git {THEME}'
9+
10+
PLUGINS = './plugins'
11+
PLUGINS_CMD = (
12+
'git clone --recursive '
13+
f'https://github.com/getpelican/pelican-plugins {PLUGINS}'
14+
)
15+
16+
def check_theme_and_plugins(c):
17+
if not Path('./theme').exists():
18+
c.run(THEME_CMD)
19+
if not Path('./plugins').exists():
20+
c.run(PLUGINS_CMD)
721

822
@task
923
def build(c):
24+
check_theme_and_plugins(c)
1025
c.run('echo "Publishing your Pelican website"')
1126
c.run(f'pipenv run pelican content -s pelicanconf.py -t {THEME}')
1227

1328
@task
1429
def publish(c):
30+
check_theme_and_plugins(c)
1531
c.run('echo "Building your Pelican website"')
1632
c.run(f'pipenv run pelican content -s publishconf.py -t {THEME}')
1733

0 commit comments

Comments
 (0)