Skip to content

Instantly share code, notes, and snippets.

@agustif
agustif / DelayRedirect.tsx
Created October 29, 2020 23:30 — forked from JT501/DelayRedirect.tsx
Next Router - DelayRedirect
import { useRouter } from 'next/router';
import React, { useEffect, useState } from 'react';
interface DelayProps {
delay: number;
to: string;
banner: boolean;
showCount: boolean;
}
@agustif
agustif / README.md
Created October 29, 2018 14:42 — forked from a-barbieri/README.md
NextJS sitemap generator with dynamic URL

NextJS sitemap generator

Install

The current setup has been tested on Next Js 7.0.0.

You need to install Axios.

$ npm install axios
@agustif
agustif / buildSitemap.js
Created October 29, 2018 14:41 — forked from evantahler/buildSitemap.js
35 lines to build a sitemap for next.js projects
#! /usr/bin/env node
// I am ./bin/buildSitemap.js
const path = require('path')
const glob = require('glob')
const fs = require('fs')
const SITE_ROOT = process.env.SITE_ROOT || 'https://www.actionherojs.com'
const SOURCE = process.env.SOURCE || path.join(__dirname, '..', 'pages', '/**/*.js')
const DESTINATION = process.env.DESTINATION || path.join(__dirname, '..', 'static', 'sitemap.xml')