configurar js usando variables de entorno
This commit is contained in:
parent
d7918eba3b
commit
0cfdd63542
7 changed files with 114 additions and 8 deletions
12
_config.yml
12
_config.yml
|
@ -1,11 +1,15 @@
|
|||
plugins:
|
||||
- jekyll-order
|
||||
- jekyll-locales
|
||||
- jekyll-relative-urls
|
||||
- jekyll-dotenv
|
||||
- jekyll-include-cache
|
||||
- jekyll-linked-posts
|
||||
- jekyll-commonmark
|
||||
- jekyll-feed
|
||||
- jekyll-order
|
||||
- jekyll-data
|
||||
- jekyll-seo-tag
|
||||
- jekyll-images
|
||||
- jekyll-include-cache
|
||||
- jekyll-locales
|
||||
- jekyll-linked-posts
|
||||
- sutty-liquid
|
||||
markdown: CommonMark
|
||||
commonmark:
|
||||
|
|
6
_includes/env.html
Normal file
6
_includes/env.html
Normal file
|
@ -0,0 +1,6 @@
|
|||
<script async type="text/javascript">
|
||||
window.env = {
|
||||
AIRBRAKE_PROJECT_ID: {{ site.env.AIRBRAKE_PROJECT_ID }},
|
||||
AIRBRAKE_PROJECT_KEY: '{{ site.env.AIRBRAKE_PROJECT_KEY }}'
|
||||
}
|
||||
</script>
|
|
@ -12,8 +12,11 @@
|
|||
<link href="assets/css/styles.css" rel="stylesheet">
|
||||
|
||||
{% comment %}
|
||||
Webpack
|
||||
Webpack. La configuración se pasa por variables de entorno, en
|
||||
desarrollo hay que evitar el archivo .env (copiarlo de .env.example
|
||||
si no existe.
|
||||
{% endcomment %}
|
||||
{%- include_cached env.html -%}
|
||||
<script defer type="text/javascript" src="assets/js/pack.js"></script>
|
||||
|
||||
{% comment %}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import { Notifier } from '@airbrake/browser'
|
||||
|
||||
window.airbrake = new Notifier({
|
||||
projectId: parseInt(process.env.AIRBRAKE_PROJECT_ID),
|
||||
projectKey: process.env.AIRBRAKE_PROJECT_KEY,
|
||||
projectId: window.env.AIRBRAKE_PROJECT_ID,
|
||||
projectKey: window.env.AIRBRAKE_PROJECT_KEY,
|
||||
host: 'https://panel.sutty.nl'
|
||||
})
|
||||
|
||||
|
|
90
assets/js/pack.js
Normal file
90
assets/js/pack.js
Normal file
File diff suppressed because one or more lines are too long
1
assets/js/pack.js.map
Normal file
1
assets/js/pack.js.map
Normal file
File diff suppressed because one or more lines are too long
|
@ -56,7 +56,7 @@ Gem::Specification.new do |spec|
|
|||
|
||||
# Dependencias, esto se va a instalar al instalar la gema
|
||||
spec.add_runtime_dependency 'jekyll', '~> 4'
|
||||
spec.add_runtime_dependency 'jekyll-relative-urls', '~> 0.0'
|
||||
spec.add_runtime_dependency 'jekyll-relative-urls', '~> 0'
|
||||
spec.add_runtime_dependency 'jekyll-seo-tag', '~> 2'
|
||||
spec.add_runtime_dependency 'jekyll-images', '~> 0.2'
|
||||
spec.add_runtime_dependency 'jekyll-include-cache', '~> 0'
|
||||
|
@ -66,6 +66,8 @@ Gem::Specification.new do |spec|
|
|||
spec.add_runtime_dependency 'jekyll-order', '~> 0'
|
||||
spec.add_runtime_dependency 'sutty-liquid', '~> 0'
|
||||
spec.add_runtime_dependency 'jekyll-commonmark', '~> 1.3'
|
||||
spec.add_runtime_dependency 'jekyll-dotenv', '>= 0.2'
|
||||
spec.add_runtime_dependency 'jekyll-feed', '~> 0.15'
|
||||
|
||||
# Dependencias de desarrollo
|
||||
spec.add_development_dependency 'bundler', '~> 2.1'
|
||||
|
|
Loading…
Reference in a new issue