2
0
mirror of https://github.com/offen/website.git synced 2024-12-26 14:50:20 +01:00

Merge pull request #34 from offen/development

Add opt-in analytics
This commit is contained in:
Frederik Ring 2020-01-12 19:05:40 +01:00 committed by GitHub
commit dde6cb0e6c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 8 additions and 5 deletions

View File

@ -20,11 +20,13 @@ jobs:
export BUCKET="offen-dev-production"
export DISTRIBUTION="E2UP8XHLFOC3QC"
export ROBOTS_FILE="robots.txt.production"
export OFFEN_ACCOUNT_ID="5ec8345a-2a45-4eb9-92e5-8d9e5684db58"
else
export SITEURL="https://staging.offen.dev"
export BUCKET="offen-dev-staging"
export DISTRIBUTION="E13I20LK8ASYFH"
export ROBOTS_FILE="robots.txt.staging"
export OFFEN_ACCOUNT_ID="8f7ee44a-4cd8-47f2-a77e-8c7c98d46b89"
fi
make build
aws s3 sync --delete ./output/. s3://$BUCKET

View File

@ -23,7 +23,7 @@ ROBOTS_FILE ?= robots.txt.staging
SITEURL ?= http://localhost:8000
build:
@docker build --build-arg siteurl=${SITEURL} -t offen/website -f build/Dockerfile .
@docker build --build-arg siteurl=${SITEURL} --build-arg offenaccountid=${OFFEN_ACCOUNT_ID} -t offen/website -f build/Dockerfile .
@rm -rf output && mkdir output
@docker create --entrypoint=bash -it --name assets offen/website
@docker cp assets:/code/homepage/output/. ./output/

View File

@ -5,6 +5,8 @@ ENV NODE_PATH="/usr/lib/node_modules"
ARG siteurl
ENV SITEURL=$siteurl
ARG offenaccountid
ENV OFFEN_ACCOUNT_ID=$offenaccountid
RUN npm install -g postcss-cli@^6.1.3 autoprefixer@^9.7.0 svgo@^1.3.0
RUN apt-get update \

View File

@ -1,3 +1,4 @@
import os
from datetime import datetime
from calendar import month_name
# If your site is available via HTTPS, make sure SITEURL begins with https://
@ -69,4 +70,4 @@ PATREON_URL = 'https://www.patreon.com/offen'
LINKEDIN_URL = 'https://www.linkedin.com/company/hioffen'
TWITTER_URL = 'https://twitter.com/hioffen'
# OFFEN_ACCOUNT_ID = '9b63c4d8-65c0-438c-9d30-cc4b01173393'
OFFEN_ACCOUNT_ID = os.environ.get('OFFEN_ACCOUNT_ID', None)

View File

@ -15,5 +15,3 @@ FEED_ALL_ATOM = 'feeds/all.atom.xml'
DELETE_OUTPUT_DIRECTORY = True
PLUGINS += ['optimize_images']
# OFFEN_ACCOUNT_ID = '5ec8345a-2a45-4eb9-92e5-8d9e5684db58'

View File

@ -28,7 +28,7 @@
<link rel="preload" href="/theme/fonts/rubik-v9-latin-regular.woff2" as="font" crossorigin>
<link rel="preload" href="/theme/fonts/rubik-v9-latin-500.woff2" as="font" crossorigin>
{% if OFFEN_ACCOUNT_ID and not no_stats %}
<script async src="/script.js" data-account-id="{{ OFFEN_ACCOUNT_ID }}"></script>
<script async src="https://analytics.offen.dev/script.js" data-account-id="{{ OFFEN_ACCOUNT_ID }}"></script>
{% endif %}
</head>
{% endblock %}