zola/test_site/templates/index.html
Hannu Hartikainen 6708f7637c
Implement get_file_hash (#1044)
* Fix get_url(cachebust=true)

The previous implementation looked for static files in the wrong place.
Look in static_path, output_path and content_path. If file can't be
found in any of them, print a warning to stderr and fall back to using
a timestamp.

Add a test to ensure it also works in practice, not just in theory.

* Implement get_file_hash
2020-06-09 22:38:29 +02:00

30 lines
1.1 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="{{ config.description }}">
<meta name="author" content="{{ config.extra.author.name }}">
<link href="https://fonts.googleapis.com/css?family=Fira+Mono|Fira+Sans|Merriweather" rel="stylesheet">
<link href="{{ get_url(path="/site.css", cachebust=true) | safe }}" rel="stylesheet">
<title>{{ config.title }}</title>
</head>
<body>
<div class="content">
{% block content %}
<div class="list-posts">
{% for page in section.pages %}
<article>
<h3 class="post__title"><a href="{{ page.permalink }}">{{ page.title }}</a></h3>
</article>
{% endfor %}
</div>
{% endblock content %}
</div>
<script src="{{ get_url(path="scripts/hello.js") | safe }}"
integrity="sha384-{{ get_file_hash(path="scripts/hello.js") }}"></script>
</body>
</html>