diff --git a/contribute.py b/contribute.py index ea625ac904b127a1f0fc68bfb19110657e34a89e..0f3bbbf328076d1824219ddc1a37fea2cb45f4a2 100644 --- a/contribute.py +++ b/contribute.py @@ -46,7 +46,7 @@ def main(date, name): click.echo(' > Directory for slides {0} created.' . format(slidesPath)) 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 os.chdir(fullPath) @@ -55,6 +55,13 @@ def main(date, name): createSymlink('../../theme', 'theme') 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 if not os.path.isfile(os.path.join(fullPath, 'slides', 'index.md')): copy_tree(os.path.join(rootDir, 'template', 'slides'), slidesPath) @@ -79,6 +86,13 @@ def main(date, name): else: 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 os.system('grunt server')