parent
6387b4d92a
commit
1cce3ddc89
3 changed files with 9 additions and 4 deletions
|
|
@ -1,6 +1,7 @@
|
||||||
import { defineConfig } from "astro/config";
|
import { defineConfig } from "astro/config";
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
|
site: "https://familyfed.ie",
|
||||||
output: "static",
|
output: "static",
|
||||||
outDir: "dist",
|
outDir: "dist",
|
||||||
build: {
|
build: {
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,10 @@ const {
|
||||||
parabolaSettings = { masonry: "0", magazine: "0", mobile: "1", fitvids: "1" },
|
parabolaSettings = { masonry: "0", magazine: "0", mobile: "1", fitvids: "1" },
|
||||||
} = Astro.props;
|
} = Astro.props;
|
||||||
const parabolaSettingsScript = `var parabola_settings = ${JSON.stringify(parabolaSettings)};`;
|
const parabolaSettingsScript = `var parabola_settings = ${JSON.stringify(parabolaSettings)};`;
|
||||||
const canonicalUrl = canonical ?? pathname;
|
const siteOrigin = Astro.site?.origin ?? "https://familyfed.ie";
|
||||||
|
const absoluteUrl = (value) => value ? new URL(value, siteOrigin).toString() : undefined;
|
||||||
|
const canonicalUrl = absoluteUrl(canonical ?? pathname);
|
||||||
|
const imageUrl = absoluteUrl(image);
|
||||||
const metaTitle = title
|
const metaTitle = title
|
||||||
.replace(/–|–/g, "-")
|
.replace(/–|–/g, "-")
|
||||||
.replace(/‘|’|‘|’/g, "'")
|
.replace(/‘|’|‘|’/g, "'")
|
||||||
|
|
@ -27,7 +30,6 @@ const metaTitle = title
|
||||||
<head>
|
<head>
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||||
<slot name="head" />
|
|
||||||
<title set:html={title} />
|
<title set:html={title} />
|
||||||
{description && <meta name="description" content={description} />}
|
{description && <meta name="description" content={description} />}
|
||||||
{robots && <meta name="robots" content={robots} />}
|
{robots && <meta name="robots" content={robots} />}
|
||||||
|
|
@ -35,7 +37,7 @@ const metaTitle = title
|
||||||
<meta property="og:title" content={metaTitle} />
|
<meta property="og:title" content={metaTitle} />
|
||||||
{description && <meta property="og:description" content={description} />}
|
{description && <meta property="og:description" content={description} />}
|
||||||
{canonicalUrl && <meta property="og:url" content={canonicalUrl} />}
|
{canonicalUrl && <meta property="og:url" content={canonicalUrl} />}
|
||||||
{image && <meta property="og:image" content={image} />}
|
{imageUrl && <meta property="og:image" content={imageUrl} />}
|
||||||
<meta property="og:type" content={ogType} />
|
<meta property="og:type" content={ogType} />
|
||||||
<meta name="twitter:card" content="summary_large_image" />
|
<meta name="twitter:card" content="summary_large_image" />
|
||||||
<link rel="icon" href="/assets/icons/familyfed-favicon.png" type="image/png" />
|
<link rel="icon" href="/assets/icons/familyfed-favicon.png" type="image/png" />
|
||||||
|
|
@ -50,6 +52,7 @@ const metaTitle = title
|
||||||
<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" 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" 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>
|
<script is:inline type="text/javascript" src="/assets/theme/parabola/js/frontend.js?ver=2.4.1" id="parabola-frontend-js"></script>
|
||||||
|
<slot name="head" />
|
||||||
{canonicalUrl && <link rel="canonical" href={canonicalUrl} />}
|
{canonicalUrl && <link rel="canonical" href={canonicalUrl} />}
|
||||||
</head>
|
</head>
|
||||||
<body class={bodyClass}>
|
<body class={bodyClass}>
|
||||||
|
|
|
||||||
|
|
@ -257,6 +257,7 @@ import mainHtml from "../content/pages/events.html?raw";
|
||||||
const end = new Date(today.getFullYear() + 1, today.getMonth() + 1, 0);
|
const end = new Date(today.getFullYear() + 1, today.getMonth() + 1, 0);
|
||||||
const events = eventsBetween(start, end);
|
const events = eventsBetween(start, end);
|
||||||
const stamp = new Date().toISOString().replace(/[-:]/g, "").replace(/\.\d{3}Z$/, "Z");
|
const stamp = new Date().toISOString().replace(/[-:]/g, "").replace(/\.\d{3}Z$/, "Z");
|
||||||
|
const siteUrl = "https://familyfed.ie";
|
||||||
const lines = [
|
const lines = [
|
||||||
"BEGIN:VCALENDAR",
|
"BEGIN:VCALENDAR",
|
||||||
"VERSION:2.0",
|
"VERSION:2.0",
|
||||||
|
|
@ -275,7 +276,7 @@ import mainHtml from "../content/pages/events.html?raw";
|
||||||
`SUMMARY:${escapeIcs(event.title)}`,
|
`SUMMARY:${escapeIcs(event.title)}`,
|
||||||
`DESCRIPTION:${escapeIcs(event.details)}`,
|
`DESCRIPTION:${escapeIcs(event.details)}`,
|
||||||
`LOCATION:${escapeIcs(event.location)}`,
|
`LOCATION:${escapeIcs(event.location)}`,
|
||||||
`URL:https://familyfed.bcgen.ie${event.url}`,
|
`URL:${siteUrl}${event.url}`,
|
||||||
"END:VEVENT",
|
"END:VEVENT",
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue