From 508bb7a4dadd4eb4d0f242591876b761494668e2 Mon Sep 17 00:00:00 2001 From: Workshop Bot Date: Thu, 11 Jun 2026 12:39:57 +0000 Subject: [PATCH] Polish accessibility and SEO metadata --- content/blog/2016/happy-new-year.md | 2 +- src/components/SiteLayout.astro | 32 +++++++++++++++---- src/components/SiteNav.astro | 4 +-- src/content/pages/index.html | 10 +++--- src/pages/about.astro | 2 ++ .../blog/[year]/[month]/[day]/[slug].astro | 31 ++++++++++++++++-- src/pages/contact.astro | 1 + src/pages/events.astro | 6 ++-- src/pages/index.astro | 2 ++ src/pages/services.astro | 2 ++ src/pages/speeches/index.astro | 1 + src/pages/the-founders.astro | 2 ++ src/pages/videos.astro | 2 ++ 13 files changed, 76 insertions(+), 21 deletions(-) diff --git a/content/blog/2016/happy-new-year.md b/content/blog/2016/happy-new-year.md index 1a1d6dd9..667dcd23 100644 --- a/content/blog/2016/happy-new-year.md +++ b/content/blog/2016/happy-new-year.md @@ -9,7 +9,7 @@ categories: tags: [] --- -

Happy New Year 2016!

+
Happy New Year 2016 greeting

Happy New Year 2016!

Let go of the past year and bring on the new! Check out this article by Dplife.info:

2015 Wasn’t What I Thought It Would Be 

…and That’s Okay.

diff --git a/src/components/SiteLayout.astro b/src/components/SiteLayout.astro index 210b2e0c..82344a8e 100644 --- a/src/components/SiteLayout.astro +++ b/src/components/SiteLayout.astro @@ -4,22 +4,40 @@ import SiteNav from "./SiteNav.astro"; const { title, + description, bodyClass, - pathname, + pathname = "/", canonical, + robots = "max-image-preview:large", + ogType = "website", + image = "/assets/uploads/2013/10/BannerFamilyFed_23_10c1.jpg", parabolaSettings = { masonry: "0", magazine: "0", mobile: "1", fitvids: "1" }, } = Astro.props; const parabolaSettingsScript = `var parabola_settings = ${JSON.stringify(parabolaSettings)};`; +const canonicalUrl = canonical ?? pathname; +const metaTitle = title + .replace(/–|–/g, "-") + .replace(/‘|’|‘|’/g, "'") + .replace(/“|”|“|”/g, '"') + .replace(/&/g, "&"); --- - + - <meta name="robots" content="max-image-preview:large" /> + {description && <meta name="description" content={description} />} + {robots && <meta name="robots" content={robots} />} + <meta property="og:site_name" content="FFWPU Ireland" /> + <meta property="og:title" content={metaTitle} /> + {description && <meta property="og:description" content={description} />} + {canonicalUrl && <meta property="og:url" content={canonicalUrl} />} + {image && <meta property="og:image" content={image} />} + <meta property="og:type" content={ogType} /> + <meta name="twitter:card" content="summary_large_image" /> <link rel="stylesheet" id="content-blocks-css" href="/css/block-library.css?ver=6.6.5" type="text/css" media="all" /> <link rel="stylesheet" id="pdfprnt_frontend-css" href="/assets/vendor/pdf/css/frontend.css?ver=2.4.0" type="text/css" media="all" /> <link rel="stylesheet" id="parabola-fonts-css" href="/assets/theme/parabola/fonts/fontfaces.css?ver=2.4.1" type="text/css" media="all" /> @@ -30,7 +48,7 @@ const parabolaSettingsScript = `var parabola_settings = ${JSON.stringify(parabol <script is:inline type="text/javascript" src="/js/jquery.min.js?ver=2.0.2" id="jquery-js"></script> <script is:inline type="text/javascript" id="parabola-frontend-js-extra" set:html={parabolaSettingsScript}></script> <script is:inline type="text/javascript" src="/assets/theme/parabola/js/frontend.js?ver=2.4.1" id="parabola-frontend-js"></script> - {canonical && <link rel="canonical" href={canonical} />} + {canonicalUrl && <link rel="canonical" href={canonicalUrl} />} </head> <body class={bodyClass}> <div id="toTop"> </div> @@ -39,13 +57,13 @@ const parabolaSettingsScript = `var parabola_settings = ${JSON.stringify(parabol <header id="header"> <div id="masthead"> <div id="branding" role="banner"> - <img id="bg_image" alt="FFWPU Ireland" title="FFWPU Ireland" src="/assets/uploads/2013/10/BannerFamilyFed_23_10c1.jpg" /> + <img id="bg_image" alt="Family Federation for World Peace and Unification Ireland" src="/assets/uploads/2013/10/BannerFamilyFed_23_10c1.jpg" /> <div id="header-container"> - <a href="/index.html" id="linky"></a> + <a href="/index.html" id="linky" aria-label="FFWPU Ireland home page"></a> </div> <div style="clear:both;"></div> </div> - <a id="nav-toggle"><span> </span></a> + <a id="nav-toggle" href="#access" role="button" aria-label="Toggle navigation menu"><span> </span></a> <SiteNav pathname={pathname} /> </div> <div style="clear:both;height:1px;width:1px;"> </div> diff --git a/src/components/SiteNav.astro b/src/components/SiteNav.astro index 692bb440..f3428f98 100644 --- a/src/components/SiteNav.astro +++ b/src/components/SiteNav.astro @@ -36,8 +36,8 @@ function isCurrent(item) { } --- -<nav id="access" class="jssafe" role="navigation"> - <div class="skip-link screen-reader-text"><a href="#content" title="Skip to content">Skip to content</a></div> +<nav id="access" class="jssafe" role="navigation" aria-label="Primary navigation"> + <div class="skip-link screen-reader-text"><a href="#content">Skip to content</a></div> <div class="menu"> <ul id="prime_nav" class="menu"> { diff --git a/src/content/pages/index.html b/src/content/pages/index.html index cfeb8d99..aa009f60 100644 --- a/src/content/pages/index.html +++ b/src/content/pages/index.html @@ -26,9 +26,9 @@ <div class="ribbon"></div> <div id="slider" class="nivoSlider"> <a href='/the-founders.html'> - <img src='/assets/uploads/2013/10/TrueParentsSlider.jpg' alt="" /> + <img src='/assets/uploads/2013/10/TrueParentsSlider.jpg' alt="Rev. Sun Myung Moon and Dr. Hak Ja Han Moon" /> </a> <a href='/about-us-organizations.html'> - <img src='/assets/uploads/2013/10/Little-Angels-Presentationlight1.jpg' alt="The Little Angels" title="#caption1" /> + <img src='/assets/uploads/2013/10/Little-Angels-Presentationlight1.jpg' alt="The Little Angels children's folk ballet performance" title="#caption1" /> </a> <a href='/the-founders.html'> <img src='/assets/uploads/2013/10/father-Seung-Hwa_Presentation.jpg' alt="Rev. Sun Myung Moon" title="#caption2" /> </a> </div> @@ -46,7 +46,7 @@ <div class="ppcolumn column1" id="column1"> <a href="/the-founders.html" > <div class="column-image"> - <img src="/assets/uploads/2013/10/True_Parents.jpg" id="columnImage1" alt="Founders of FFWPU International" /> + <img src="/assets/uploads/2013/10/True_Parents.jpg" id="columnImage1" alt="Rev. Sun Myung Moon and Dr. Hak Ja Han Moon, founders of FFWPU International" /> <h3 class='column-header-image'>Founders of FFWPU International</h3> </div> </a> <!-- link --> @@ -64,7 +64,7 @@ <div class="ppcolumn column2" id="column2"> <a href="/videos.html" > <div class="column-image"> - <img src="/assets/uploads/2013/10/DP-Screenshot.jpg" id="columnImage2" alt="The Divine Principle and Other teachings." /> + <img src="/assets/uploads/2013/10/DP-Screenshot.jpg" id="columnImage2" alt="Divine Principle video presentation screenshot" /> <h3 class='column-header-image'>The Divine Principle and Other teachings.</h3> </div> </a> <!-- link --> @@ -82,7 +82,7 @@ <div class="ppcolumn column3" id="column3"> <a href="/about-us-organizations.html" > <div class="column-image"> - <img src="/assets/uploads/2013/10/UPF-Prayer-Evening.jpg" id="columnImage3" alt="Activities and Organizations" /> + <img src="/assets/uploads/2013/10/UPF-Prayer-Evening.jpg" id="columnImage3" alt="UPF prayer evening gathering" /> <h3 class='column-header-image'>Activities and Organizations</h3> </div> </a> <!-- link --> diff --git a/src/pages/about.astro b/src/pages/about.astro index 9981d0be..6dd89887 100644 --- a/src/pages/about.astro +++ b/src/pages/about.astro @@ -6,8 +6,10 @@ import articleHtml from "../content/pages/about.html?raw"; <SiteLayout title="About Us – FFWPU Ireland" + description="Learn about the Family Federation for World Peace and Unification in Ireland, its teachings, and its focus on God-centered families." bodyClass="page-template page-template-templates page-template-template-twocolumns-right page-template-templatestemplate-twocolumns-right-php page page-id-29 page-parent custom-background tribe-no-js metaslider-plugin parabola-image-three caption-light meta-light parabola_triagles parabola-menu-left" pathname="/about.html" + canonical="/about.html" > <TwoColumnPage articleHtml={articleHtml} /> </SiteLayout> diff --git a/src/pages/blog/[year]/[month]/[day]/[slug].astro b/src/pages/blog/[year]/[month]/[day]/[slug].astro index e62fbdfb..d1ffec03 100644 --- a/src/pages/blog/[year]/[month]/[day]/[slug].astro +++ b/src/pages/blog/[year]/[month]/[day]/[slug].astro @@ -32,6 +32,30 @@ function slugify(value: string): string { .replace(/^-|-$/g, ""); } +function descriptionFromHtml(value: string, fallbackTitle: string): string { + const text = value + .replace(/<[^>]*>/g, " ") + .replace(/ /g, " ") + .replace(/–|–/g, "-") + .replace(/‘|’|‘|’/g, "'") + .replace(/“|”|“|”/g, '"') + .replace(/&/g, "&") + .replace(/\s+/g, " ") + .trim(); + + if (!text) { + return `${fallbackTitle} from FFWPU Ireland.`; + } + + if (text.length <= 155) { + return text; + } + + const clipped = text.slice(0, 152); + const finalSpace = clipped.lastIndexOf(" "); + return `${finalSpace > 80 ? clipped.slice(0, finalSpace) : clipped}...`; +} + function categoryHref(entry, category: string): string { if (entry.data.type === "speech") { if (entry.data.speechCollection === "mrs-hak-ja-han-moon" || category.includes("Mrs. Hak Ja Han Moon")) { @@ -92,9 +116,10 @@ const categories = entry.data.categories ?? []; const tags = entry.data.tags ?? []; const canonical = entry.data.source; const pdfHref = canonical ? `${canonical}?print=pdf` : undefined; +const description = descriptionFromHtml(entry.body ?? "", title); --- -<SiteLayout title={`${title} – FFWPU Ireland`} bodyClass={bodyClass} pathname={canonical} canonical={canonical}> +<SiteLayout title={`${title} – FFWPU Ireland`} description={description} bodyClass={bodyClass} pathname={canonical} canonical={canonical} ogType="article"> <div id="main"> <div id="forbottom"> <div style="clear:both;"> </div> @@ -133,7 +158,7 @@ const pdfHref = canonical ? `${canonical}?print=pdf` : undefined; pdfHref && ( <div class="pdfprnt-buttons pdfprnt-buttons-post pdfprnt-top-bottom-left"> <a href={pdfHref} class="pdfprnt-button pdfprnt-button-pdf" target="_blank"> - <img decoding="async" src="/assets/vendor/pdf/images/pdf.png" alt="image_pdf" title="Download PDF" /> + <img decoding="async" src="/assets/vendor/pdf/images/pdf.png" alt="Download PDF" title="Download PDF" /> </a> </div> ) @@ -143,7 +168,7 @@ const pdfHref = canonical ? `${canonical}?print=pdf` : undefined; pdfHref && ( <div class="pdfprnt-buttons pdfprnt-buttons-post pdfprnt-top-bottom-left"> <a href={pdfHref} class="pdfprnt-button pdfprnt-button-pdf" target="_blank"> - <img decoding="async" src="/assets/vendor/pdf/images/pdf.png" alt="image_pdf" title="Download PDF" /> + <img decoding="async" src="/assets/vendor/pdf/images/pdf.png" alt="Download PDF" title="Download PDF" /> </a> </div> ) diff --git a/src/pages/contact.astro b/src/pages/contact.astro index d9720ee9..33710c32 100644 --- a/src/pages/contact.astro +++ b/src/pages/contact.astro @@ -6,6 +6,7 @@ import articleHtml from "../content/pages/contact.html?raw"; <SiteLayout title="Contact – FFWPU Ireland" + description="Contact FFWPU Ireland at Unity House in Dublin city centre or email the community with questions, appointments, and event enquiries." bodyClass="page-template-default page page-id-63 custom-background tribe-no-js metaslider-plugin parabola-image-three caption-light meta-light parabola_triagles parabola-menu-left" pathname="/contact.html" canonical="/contact.html" diff --git a/src/pages/events.astro b/src/pages/events.astro index 5854e92d..cc4e05d9 100644 --- a/src/pages/events.astro +++ b/src/pages/events.astro @@ -5,13 +5,13 @@ import mainHtml from "../content/pages/events.html?raw"; <SiteLayout title="Upcoming Events – FFWPU Ireland" + description="See upcoming FFWPU Ireland community events and calendar listings." bodyClass="archive post-type-archive post-type-archive-tribe_events custom-background tribe-events-page-template tribe-no-js tribe-filter-live metaslider-plugin parabola-image-three caption-light meta-light parabola_triagles parabola-menu-left" pathname="/events.html" + canonical="/events.html" + robots="noindex, follow, max-image-preview:large" > <Fragment slot="head"> - <script is:inline> - document.head.insertAdjacentHTML("beforeend", '<meta name="robots" id="tec_noindex" content="noindex, follow" />'); - </script> <link rel="stylesheet" id="tec-variables-skeleton-css" href="/assets/vendor/events-calendar/common/src/resources/css/variables-skeleton.min.css?ver=6.3.2" type="text/css" media="all" /> <link rel="stylesheet" id="tec-variables-full-css" href="/assets/vendor/events-calendar/common/src/resources/css/variables-full.min.css?ver=6.3.2" type="text/css" media="all" /> <link rel="stylesheet" id="tribe-common-skeleton-style-css" href="/assets/vendor/events-calendar/common/src/resources/css/common-skeleton.min.css?ver=6.3.2" type="text/css" media="all" /> diff --git a/src/pages/index.astro b/src/pages/index.astro index 1ccdd7fc..dd1143d7 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -5,8 +5,10 @@ import mainHtml from "../content/pages/index.html?raw"; <SiteLayout title="FFWPU Ireland – Official website of FFWPU Ireland" + description="Official website of FFWPU Ireland, sharing teachings, activities, videos, Sunday services, and resources for families in Ireland." bodyClass="home blog custom-background tribe-no-js metaslider-plugin parabola-image-three caption-light meta-light parabola_triagles magazine-layout parabola-menu-left" pathname="/index.html" + canonical="/index.html" parabolaSettings={{ masonry: "1", magazine: "1", mobile: "1", fitvids: "1" }} > <script is:inline slot="head" type="text/javascript" src="/assets/theme/parabola/js/nivo-slider.js?ver=2.4.1" id="parabola-nivoSlider-js"></script> diff --git a/src/pages/services.astro b/src/pages/services.astro index 3ef64237..c1e99de6 100644 --- a/src/pages/services.astro +++ b/src/pages/services.astro @@ -6,8 +6,10 @@ import articleHtml from "../content/pages/services.html?raw"; <SiteLayout title="Sunday Services – FFWPU Ireland" + description="Find FFWPU Ireland Sunday service videos and archived Sunday service messages from the Dublin community." bodyClass="page-template-default page page-id-33 custom-background tribe-no-js metaslider-plugin parabola-image-three caption-light meta-light parabola_triagles parabola-menu-left" pathname="/services.html" + canonical="/services.html" > <TwoColumnPage articleHtml={articleHtml} /> </SiteLayout> diff --git a/src/pages/speeches/index.astro b/src/pages/speeches/index.astro index 47f0c1a0..0165085b 100644 --- a/src/pages/speeches/index.astro +++ b/src/pages/speeches/index.astro @@ -10,6 +10,7 @@ const categories = uniqueSorted(speeches.flatMap((speech) => speech.categories.l <SiteLayout title="Speeches Archive – FFWPU Ireland" + description="Search the FFWPU Ireland archive of speeches by Rev. Sun Myung Moon and Dr. Hak Ja Han Moon by year, speaker, category, and text." bodyClass="page-template page-template-templates page-template-template-onecolumn page-template-templatestemplate-onecolumn-php page custom-background tribe-no-js metaslider-plugin parabola-image-three caption-light meta-light parabola_triagles parabola-menu-left" pathname="/speeches/" canonical="/speeches/" diff --git a/src/pages/the-founders.astro b/src/pages/the-founders.astro index dd3407ea..6331081e 100644 --- a/src/pages/the-founders.astro +++ b/src/pages/the-founders.astro @@ -6,8 +6,10 @@ import articleHtml from "../content/pages/the-founders.html?raw"; <SiteLayout title="The Founders – FFWPU Ireland" + description="Read about Rev. Sun Myung Moon and Dr. Hak Ja Han Moon, the founders of the Family Federation for World Peace and Unification." bodyClass="page-template-default page page-id-71 custom-background tribe-no-js metaslider-plugin parabola-image-three caption-light meta-light parabola_triagles parabola-menu-left" pathname="/the-founders.html" + canonical="/the-founders.html" > <link slot="head" rel="stylesheet" id="su-shortcodes-css" href="/assets/vendor/shortcodes/includes/css/shortcodes.css?ver=7.3.1" type="text/css" media="all" /> <TwoColumnPage articleHtml={articleHtml} /> diff --git a/src/pages/videos.astro b/src/pages/videos.astro index 8934c73e..a6f3f19e 100644 --- a/src/pages/videos.astro +++ b/src/pages/videos.astro @@ -6,8 +6,10 @@ import articleHtml from "../content/pages/videos.html?raw"; <SiteLayout title="Videos – FFWPU Ireland" + description="Watch FFWPU Ireland videos on faith, family, the Divine Principle, Rev. Sun Myung Moon, and inspirational teaching resources." bodyClass="page-template-default page page-id-44 custom-background tribe-no-js metaslider-plugin parabola-image-three caption-light meta-light parabola_triagles parabola-menu-left" pathname="/videos.html" + canonical="/videos.html" > <TwoColumnPage articleHtml={articleHtml} /> </SiteLayout>