Skip to content
Snippets Groups Projects
Verified Commit ee98c622 authored by Laurent Heirendt's avatar Laurent Heirendt :airplane:
Browse files

add matomo to contribute

parent b610d9e6
No related branches found
No related tags found
2 merge requests!84Regular merge of develop,!83Add matomo
...@@ -46,7 +46,7 @@ def main(date, name): ...@@ -46,7 +46,7 @@ def main(date, name):
click.echo(' > Directory for slides {0} created.' . format(slidesPath)) click.echo(' > Directory for slides {0} created.' . format(slidesPath))
else: else:
click.echo(' > Directory for slides{0} already exists.' . format(slidesPath)) click.echo(' > Directory for slides {0} already exists.' . format(slidesPath))
# change to the root directory of the presentation # change to the root directory of the presentation
os.chdir(fullPath) os.chdir(fullPath)
...@@ -55,6 +55,13 @@ def main(date, name): ...@@ -55,6 +55,13 @@ def main(date, name):
createSymlink('../../theme', 'theme') createSymlink('../../theme', 'theme')
createSymlink('../../theme/package.json', 'package.json') createSymlink('../../theme/package.json', 'package.json')
# reset the theme
os.chdir('../../theme')
os.system('git checkout -- templates/_index.html')
os.chdir(fullPath)
click.echo(' > Theme reset.')
# copy the contents of the template folder # copy the contents of the template folder
if not os.path.isfile(os.path.join(fullPath, 'slides', 'index.md')): if not os.path.isfile(os.path.join(fullPath, 'slides', 'index.md')):
copy_tree(os.path.join(rootDir, 'template', 'slides'), slidesPath) copy_tree(os.path.join(rootDir, 'template', 'slides'), slidesPath)
...@@ -79,6 +86,13 @@ def main(date, name): ...@@ -79,6 +86,13 @@ def main(date, name):
else: else:
click.echo(' > All dependencies already installed.') click.echo(' > All dependencies already installed.')
# add analytics
os.system('sed -i "/matomohead/r./../../.ci/analytics/head.html" theme/templates/_index.html')
os.system('sed -i "/matomopolicy/r./../../.ci/analytics/policy.html" theme/templates/_index.html')
os.system('sed -i "/matomobanner/r./../../.ci/analytics/gdpr-banner.html" theme/templates/_index.html')
click.echo(' > Matomo added.')
# launch the server # launch the server
os.system('grunt server') os.system('grunt server')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment