feat: add dynamic timestamp to CSS cache-busting
All checks were successful
Build and Deploy Static Site / build (push) Successful in 1m2s
All checks were successful
Build and Deploy Static Site / build (push) Successful in 1m2s
Included a timestamp in the static site generation to dynamically append to the CSS file version parameter. This ensures that users always get the latest CSS changes, reducing cache-related issues.
This commit is contained in:
parent
009ab87552
commit
9e8b54083a
2 changed files with 5 additions and 2 deletions
5
main.py
5
main.py
|
@ -64,7 +64,10 @@ def render_template_to_file(template_name, output_name, **kwargs):
|
||||||
|
|
||||||
def generate_static_site(development_mode=False):
|
def generate_static_site(development_mode=False):
|
||||||
# Common context
|
# Common context
|
||||||
kwargs = {}
|
kwargs = {
|
||||||
|
"timestamp": int(datetime.datetime.now().timestamp()),
|
||||||
|
}
|
||||||
|
|
||||||
if development_mode:
|
if development_mode:
|
||||||
kwargs.update(
|
kwargs.update(
|
||||||
{
|
{
|
||||||
|
|
|
@ -47,7 +47,7 @@
|
||||||
<link rel="icon" type="image/png" href="assets/img/logo_inv_grad.png" />
|
<link rel="icon" type="image/png" href="assets/img/logo_inv_grad.png" />
|
||||||
<title>{% block title %}{% endblock %} - Private.coffee</title>
|
<title>{% block title %}{% endblock %} - Private.coffee</title>
|
||||||
<link rel="stylesheet" href="assets/dist/css/bootstrap.min.css" />
|
<link rel="stylesheet" href="assets/dist/css/bootstrap.min.css" />
|
||||||
<link rel="stylesheet" href="assets/css/base.css?v=24080401" />
|
<link rel="stylesheet" href="assets/css/base.css?v={{ timestamp }}" />
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
|
Loading…
Reference in a new issue