Skip to content

Instantly share code, notes, and snippets.

@robmarshall
robmarshall / sitemap-template.xml
Created November 5, 2022 12:40
Sitemap Template for Next JS Article
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0"
xmlns:html="http://www.w3.org/TR/REC-html40"
xmlns:image="http://www.google.com/schemas/sitemap-image/1.1"
xmlns:sitemap="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:template match="/">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
module.exports = ({ config }) => {
// Transpile Gatsby module because Gatsby includes un-transpiled ES6 code.
config.module.rules[0].exclude = [/node_modules\/(?!(gatsby)\/)/]
// use installed babel-loader which is v8.0-beta (which is meant to work with @babel/core@7)
config.module.rules[0].use[0].loader = require.resolve('babel-loader')
// use @babel/preset-react for JSX and env (instead of staged presets)
config.module.rules[0].use[0].options.presets = [
require.resolve('@babel/preset-react'),
@robmarshall
robmarshall / useEffect-async-loader.js
Created September 29, 2019 15:55
Component using useEffect and Axios to get async data
import React, { useState, useEffect } from "react";
import axios from "axios";
const fetchDataCall = async ({ api }) => {
let apiReturn = await axios
.get(api)
.then(async function(response) {
return response;
})
.catch(function(error) {
@robmarshall
robmarshall / gfstyling.scss
Last active March 6, 2024 20:41
Gravity Forms SCSS Styling
// Gravity Forms Reset Styles
// https://gist.github.com/forgeandsmith/8048759
//
// Some fields have been removed, as they were not needed.
// See the above link for future reference
.gfield_required {
display: none;
}