Skip to content

Commit

Permalink
add og:type meta tag
Browse files Browse the repository at this point in the history
  • Loading branch information
dbushell committed Oct 31, 2024
1 parent 6c1ff14 commit ef5d826
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion components/my-app.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,24 @@
if (props.title) {
longTitle = `${props.title}${longTitle}`;
}
let ogType = "";
if (/\d{4}(\/|-)\d{2}\1\d{2}/.test(href)) {
ogType = "article";
}
</script>

<ssr-fragment portal="head">
<title>{{longTitle}}</title>
<link rel="canonical" href="https://dbushell.com{{href}}" />
<meta name="author" content="David Bushell" />
<meta name="description" content="{{pageDescription}}" />
<meta name="fediverse:creator" content="@[email protected]" />
<meta property="og:title" content="{{shortTitle}}" />
<meta property="og:url" content="https://dbushell.com{{href}}" />
<meta property="og:description" content="{{pageDescription}}" />
<meta property="og:image" content="https://dbushell.com/assets/icons/512x512.png" />
<meta property="og:site_name" content="dbushell.com" />
<meta name="fediverse:creator" content="@[email protected]" />
<ssr-if condition="ogType"><meta property="og:type" content="{{ogType}}" /></ssr-if>
<script type="module" src="/assets/scripts/head.js?v={{deployHash}}"></script>
</ssr-fragment>

Expand Down

0 comments on commit ef5d826

Please sign in to comment.