-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from Friends-of-Monika/feature/page-title
Add title, description and OGP
- Loading branch information
Showing
8 changed files
with
95 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<script lang="ts"> | ||
import { page } from "$app/stores"; | ||
// OpenGraph generic parameters | ||
export let ogpTitle: string = $page.data.ogp?.title ?? $page.data.meta?.title; | ||
export let ogpUrl = $page.url.toString(); | ||
export let ogpType = "website"; | ||
export let ogpDescription: string = $page.data.ogp?.description ?? $page.data.meta?.description; | ||
export let ogpImage: string = $page.data.ogp?.image ?? $page.data.meta?.image; | ||
// Twitter-specific parameters | ||
export let twiCard: string | undefined = undefined; | ||
export let twiDomain = $page.url.hostname; | ||
export let twiUrl = ogpUrl; | ||
export let twiTitle = ogpTitle; | ||
export let twiDescription = ogpDescription; | ||
export let twiImage = ogpImage; | ||
</script> | ||
|
||
<svelte:head> | ||
<meta property="og:url" content={ogpUrl} /> | ||
<meta property="og:type" content={ogpType} /> | ||
{#if ogpTitle}<meta property="og:title" content={ogpTitle} />{/if} | ||
{#if ogpDescription}<meta property="og:description" content={ogpDescription} />{/if} | ||
{#if ogpImage}<meta property="og:image" content={ogpImage} />{/if} | ||
|
||
{#if twiCard}<meta name="twitter:card" content={twiCard} />{/if} | ||
<meta property="twitter:domain" content={twiDomain} /> | ||
<meta property="twitter:url" content={twiUrl} /> | ||
{#if twiTitle}<meta name="twitter:title" content={twiTitle} />{/if} | ||
{#if twiDescription}<meta name="twitter:description" content={twiDescription} />{/if} | ||
{#if twiImage}<meta name="twitter:image" content={twiImage} />{/if} | ||
</svelte:head> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<script lang="ts"> | ||
import { page } from "$app/stores"; | ||
export let title: string = $page.data.meta?.title ?? $page.data.ogp?.title; | ||
export let description: string = $page.data.meta?.description ?? $page.data.ogp?.description; | ||
export let keywords: string[] = $page.data.meta?.keywords ?? []; | ||
</script> | ||
|
||
<svelte:head> | ||
{#if title} | ||
<title>{title} • MAS Web Utils</title> | ||
{:else} | ||
<title>MAS Web Utils</title> | ||
{/if} | ||
|
||
{#if description}<meta name="description" content={description} />{/if} | ||
{#if keywords?.length}<meta name="keywords" content={keywords.join(", ")} />{/if} | ||
</svelte:head> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
export function load() { | ||
return { | ||
meta: { | ||
title: "Home", | ||
description: "🧰 A collection of useful tools for Monika After Story you can use online!" | ||
}, | ||
ogp: { | ||
title: "Monika After Story Web Utils" | ||
} | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export function load() { | ||
return { | ||
meta: { | ||
title: "JSON Validator", | ||
description: "🔧 An online tool to quickly check your spritepack JSON files" | ||
} | ||
}; | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.