script to change title on runtime, remove og image

This commit is contained in:
Ayo 2023-02-15 09:32:49 +01:00
parent 3a32549952
commit 5754fe1907
3 changed files with 19 additions and 7 deletions

View file

@ -2,8 +2,14 @@
<ul role="list" style="list-style:none"> <ul role="list" style="list-style:none">
<li>2022 &#169; <strong>Ayo Ayco</strong>. All Rights Reserved</li> <li>2022 &#169; <strong>Ayo Ayco</strong>. All Rights Reserved</li>
<li><strong>Ayo Ayco</strong> | Software Engineer + Web Developer</li> <li><strong>Ayo Ayco</strong> | Software Engineer + Web Developer</li>
<li style="display:none">Find me on <a rel="me" href="https://fosstodon.org/@ayo">Mastodon</a></li> <li style="display:none">
<li>Find me on the <a rel="me" href="https://social.ayco.io/@ayo">#Fediverse</a></li> Find me on <a rel="me" href="https://fosstodon.org/@ayo">Mastodon</a>
</li>
<li>
Find me on the <a rel="me" href="https://social.ayco.io/@ayo"
>#Fediverse</a
>
</li>
<li> <li>
Missing old content? I moved <a href="https://classic.ayco.io" Missing old content? I moved <a href="https://classic.ayco.io"
>my previous site</a >my previous site</a

View file

@ -6,13 +6,16 @@ export interface Props {
const defaultDescription = const defaultDescription =
"Ayo Ayco is a professional software engineer specializing in web development with a decade of experience building web applications for both private businesses and government-funded high-impact projects utilizing web technologies, IoT, data viz/insights, remote sensing, and GIS"; "Ayo Ayco is a professional software engineer specializing in web development with a decade of experience building web applications for both private businesses and government-funded high-impact projects utilizing web technologies, IoT, data viz/insights, remote sensing, and GIS";
let { title, description = defaultDescription } = Astro.props; let {
title = "Ayo Ayco | Software Engineer, Web Developer, Consultant",
description = defaultDescription,
} = Astro.props;
const baseURL = "https://ayo.ayco.io"; const baseURL = "https://ayo.ayco.io";
--- ---
<head> <head>
<title>{`${title} | Ayo Ayco | Software Engineer + Web Developer`}</title> <title>{title}</title>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<meta name="viewport" content="width=device-width" /> <meta name="viewport" content="width=device-width" />
<meta name="generator" content={Astro.generator} /> <meta name="generator" content={Astro.generator} />
@ -34,9 +37,12 @@ const baseURL = "https://ayo.ayco.io";
<meta property="og:title" content={title} /> <meta property="og:title" content={title} />
<meta property="og:type" content="website" /> <meta property="og:type" content="website" />
<meta property="og:url" content={baseURL + Astro.url.pathname} /> <meta property="og:url" content={baseURL + Astro.url.pathname} />
<meta property="og:image" content="/ayo.png" />
<meta property="og:image:alt" content={description} />
<meta property="og:description" content={description} /> <meta property="og:description" content={description} />
<link rel="shortcut icon" type="image/png" href="/favicon.ico" /> <link rel="shortcut icon" type="image/png" href="/favicon.ico" />
<script>
const title = document.querySelector("title");
if (title && !title.textContent?.includes("Ayo Ayco"))
title.textContent = title.textContent + " | Ayo Ayco";
</script>
</head> </head>

View file

@ -4,7 +4,7 @@ import Card from "../components/Card.astro";
import Footer from "../components/Footer.astro"; import Footer from "../components/Footer.astro";
--- ---
<Layout title="Home"> <Layout>
<section class="highlighted-section"> <section class="highlighted-section">
<div class="highlighted-section__content"> <div class="highlighted-section__content">
<h1 title="Ayo Ayco | Software Engineer + Web Developer"> <h1 title="Ayo Ayco | Software Engineer + Web Developer">