diff --git a/src/routes/(main)/+page.svelte b/src/routes/(main)/+page.svelte index 059174c..d1d18c9 100644 --- a/src/routes/(main)/+page.svelte +++ b/src/routes/(main)/+page.svelte @@ -30,12 +30,12 @@

- welcome to my page 🌊 + 🌊 welcome to my page 🌊

-

This site is perpetually under construction but coming along :)

+

This site is perpetually under construction but coming along. 😎

It's mostly a place for me to post recipes I like and travel photos, with the occasional technical post or personal blog mixed in. Some work-related stuff can be found here too, but that's not what I want to talk about.

diff --git a/src/routes/(main)/[slug]/+page.js b/src/routes/(main)/[slug]/+page.js index 6a4cda8..16f67b6 100644 --- a/src/routes/(main)/[slug]/+page.js +++ b/src/routes/(main)/[slug]/+page.js @@ -5,9 +5,13 @@ export const csr = true; // https://github.com/sveltejs/kit/pull/6446 export async function load({ params, fetch, setHeaders }) { const slug = params.slug; + // redirect these slugs to appropriate routes if (slug === 'feed' || slug === 'rss' || slug === 'rss.xml') { throw redirect(308, '/rss.xml') } + if (slug === 'sitemap' || slug === 'sitemap.xml') { + throw redirect(308, '/sitemap.xml') + } let res = null; res = await fetch(`/api/getContent/${slug}.json`); @@ -16,7 +20,8 @@ export async function load({ params, fetch, setHeaders }) { } const json = await res.json() - // because [slug] is a catchall, it gets the gallery pages too. redirect them. + // because [slug] is a catchall, it gets gallery slugs too. redirect them. + // e.g. /japan -> /gallery/japan if (json.type === 'gallery') { throw redirect(308, `/gallery/${json.slug}`) } diff --git a/src/routes/(main)/gallery/+page.svelte b/src/routes/(main)/gallery/+page.svelte index d7ef233..7fd1fda 100644 --- a/src/routes/(main)/gallery/+page.svelte +++ b/src/routes/(main)/gallery/+page.svelte @@ -6,8 +6,8 @@ - heffner.dev | adventures - + heffner.dev | gallery + diff --git a/src/routes/api/listGallery.json/+server.js b/src/routes/api/listGallery.json/+server.js index 5d99523..6e8ed29 100644 --- a/src/routes/api/listGallery.json/+server.js +++ b/src/routes/api/listGallery.json/+server.js @@ -6,33 +6,6 @@ import { listContentFromIssues } from '$lib/content'; export async function GET({ setHeaders }) { const list = await listContentFromIssues('Gallery'); - // const list = [ - // { - // name: 'Japan', - // date: 'April 2023', - // description: 'traveled all over the country for a month with randi', - // slug: '/gallery/japan', - // image: 'http://placekitten.com/400/400', - // alt: 'japan alt' - // }, - // { - // name: 'Morocco', - // date: 'September 2018', - // description: 'visited my sister during her peace corps mission', - // slug: '/gallery/morocco', - // image: 'http://placekitten.com/400/400', - // alt: 'morocco alt' - // }, - // { - // name: 'Costa Rica', - // date: 'December 2017', - // description: 'two weeks of desayuno tipica with the boys', - // slug: '/gallery/costa-rica', - // image: 'http://placekitten.com/400/400', - // alt: 'cr alt' - // }, - // ]; - setHeaders({ 'Cache-Control': `max-age=0, s-maxage=${60}` // 1 minute.. for now }); diff --git a/src/routes/sitemap.xml/+server.js b/src/routes/sitemap.xml/+server.js index 0ee4b56..c933372 100644 --- a/src/routes/sitemap.xml/+server.js +++ b/src/routes/sitemap.xml/+server.js @@ -8,7 +8,7 @@ export async function GET({ fetch }) { const galleries = await listContentFromIssues('Gallery'); const projects = await fetchMarkdownPosts() const pages = ['about', 'resume', 'blogroll', 'christmas', 'blog', 'work']; - const body = sitemap(posts, projects, pages); + const body = sitemap(posts, projects, pages, galleries); return new Response(body, { headers: { @@ -18,7 +18,7 @@ export async function GET({ fetch }) { }); } -const sitemap = (posts, projects, pages) => ` +const sitemap = (posts, projects, pages, galleries) => ` ` - post.isPrivate + gallery.isPrivate ? null : `