Skip to content
Snippets Groups Projects
Unverified Commit 7b3d9f28 authored by Sébastien Thuret's avatar Sébastien Thuret
Browse files

Added version number for assets that may change

parent 7df304d9
No related branches found
No related tags found
No related merge requests found
import os import os
from functools import wraps from functools import wraps
import pkg_resources
from flask import Flask, abort, jsonify, render_template, request from flask import Flask, abort, jsonify, render_template, request
from flask_swagger import swagger from flask_swagger import swagger
from flask_swagger_ui import get_swaggerui_blueprint from flask_swagger_ui import get_swaggerui_blueprint
...@@ -176,6 +177,7 @@ def create_app(args): ...@@ -176,6 +177,7 @@ def create_app(args):
frontendTimeout=args.frontend_timeout, frontendTimeout=args.frontend_timeout,
api_keys=args.api_keys, api_keys=args.api_keys,
web_version=os.environ.get("LT_WEB") is not None, web_version=os.environ.get("LT_WEB") is not None,
version=pkg_resources.require("LibreTranslate")[0].version
) )
@app.route("/javascript-licenses", methods=["GET"]) @app.route("/javascript-licenses", methods=["GET"])
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
<link rel="stylesheet" href="{{ url_for('static', filename='css/materialize.min.css') }}"> <link rel="stylesheet" href="{{ url_for('static', filename='css/materialize.min.css') }}">
<link rel="stylesheet" href="{{ url_for('static', filename='css/material-icons.css') }}" /> <link rel="stylesheet" href="{{ url_for('static', filename='css/material-icons.css') }}" />
<link rel="stylesheet" href="{{ url_for('static', filename='css/prism.min.css') }}" /> <link rel="stylesheet" href="{{ url_for('static', filename='css/prism.min.css') }}" />
<link rel="stylesheet" href="{{ url_for('static', filename='css/main.css') }}?t=2" /> <link rel="stylesheet" href="{{ url_for('static', filename='css/main.css') }}?v={{ version }}" />
{% if gaId %} {% if gaId %}
<!-- Global site tag (gtag.js) - Google Analytics --> <!-- Global site tag (gtag.js) - Google Analytics -->
...@@ -245,8 +245,7 @@ ...@@ -245,8 +245,7 @@
window.Prism.manual = true; window.Prism.manual = true;
// @license-end // @license-end
</script> </script>
<script src="{{ url_for('static', filename='js/prism.min.js') }}"></script> <script src="{{ url_for('static', filename='js/prism.min.js') }}"></script>
<script src="{{ url_for('static', filename='js/app.js') }}"></script> <script src="{{ url_for('static', filename='js/app.js') }}?v={{ version }}"></script>
</body> </body>
</html> </html>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment