Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/lib/authors.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { SITE_URL } from '$lib/env'

export interface Author {
name: string
role?: string
Expand All @@ -21,12 +23,12 @@ export const authors: Record<string, Author> = {
image: 'https://github.com/rubenhensen.png',
github: 'https://github.com/rubenhensen',
linkedin: 'https://linkedin.com/in/rubenhensen',
url: 'https://postguard.eu/about',
url: `${SITE_URL}/about`,
},
}

/** Look up an author by name, falling back to a generic entry. */
export function getAuthor(name: string | undefined): Author {
if (!name) return { name: 'PostGuard', url: 'https://postguard.eu' }
return authors[name] ?? { name, url: 'https://postguard.eu/about' }
if (!name) return { name: 'PostGuard', url: SITE_URL }
return authors[name] ?? { name, url: `${SITE_URL}/about` }
}
6 changes: 3 additions & 3 deletions src/lib/components/SEO.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<script>
import { page } from '$app/state'
import { SITE_URL } from '$lib/env'

let {
title = '',
Expand All @@ -11,19 +12,18 @@
} = $props()

const siteName = 'PostGuard'
const siteUrl = 'https://postguard.eu'
const defaultDescription =
'PostGuard offers free and easy-to-use end-to-end encryption for emails and files.'
const defaultImage = '/pg_logo.png'

const canonicalUrl = $derived(
canonical ||
(page?.url?.pathname ? `${siteUrl}${page.url.pathname}` : '')
(page?.url?.pathname ? `${SITE_URL}${page.url.pathname}` : '')
)
const ogImageUrl = $derived(
(ogImage || defaultImage).startsWith('http')
? ogImage || defaultImage
: `${siteUrl}${ogImage || defaultImage}`
: `${SITE_URL}${ogImage || defaultImage}`
)
const jsonLdString = $derived(jsonLd ? JSON.stringify(jsonLd) : '')
</script>
Expand Down
2 changes: 2 additions & 0 deletions src/lib/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ function runtimeConfig(): Record<string, unknown> {
export const FF_BUSINESS = runtimeConfig().FF_BUSINESS === true
export const BUSINESS_URL =
(runtimeConfig().BUSINESS_URL as string) ?? 'https://business.postguard.eu'
export const SITE_URL: string =
(runtimeConfig().SITE_URL as string) ?? 'https://postguard.eu'

/** True on staging/dev where cryptify runs with `staging_mode = true` and
* does not actually send notification emails. The website uses this to
Expand Down
5 changes: 3 additions & 2 deletions src/routes/(app)/decrypt/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

import { _ } from 'svelte-i18n'
import { resolve } from '$app/paths'
import { SITE_URL } from '$lib/env'

import EmailView from '$lib/components/fallback/EmailView.svelte'
import ListView from '$lib/components/fallback/ListView.svelte'
Expand Down Expand Up @@ -124,12 +125,12 @@
'@context': 'https://schema.org',
'@type': 'WebApplication',
name: 'PostGuard Email Decryption',
url: 'https://postguard.eu/decrypt',
url: `${SITE_URL}/decrypt`,
description:
'Decrypt PostGuard-encrypted emails securely in your browser using the Yivi identity wallet.',
applicationCategory: 'SecurityApplication',
operatingSystem: 'Any',
isPartOf: { '@id': 'https://postguard.eu/#website' },
isPartOf: { '@id': `${SITE_URL}/#website` },
}}
/>

Expand Down
5 changes: 3 additions & 2 deletions src/routes/(app)/fileshare/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import ErrorPanel from '$lib/components/filesharing/Error.svelte'
import Done from '$lib/components/filesharing/Done.svelte'
import CrashReport from '$lib/components/filesharing/CrashReport.svelte'
import { SITE_URL } from '$lib/env'

const ATTRIBUTES: Array<AttType> = [
'pbdf.sidn-pbdf.mobilenumber.mobilenumber',
Expand Down Expand Up @@ -56,7 +57,7 @@
'@context': 'https://schema.org',
'@type': 'WebApplication',
name: 'PostGuard Secure File Sharing',
url: 'https://postguard.eu/fileshare',
url: `${SITE_URL}/fileshare`,
description:
'Send end-to-end encrypted files to anyone using their email address. Encryption happens entirely in your browser.',
applicationCategory: 'SecurityApplication',
Expand All @@ -67,7 +68,7 @@
priceCurrency: 'EUR',
},
isPartOf: {
'@id': 'https://postguard.eu/#website',
'@id': `${SITE_URL}/#website`,
},
}
</script>
Expand Down
18 changes: 9 additions & 9 deletions src/routes/(marketing)/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { _ } from 'svelte-i18n'
import { resolve } from '$app/paths'
import SEO from '$lib/components/SEO.svelte'
import { FF_BUSINESS } from '$lib/env'
import { FF_BUSINESS, SITE_URL } from '$lib/env'

let contactEl: HTMLAnchorElement

Expand All @@ -20,13 +20,13 @@
'@graph': [
{
'@type': 'WebSite',
'@id': 'https://postguard.eu/#website',
url: 'https://postguard.eu',
'@id': `${SITE_URL}/#website`,
url: SITE_URL,
name: 'PostGuard',
description:
'Free, open-source end-to-end encryption for emails and files.',
publisher: {
'@id': 'https://postguard.eu/#organization',
'@id': `${SITE_URL}/#organization`,
},
},
{
Expand All @@ -41,23 +41,23 @@
price: '0',
priceCurrency: 'EUR',
},
url: 'https://postguard.eu',
url: SITE_URL,
license: 'https://opensource.org/licenses/MIT',
softwareRequirements: 'Yivi (IRMA) app',
author: {
'@id': 'https://postguard.eu/#organization',
'@id': `${SITE_URL}/#organization`,
},
},
{
'@type': 'Organization',
'@id': 'https://postguard.eu/#organization',
'@id': `${SITE_URL}/#organization`,
name: 'PostGuard',
url: 'https://postguard.eu',
url: SITE_URL,
description:
'Free, open-source identity-based encryption for emails and files.',
logo: {
'@type': 'ImageObject',
url: 'https://postguard.eu/pg_logo.png',
url: `${SITE_URL}/pg_logo.png`,
width: 512,
height: 512,
},
Expand Down
9 changes: 5 additions & 4 deletions src/routes/(marketing)/about/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,19 @@
import { _ } from 'svelte-i18n'
import aboutImg from '$lib/assets/images/about.svg'
import SEO from '$lib/components/SEO.svelte'
import { SITE_URL } from '$lib/env'

const aboutJsonLd = {
'@context': 'https://schema.org',
'@graph': [
{
'@type': 'AboutPage',
url: 'https://postguard.eu/about',
url: `${SITE_URL}/about`,
name: 'About PostGuard',
description:
'Learn how PostGuard uses identity-based encryption and the Yivi app to provide free, easy-to-use end-to-end encryption for emails and files.',
isPartOf: {
'@id': 'https://postguard.eu/#website',
'@id': `${SITE_URL}/#website`,
},
},
{
Expand All @@ -23,13 +24,13 @@
'@type': 'ListItem',
position: 1,
name: 'Home',
item: 'https://postguard.eu',
item: SITE_URL,
},
{
'@type': 'ListItem',
position: 2,
name: 'About PostGuard',
item: 'https://postguard.eu/about',
item: `${SITE_URL}/about`,
},
],
},
Expand Down
13 changes: 7 additions & 6 deletions src/routes/(marketing)/addons/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
// import { fade } from 'svelte/transition'
import { Tween } from 'svelte/motion'
import { cubicOut } from 'svelte/easing'
import { SITE_URL } from '$lib/env'

import tbLogo from '$lib/assets/images/tb_logo.svg'
import olLogo from '$lib/assets/images/ol_logo.svg'
Expand All @@ -25,13 +26,13 @@
'@type': 'ListItem',
position: 1,
name: 'Home',
item: 'https://postguard.eu',
item: SITE_URL,
},
{
'@type': 'ListItem',
position: 2,
name: 'Addons',
item: 'https://postguard.eu/addons',
item: `${SITE_URL}/addons`,
},
],
},
Expand All @@ -47,12 +48,12 @@
price: '0',
priceCurrency: 'EUR',
},
url: 'https://postguard.eu/addons',
url: `${SITE_URL}/addons`,
softwareRequirements: 'Mozilla Thunderbird, Yivi app',
author: {
'@type': 'Organization',
name: 'PostGuard',
url: 'https://postguard.eu',
url: SITE_URL,
},
},
{
Expand All @@ -67,12 +68,12 @@
price: '0',
priceCurrency: 'EUR',
},
url: 'https://postguard.eu/addons',
url: `${SITE_URL}/addons`,
softwareRequirements: 'Microsoft Outlook, Yivi app',
author: {
'@type': 'Organization',
name: 'PostGuard',
url: 'https://postguard.eu',
url: SITE_URL,
},
},
],
Expand Down
12 changes: 6 additions & 6 deletions src/routes/(marketing)/blog/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
<script lang="ts">
import SEO from '$lib/components/SEO.svelte'
import { resolve } from '$app/paths'
import { SITE_URL } from '$lib/env'

let { data } = $props()

const siteUrl = 'https://postguard.eu'
const blogJsonLd = $derived({
'@context': 'https://schema.org',
'@graph': [
{
'@type': 'CollectionPage',
url: `${siteUrl}/blog`,
url: `${SITE_URL}/blog`,
name: 'PostGuard Blog',
description:
'News, updates, and insights about PostGuard — secure end-to-end encryption for email and files.',
isPartOf: {
'@id': `${siteUrl}/#website`,
'@id': `${SITE_URL}/#website`,
},
mainEntity: {
'@type': 'ItemList',
itemListElement: data.posts.map((post, i) => ({
'@type': 'ListItem',
position: i + 1,
name: post.title,
url: `${siteUrl}/blog/${post.slug}`,
url: `${SITE_URL}/blog/${post.slug}`,
})),
},
},
Expand All @@ -34,13 +34,13 @@
'@type': 'ListItem',
position: 1,
name: 'Home',
item: siteUrl,
item: SITE_URL,
},
{
'@type': 'ListItem',
position: 2,
name: 'Blog',
item: `${siteUrl}/blog`,
item: `${SITE_URL}/blog`,
},
],
},
Expand Down
14 changes: 7 additions & 7 deletions src/routes/(marketing)/blog/[slug]/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
import SEO from '$lib/components/SEO.svelte'
import { page } from '$app/state'
import { getAuthor } from '$lib/authors'
import { SITE_URL } from '$lib/env'

let { data } = $props()

const siteUrl = 'https://postguard.eu'
const author = $derived(getAuthor(data.metadata.author))

const authorJsonLd = $derived(() => {
Expand All @@ -32,26 +32,26 @@
image: data.metadata.image
? data.metadata.image.startsWith('http')
? data.metadata.image
: `${siteUrl}${data.metadata.image}`
: `${siteUrl}/pg_logo.png`,
: `${SITE_URL}${data.metadata.image}`
: `${SITE_URL}/pg_logo.png`,
author: authorJsonLd(),
publisher: {
'@type': 'Organization',
'@id': `${siteUrl}/#organization`,
'@id': `${SITE_URL}/#organization`,
name: 'PostGuard',
logo: {
'@type': 'ImageObject',
url: `${siteUrl}/pg_logo.png`,
url: `${SITE_URL}/pg_logo.png`,
width: 512,
height: 512,
},
},
mainEntityOfPage: {
'@type': 'WebPage',
'@id': `${siteUrl}${page.url.pathname}`,
'@id': `${SITE_URL}${page.url.pathname}`,
},
isPartOf: {
'@id': `${siteUrl}/#website`,
'@id': `${SITE_URL}/#website`,
},
})
</script>
Expand Down
3 changes: 2 additions & 1 deletion src/routes/(marketing)/blog/rss.xml/+server.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { SITE_URL } from '$lib/env'

export const prerender = true

const SITE_URL = 'https://postguard.eu'
const FEED_URL = `${SITE_URL}/blog/rss.xml`
const FEED_TITLE = 'PostGuard Blog'
const FEED_DESCRIPTION =
Expand Down
Loading