Add static build script
This commit is contained in:
parent
c1443de20a
commit
3a9427912b
3 changed files with 27 additions and 0 deletions
|
@ -14,6 +14,7 @@ pelican_plugins:
|
|||
- autopages
|
||||
- screenfetch
|
||||
- post_build
|
||||
- static_build
|
||||
|
||||
sitemap_format: xml
|
||||
|
||||
|
|
15
plugins/post_build.py
Normal file
15
plugins/post_build.py
Normal file
|
@ -0,0 +1,15 @@
|
|||
from pelican import signals
|
||||
import os
|
||||
|
||||
|
||||
OUTPUT_PATH = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), 'output')
|
||||
|
||||
|
||||
def post_build(*args, **kwargs):
|
||||
os.system("mv {0}/assets/robots.txt {0}".format(OUTPUT_PATH))
|
||||
os.system("cp -R {0}/assets/* {0}/static".format(OUTPUT_PATH))
|
||||
os.system("rm -rf {0}/assets".format(OUTPUT_PATH))
|
||||
|
||||
|
||||
def register():
|
||||
signals.finalized.connect(post_build)
|
11
plugins/static_build.py
Normal file
11
plugins/static_build.py
Normal file
|
@ -0,0 +1,11 @@
|
|||
from pelican import signals
|
||||
import os
|
||||
|
||||
|
||||
def static_build(*args, **kwargs):
|
||||
os.system('npm run build-js')
|
||||
os.system('npm run build-scss')
|
||||
|
||||
|
||||
def register():
|
||||
signals.static_generator_init.connect(static_build)
|
Reference in a new issue