Skip to content

Commit

Permalink
create meta-title component
Browse files Browse the repository at this point in the history
  • Loading branch information
ooloth committed Jun 1, 2023
1 parent 5acbf5f commit 51d1a66
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/_includes/components/meta-title.webc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<!-- see: https://11ty.webc.fun/recipes/webc-inside-your-head/ -->

<script webc:type="js" webc:is="template">
// If the current page's frontmatter includes a "title", put it before the site title
const metaTitle = title ? `${title} | ${$data.site.title}` : `${$data.site.title}`

return `<title>${metaTitle}</title>`
</script>

0 comments on commit 51d1a66

Please sign in to comment.