mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-10-02 14:18:13 +08:00
More website loading speed and code improvements
This commit is contained in:
@@ -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) -%}
|
||||
|
||||
@@ -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 -#}
|
||||
{#- ===================== -#}
|
||||
|
||||
@@ -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) -%}
|
||||
|
||||
@@ -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 -%}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user