Loading projects...
@@ -121,7 +136,7 @@
d="M0 1.146C0 .513.526 0 1.175 0h13.65C15.474 0 16 .513 16 1.146v13.708c0 .633-.526 1.146-1.175 1.146H1.175C.526 16 0 15.487 0 14.854zm4.943 12.248V6.169H2.542v7.225zm-1.2-8.212c.837 0 1.358-.554 1.358-1.248-.015-.709-.52-1.248-1.342-1.248S2.4 3.226 2.4 3.934c0 .694.521 1.248 1.327 1.248zm4.908 8.212V9.359c0-.216.016-.432.08-.586.173-.431.568-.878 1.232-.878.869 0 1.216.662 1.216 1.634v3.865h2.401V9.25c0-2.22-1.184-3.252-2.764-3.252-1.274 0-1.845.7-2.165 1.193v.025h-.016l.016-.025V6.169h-2.4c.03.678 0 7.225 0 7.225z" />
-
+
`;
};
+ const setMetaContent = (selector, content) => {
+ const element = document.querySelector(selector);
+ if (!element || !content) {
+ return;
+ }
+
+ element.setAttribute("content", content);
+ };
+
+ const setCanonicalHref = (href) => {
+ const canonical = document.querySelector("link[rel='canonical']");
+ if (!canonical || !href) {
+ return;
+ }
+
+ canonical.setAttribute("href", href);
+ };
+
+ const updateEntryMeta = (entry) => {
+ const baseUrl = "https://sowinski.dev";
+ const title = `${entry.title} | Braeden Sowinski`;
+ const description = entry.summary || "Project entry or update from Braeden Sowinski.";
+ const url = `${baseUrl}/entry.html?type=${encodeURIComponent(entry.type)}&slug=${encodeURIComponent(entry.slug)}`;
+ const image = "https://avatars.githubusercontent.com/u/48144618?v=4";
+
+ document.title = title;
+ setCanonicalHref(url);
+ setMetaContent("meta[name='description']", description);
+ setMetaContent("meta[property='og:title']", title);
+ setMetaContent("meta[property='og:description']", description);
+ setMetaContent("meta[property='og:url']", url);
+ setMetaContent("meta[property='og:image']", image);
+ setMetaContent("meta[name='twitter:title']", title);
+ setMetaContent("meta[name='twitter:description']", description);
+ setMetaContent("meta[name='twitter:image']", image);
+ };
+
const renderLinks = (entry, className) => {
const links = [];
links.push(`