Browse Source

Add deploy_context for generator_embed_path

ssl
jywsn 10 years ago
parent
commit
dec15498f0
  1. 20
      config.json
  2. 6
      website/app.py
  3. 2
      website/templates/base.html

20
config.json

@ -176,7 +176,23 @@
// - run usemin on all html in build/website
// - sync build/website with bucket
"deploy": {
"stg": {"bucket": "timeline.knilab.com", "usemin_context": {"cdn": "dev"}},
"prd": {"bucket": "timeline.knightlab.com", "usemin_context": {"cdn": "latest"}}
"stg": {
"bucket": "timeline.knilab.com",
"usemin_context": {
"cdn": "dev"
},
"deploy_context": {
"generator_embed_path": "//test.knightlab.com/libs/timeline/dev/embed/index.html"
}
},
"prd": {
"bucket": "timeline.knightlab.com",
"usemin_context": {
"cdn": "latest"
},
"deploy_context": {
"generator_embed_path": "//test.knightlab.com/libs/timeline/latest/embed/index.html"
}
}
}
}

6
website/app.py

@ -74,12 +74,12 @@ def catch_source(path):
@app.route('/')
@app.route('/<path:path>')
def catch_all(path='index.html'):
def catch_all(path='index.html', context=None):
"""Catch-all function which serves every URL."""
context = context or {}
if not os.path.splitext(path)[1]:
path = os.path.join(path, 'index.html')
return render_template(path)
return render_template(path, **context)
if __name__ == "__main__":

2
website/templates/base.html

@ -142,7 +142,7 @@
<!-- Override -->
<script type="text/javascript">
var generator_embed_path = "//test.knightlab.com/libs/timeline/latest/embed/index.html";
var generator_embed_path = "{{ generator_embed_path }}";
</script>
<!-- build:js //test.knightlab.com/libs/timeline/%(cdn)s/js/storyjs-embed-generator.js -->
<script type="text/javascript">

Loading…
Cancel
Save