Merge branch 'main' into feature/add-language
This commit is contained in:
commit
c31074de4b
8 changed files with 58 additions and 11 deletions
|
@ -51,6 +51,7 @@ export default function Editor(props: ParentProps) {
|
|||
<HttpHeader name="Accept-CH" value="Sec-CH-Prefers-Color-Scheme" />
|
||||
|
||||
<Title>Calque</Title>
|
||||
<Meta name="description" content="Simple tool for managing translation files" />
|
||||
|
||||
<Meta name="color-scheme" content={theme.colorScheme} />
|
||||
<Meta name="theme-color" content={`oklch(${lightness()} .02 ${theme.hue})`} />
|
||||
|
@ -71,7 +72,7 @@ export default function Editor(props: ParentProps) {
|
|||
<picture>
|
||||
<source srcset="/images/favicon.dark.svg" media="screen and (prefers-color-scheme: dark)" />
|
||||
<source srcset="/images/favicon.light.svg" media="screen and (prefers-color-scheme: light)" />
|
||||
<img src="/images/favicon.dark.svg" alt="Calque logo" />
|
||||
<img src="/images/favicon.dark.svg" alt="Calque logo" width="17.5" height="17.5" />
|
||||
</picture>
|
||||
</A>
|
||||
|
||||
|
|
|
@ -347,8 +347,6 @@ const Editor: Component<{ root: FileSystemDirectoryHandle }> = (props) => {
|
|||
|
||||
<Menu.Item command={commands.clearSelection} />
|
||||
</Menu.Item>
|
||||
|
||||
<Menu.Item command={noop.withLabel('view')} />
|
||||
</Menu.Root>
|
||||
|
||||
<Prompt api={setNewKeyPrompt} title="Which key do you want to create?" description={<>hint: use <code>.</code> to denote nested keys,<br /> i.e. <code>this.is.some.key</code> would be a key that is four levels deep</>}>
|
||||
|
|
36
src/routes/sitemap.xml.ts
Normal file
36
src/routes/sitemap.xml.ts
Normal file
|
@ -0,0 +1,36 @@
|
|||
import { SitemapStream, streamToPromise } from 'sitemap'
|
||||
import { App } from 'vinxi';
|
||||
|
||||
const BASE_URL = 'https://ca-euw-prd-calque-app.purplecoast-f5b7f657.westeurope.azurecontainerapps.io';
|
||||
|
||||
export async function GET() {
|
||||
|
||||
const sitemap = new SitemapStream({ hostname: BASE_URL });
|
||||
|
||||
sitemap.write({ url: BASE_URL, changefreq: 'monthly', });
|
||||
|
||||
for (const route of await getRoutes()) {
|
||||
sitemap.write({ url: route, changefreq: 'monthly', });
|
||||
}
|
||||
|
||||
sitemap.end();
|
||||
|
||||
return new Response(
|
||||
(await streamToPromise(sitemap)).toString(),
|
||||
{ status: 200, headers: { 'Content-Type': 'text/xml' } }
|
||||
);
|
||||
}
|
||||
|
||||
const getRoutes = async () => {
|
||||
const router = ((globalThis as any).app as App).getRouter('client').internals.routes;
|
||||
|
||||
if (router === undefined) {
|
||||
return [];
|
||||
}
|
||||
|
||||
const routes = await router.getRoutes() as { page: boolean, $$route?: object, path: string }[];
|
||||
|
||||
return routes
|
||||
.filter(r => r.page === true && r.$$route === undefined && !r.path.match(/^.+\*\d+$/))
|
||||
.map(r => r.path.replace(/\/\(\w+\)/g, ''));
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue