load version dynamically
that way the whole dang cache doesnt get invalidated when the version changes
This commit is contained in:
parent
2f83630629
commit
51cf43d073
|
@ -0,0 +1,14 @@
|
||||||
|
(function(){
|
||||||
|
|
||||||
|
if(!('fetch' in window)){
|
||||||
|
return
|
||||||
|
}
|
||||||
|
fetch('/api/about').then(r => r.json()).then(j => {
|
||||||
|
let ident = document.querySelector('#ident');
|
||||||
|
ident.textContent = j.service
|
||||||
|
if(j.version){
|
||||||
|
ident.textContent += ' ' + j.version
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
})();
|
2
dodo.py
2
dodo.py
|
@ -23,7 +23,7 @@ def task_gen_logo():
|
||||||
|
|
||||||
def task_copy_asset():
|
def task_copy_asset():
|
||||||
import shutil
|
import shutil
|
||||||
assets = ('icon.png', 'logotype.png')
|
assets = ('icon.png', 'logotype.png', 'version.js')
|
||||||
for asset in assets:
|
for asset in assets:
|
||||||
yield dict(
|
yield dict(
|
||||||
name=asset,
|
name=asset,
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
from flask import render_template, url_for, redirect, request, g, Response
|
from flask import render_template, url_for, redirect, request, g, Response, jsonify
|
||||||
from datetime import datetime, timedelta
|
from datetime import datetime, timedelta
|
||||||
import lib.twitter
|
import lib.twitter
|
||||||
import lib
|
import lib
|
||||||
|
@ -161,3 +161,7 @@ def logout():
|
||||||
db.session.commit()
|
db.session.commit()
|
||||||
g.viewer = None
|
g.viewer = None
|
||||||
return redirect(url_for('index'))
|
return redirect(url_for('index'))
|
||||||
|
|
||||||
|
@app.route('/api/about')
|
||||||
|
def api_about():
|
||||||
|
return jsonify(service='Forget', version=version.version)
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
<meta name='og:type' content='website' />
|
<meta name='og:type' content='website' />
|
||||||
<meta name='twitter:card' content='summary' />
|
<meta name='twitter:card' content='summary' />
|
||||||
<meta name='twitter:site:id' content='808418'/>
|
<meta name='twitter:site:id' content='808418'/>
|
||||||
|
<script async src="{{ st('version.js') }}"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<header>
|
<header>
|
||||||
|
@ -27,7 +28,7 @@
|
||||||
</header>
|
</header>
|
||||||
{% block body %}{% endblock %}
|
{% block body %}{% endblock %}
|
||||||
<footer>
|
<footer>
|
||||||
<p>Forget {{version or "dev"}}</p>
|
<p id='ident'>Forget</p>
|
||||||
<p>A <a href="https://twitter.com/codl">codl</a> joint</p>
|
<p>A <a href="https://twitter.com/codl">codl</a> joint</p>
|
||||||
<p><a href="https://github.com/codl/forget">Code on Github</a></p>
|
<p><a href="https://github.com/codl/forget">Code on Github</a></p>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
Loading…
Reference in New Issue