env externo

This commit is contained in:
f 2021-03-26 13:14:46 -03:00
parent 43a38b5d6c
commit 935441cbf0
3 changed files with 10 additions and 8 deletions

View file

@ -1,7 +0,0 @@
<script async type="text/javascript">
window.env = {
AIRBRAKE_PROJECT_ID: {{ site.env.AIRBRAKE_PROJECT_ID }},
AIRBRAKE_PROJECT_KEY: '{{ site.env.AIRBRAKE_PROJECT_KEY }}',
JEKYLL_ENV: '{{ site.env.JEKYLL_ENV }}'
}
</script>

View file

@ -16,7 +16,8 @@
desarrollo hay que evitar el archivo .env (copiarlo de .env.example
si no existe.
{% endcomment %}
{%- include_cached env.html -%}
<link rel="preload" as="script" type="text/javascript" href="env.js" />
<script type="text/javascript" src="env.js"></script>
<script defer type="text/javascript" src="assets/js/pack.js"></script>
{% comment %}

8
env.js Normal file
View file

@ -0,0 +1,8 @@
---
---
window.env = {
AIRBRAKE_PROJECT_ID: {{ site.env.AIRBRAKE_PROJECT_ID | default: 0 }},
AIRBRAKE_PROJECT_KEY: '{{ site.env.AIRBRAKE_PROJECT_KEY }}',
JEKYLL_ENV: '{{ site.env.JEKYLL_ENV }}'
}