Skip to content
Snippets Groups Projects

Option to not use matomo

Merged Laurent Heirendt requested to merge laurent.heirendt/courses:lh-no-matomo into develop
2 files
+ 15
9
Compare changes
  • Side-by-side
  • Inline
Files
2
+ 9
5
@@ -7,8 +7,9 @@ from shutil import copyfile
@click.command()
@click.option('--date', default=datetime.datetime.today().strftime('%Y-%m-%d'), help='Date of the presentation - format: YYYY-MM-DD')
@click.option('--name', default='myPresentation', help='Short name of the presentation.')
@click.option('--analytics', default='yes', help='Analytics setting')
def main(date, name):
def main(date, name, analytics):
"""Copies the template folder"""
# validate the date
@@ -86,11 +87,14 @@ def main(date, name):
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')
if analytics == "yes":
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.')
click.echo(' > Matomo added.')
else:
click.echo(' > No analytics.')
# launch the server
os.system('grunt server')
Loading