More website loading speed and code improvements

This commit is contained in:
Keavon Chambers
2025-01-08 20:49:42 -08:00
parent 68e6bec9b5
commit ae2637e08e
44 changed files with 833 additions and 898 deletions
+1 -1
View File
@@ -6,7 +6,7 @@
{%- set meta_image = page.extra.banner_png | safe -%}
{%- set meta_article_type = true -%}
{%- set meta_description = page.extra.summary | default(value = page.content | striptags | safe | linebreaksbr | replace(from = "<br>", to = " ") | replace(from = " ", to = " ") | trim | truncate(length = 200)) -%}
{%- set css = ["/article.css"] -%}
{%- set css = ["/template/article.css", "/layout/reading-material.css"] -%}
{%- endblock head -%}
{%- block content -%}{%- set page = page | default(value = section) -%}
+6 -4
View File
@@ -32,9 +32,9 @@
{#- ON EVERY PAGE OF THE SITE: CSS AND JS TO LOAD EITHER AS A LINK OR INLINE -#}
{#- ======================================================================== -#}
{%- set global_linked_css = ["/base.css", "https://fonts.googleapis.com/css2?family=Bona+Nova:wght@700&family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap"] -%}
{%- set global_linked_css = ["https://fonts.googleapis.com/css2?family=Bona+Nova:wght@700&family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap"] -%}
{%- set global_linked_js = [] -%}
{%- set global_css = [] -%}
{%- set global_css = ["/base.css"] -%}
{%- set global_js = ["/js/text-justification.js", "/js/navbar.js"] -%}
{#- RETRIEVE FROM TEMPLATES AND PAGES: CSS AND JS TO LOAD EITHER AS A LINK OR INLINE -#}
@@ -74,11 +74,13 @@
{#- INSERT INLINE CSS CODE -#}
{#- ====================== -#}
{%- for path in css_list %}
{%- if css_list | length > 0 %}
{{ "<" ~ "style>" | safe }}
{% for path in css_list -%}
{{ load_data(path = path) | safe }}
{% endfor -%}
{{ "</" ~ "style>" | safe }}
{%- endfor %}
{%- endif %}
{#- INSERT INLINE JS CODE -#}
{#- ===================== -#}
+1 -1
View File
@@ -3,7 +3,7 @@
{%- block head -%}{%- set page = page | default(value = section) -%}
{%- set title = page.title -%}
{%- set meta_title = "Graphite Blog" -%}
{%- set css = ["/blog.css"] -%}
{%- set css = ["/page/blog.css"] -%}
{%- endblock head -%}
{%- block content -%}{%- set page = page | default(value = section) -%}
+1 -1
View File
@@ -5,7 +5,7 @@
{%- set meta_article_type = true -%}
{%- set meta_description = page.extra.summary | default(value = page.content | striptags | safe | linebreaksbr | replace(from = "<br>", to = " ") | replace(from = " ", to = " ") | trim | truncate(length = 200)) -%}
{%- set linked_css = ["/syntax-highlighting.css"] -%}
{%- set css = ["/book.css"] -%}
{%- set css = ["/template/book.css", "/layout/reading-material.css", "/component/code-snippet.css"] -%}
{%- set js = ["/js/book.js"] -%}
{%- endblock head -%}