Skip to content

Instantly share code, notes, and snippets.

View siegerhansma's full-sized avatar

Sieger Hansma siegerhansma

View GitHub Profile
@siegerhansma
siegerhansma / generator.md
Last active May 27, 2023 11:28
A simple sitemap generator with Deno and puppeteer

First, make sure you have installed Deno and Puppeteer on your machine.

Create the following typescript file and save it. In my example, I have called it sitemap-generator.ts. Update the websiteUrl variable (in my case https://dartsscoreboard.com) to the site you want to generate the sitemap for. This value is also included in the sitemap.

import puppeteer from "https://deno.land/x/puppeteer@16.2.0/mod.ts";

async function generateSitemap(url: string): Promise<void> {
  const browser = await puppeteer.launch();
 const page = await browser.newPage();