SunTzu
SunTzu
NNuxt
Created by roga on 3/23/2023 in #❓・help
Nuxt & Supabase Auth
It doesn't seem that auth login works on Static hosting. The login works, however the session does not stick or something..
7 replies
NNuxt
Created by SunTzu on 3/3/2023 in #❓・help
Generate Sitemap on server side of nuxt
Add the sitemap library yarn add sitemap Then here is the code to go into sitemap.xml.ts
import { SitemapStream, streamToPromise } from "sitemap";
// Import whatever database client

export default defineEventHandler(async (event) => {
try {
const config = useRuntimeConfig(); // Needed for access to .env

const { data } = (insert your database client
const sitemap = new SitemapStream({
hostname: "https://domain.com",
});
sitemap.write({
url: `/`,
changefreq: "weekly",
});
sitemap.write({
url: `/info`,
changefreq: "daily",
});

for (let c = 0; c < data?.length; c++) {
let page = data[c];
if (page.hidden == false) {
sitemap.write({
url: `/info/${page.url_path}`,
changefreq: "monthly",
lastmod: page.updated_at,
});
}
}

sitemap.end();
return streamToPromise(sitemap);
} catch (e) {
console.log(e);
}
});
import { SitemapStream, streamToPromise } from "sitemap";
// Import whatever database client

export default defineEventHandler(async (event) => {
try {
const config = useRuntimeConfig(); // Needed for access to .env

const { data } = (insert your database client
const sitemap = new SitemapStream({
hostname: "https://domain.com",
});
sitemap.write({
url: `/`,
changefreq: "weekly",
});
sitemap.write({
url: `/info`,
changefreq: "daily",
});

for (let c = 0; c < data?.length; c++) {
let page = data[c];
if (page.hidden == false) {
sitemap.write({
url: `/info/${page.url_path}`,
changefreq: "monthly",
lastmod: page.updated_at,
});
}
}

sitemap.end();
return streamToPromise(sitemap);
} catch (e) {
console.log(e);
}
});
3 replies
NNuxt
Created by SunTzu on 3/3/2023 in #❓・help
Generate Sitemap on server side of nuxt
No description
3 replies
NNuxt
Created by Maik on 2/10/2023 in #❓・help
✨ Dynamic Sitemap with SSR without pre-render
Where is his example where you can import? For instance importing supabase module
38 replies
NNuxt
Created by SunTzu on 2/22/2023 in #❓・help
Idle-js with Nuxt 3
Absolutely perfect thank you so so much
10 replies
NNuxt
Created by SunTzu on 2/22/2023 in #❓・help
Idle-js with Nuxt 3
Yeah! Like when they don’t move cursor and then when they do it resumes
10 replies