diff --git a/TODO.md b/TODO.md index 6d3b482..6471b81 100644 --- a/TODO.md +++ b/TODO.md @@ -1,8 +1,7 @@ # To Do -- [ ] sitemap.xml -- [ ] search.html - [ ] copy to clipboard for variations +- [ ] search.html - [ ] test button for variations - [ ] comments via utteranc.es - [ ] homepage: search diff --git a/app/routes/library.tags[.]html.tsx b/app/routes/library.tags[.]html.tsx index 4b10df8..b092a1f 100644 --- a/app/routes/library.tags[.]html.tsx +++ b/app/routes/library.tags[.]html.tsx @@ -1,5 +1,5 @@ import { json, type MetaFunction, SerializeFrom } from "@remix-run/node"; -import { useLoaderData, useSearchParams } from "@remix-run/react"; +import { Link as RemixLink, useLoaderData, useSearchParams } from "@remix-run/react"; import { Container } from "react-bootstrap"; import { Footer } from "~/components/Footer"; @@ -47,7 +47,7 @@ function TagRow(tag:string, currentTag: string, entries: SerializeFrom diff --git a/app/routes/search[.]html.tsx b/app/routes/search[.]html.tsx index a9ec668..c0a1762 100644 --- a/app/routes/search[.]html.tsx +++ b/app/routes/search[.]html.tsx @@ -1,8 +1,6 @@ import type { MetaFunction } from "@remix-run/node"; -import { Welcome } from "~/components/Welcome/Welcome"; -import { ColorSchemeToggle } from "~/components/ColorSchemeToggle/ColorSchemeToggle"; import { HeaderSearch } from "~/components/HeaderSearch/HeaderSearch"; -import { Badge, Container, Table } from 'react-bootstrap'; +import { Container } from 'react-bootstrap'; import { Footer } from "~/components/Footer"; export const meta: MetaFunction = () => { diff --git a/app/routes/sitemap[.]xml.tsx b/app/routes/sitemap[.]xml.tsx new file mode 100644 index 0000000..7cece8d --- /dev/null +++ b/app/routes/sitemap[.]xml.tsx @@ -0,0 +1,31 @@ +import { getAll, initialize } from "~/components/Library"; + +function urlLine(url:string) { + return `\thttps://www.regex.zone${url}` +} + +export async function loader() { + + const lines:string[] = []; + + lines.push(""); + lines.push(''); + lines.push(''); + lines.push(urlLine('/')); + lines.push(urlLine('/library/')); + lines.push(urlLine('/library/tags.html')); + lines.push(urlLine('/search.html')); + + initialize(); + for (const entry of getAll()) { + lines.push(urlLine(`/library/${entry.handle}/`)); + } + + lines.push('') + + return new Response(lines.join('\n'), { + headers: { + "Content-Type": "text/xml; charset=utf-8", + }, + }); +} diff --git a/public/sitemap.xslt b/public/sitemap.xslt new file mode 100644 index 0000000..e5ef8b4 --- /dev/null +++ b/public/sitemap.xslt @@ -0,0 +1,42 @@ + + + + +Powered by Sitemap Style + + + + + + + + + + Sitemap for <xsl:value-of select="$hostname"/> + + + +
+

Pages on

+
    + + + +
  • + + + () + +
  • +
    +
+

pages

+
+ + +
+