Attempt to bundle some contrib static files to reduce network requests

This commit is contained in:
Jake Howard 2023-10-06 22:42:00 +01:00
parent 8c3fe1da8b
commit d27504d46f
Signed by: jake
GPG key ID: 57AFB45680EDD477
8 changed files with 10 additions and 11 deletions

View file

@ -20,8 +20,6 @@ mkcontrib elevator-js node_modules/elevator.js/demo/music/*
mkcontrib shareon node_modules/shareon/dist/{shareon.iife.*,shareon.min.css*}
mkcontrib fira-code node_modules/@fontsource/fira-code/latin.css
mkcontrib fira-code/files node_modules/@fontsource/fira-code/files/fira-code-latin-*
mkcontrib htmx node_modules/htmx.org/dist/{htmx.min.js,ext}
mkcontrib glightbox node_modules/glightbox/dist/css/glightbox.min.css
curl -sf -L https://raw.githubusercontent.com/genmon/aboutfeeds/main/tools/pretty-feed-v3.xsl -o $CONTRIB_DIR/pretty-feed-v3.xsl

View file

@ -2,6 +2,8 @@ const Elevator = require("elevator.js");
const debounce = require("lodash.debounce");
const throttle = require("lodash.throttle");
require("htmx.org");
const HERO = document.querySelector("section.hero");
const ROOT = document.querySelector(":root");

View file

@ -1,3 +1,4 @@
require("lite-youtube-embed");
const GLightbox = require("glightbox");
window.addEventListener("load", () => {

View file

@ -1 +0,0 @@
require("lite-youtube-embed");

View file

@ -0,0 +1,3 @@
@import "lite-youtube-embed/src/lite-yt-embed";
@import "shareon/dist/shareon.min";
@import "glightbox/dist/css/glightbox";

View file

@ -1 +0,0 @@
@import "lite-youtube-embed/src/lite-yt-embed";

View file

@ -44,12 +44,11 @@
{% footer %}
{% endcache %}
<script async defer type="text/javascript" src="{% static 'js/base.js' %}" integrity="{% sri_integrity_static 'js/base.js' %}"></script>
<script async defer type="text/javascript" src="{% static 'contrib/htmx/htmx.min.js' %}" integrity="{% sri_integrity_static 'contrib/htmx/htmx.min.js' %}"></script>
{# Not async to avoid bright flashes #}
{% sri_static "js/dark-mode.js" %}
<script async defer type="text/javascript" src="{% static 'js/base.js' %}" integrity="{% sri_integrity_static 'js/base.js' %}"></script>
{% block extra_js %}{% endblock %}
{% block plausible %}

View file

@ -23,15 +23,13 @@
{% endblock %}
{% block extra_css %}
{% sri_static "css/lite-youtube-embed.css" %}
{% sri_static "css/content-contrib.css" %}
{% sri_static "contrib/shareon/shareon.min.css" %}
{% sri_static "contrib/glightbox/glightbox.min.css" %}
<link rel="stylesheet" type="text/css" href="{% url 'code-block:styles' %}" />
{% endblock %}
{% block extra_js %}
<script async defer type="text/javascript" src="{% static 'js/lite-youtube-embed.js' %}" integrity="{% sri_integrity_static 'js/lite-youtube-embed.js' %}"></script>
<script async defer type="text/javascript" src="{% static 'js/content.js' %}" integrity="{% sri_integrity_static 'js/content.js' %}"></script>
<script async defer type="text/javascript" src="{% static 'contrib/shareon/shareon.iife.js' %}" integrity="{% sri_integrity_static 'contrib/shareon/shareon.iife.js' %}" init></script>
<script async defer type="text/javascript" src="{% static 'js/lightbox.js' %}" integrity="{% sri_integrity_static 'js/lightbox.js' %}"></script>
{% endblock %}