From 12c34f378284d8c56dc450efb498b2cc5fbda8e6 Mon Sep 17 00:00:00 2001
From: Quincy Morgan <2046746+quincylvania@users.noreply.github.com>
Date: Mon, 22 Jul 2024 10:51:11 -0400
Subject: [PATCH] Improve performance of page_meta
---
_includes/page_meta.html | 25 +++++--------------------
1 file changed, 5 insertions(+), 20 deletions(-)
diff --git a/_includes/page_meta.html b/_includes/page_meta.html
index ae90f11..16ca18d 100644
--- a/_includes/page_meta.html
+++ b/_includes/page_meta.html
@@ -1,34 +1,19 @@
{% if page.title or page.temp_title %} {{page.temp_title | default: page.title}} | {% endif %} {{site.title}}
-{% assign description= page.content | strip_html | markdownify | strip_html | strip_newlines | truncate: 210 -%}
+{% assign description = page.content | strip_html | markdownify | strip_html | strip_newlines | truncate: 210 -%}
{%- if page.temp_blurb or page.blurb -%}
{%- assign description=page.temp_blurb | default: page.blurb | strip_html | markdownify | strip_html -%}
{% endif %}
-{% assign image=page.social_banner -%}
-{%- unless image -%}
- {% assign image=page.sign -%}
-{%- endunless -%}
-{%- unless image -%}
- {% assign image=page.image -%}
-{%- endunless -%}
-{%- unless image %}
- {%- assign image=page.cover -%}
-{%- endunless -%}
-{%- unless image -%}
- {%- assign image=page.logo -%}
-{%- endunless -%}
-{%- unless image -%}
- {%- if page.youtube %}
- {%- assign image = "https://i3.ytimg.com/vi/" | append: page.youtube | append: "/hqdefault.jpg" -%}
- {% endif %}
-{%- endunless -%}
+{%- if page.youtube -%}
+ {%- assign youtube_image = "https://i3.ytimg.com/vi/" | append: page.youtube | append: "/hqdefault.jpg" -%}
+{%- endif -%}
+{%- assign image=page.social_banner | default: page.sign | default: page.image | default: page.cover | default: page.logo | default: youtube_image -%}
{%- if image %}
{% endif %}
-