View posts.blade.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- resources/views/posts.blade.php --> | |
<!DOCTYPE html> | |
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}"> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>Laravel</title> | |
<!-- Fonts --> |
View TheProject.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<HEADER> | |
<TITLE>The World Wide Web project</TITLE> | |
<NEXTID N="55"> | |
</HEADER> | |
<BODY> | |
<H1>World Wide Web</H1>The WorldWideWeb (W3) is a wide-area<A | |
NAME=0 HREF="WhatIs.html"> | |
hypermedia</A> information retrieval | |
initiative aiming to give universal |
View route.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default { | |
name: 'route', | |
type: 'document', | |
title: 'Route', | |
fields: [ | |
{ | |
name: 'title', | |
type: 'string', | |
description: 'This title populates meta-tags on the webpage' | |
}, |
View _middleware.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// posts/_middleware.js | |
import { NextResponse } from 'next/server' | |
const config = { | |
dataset: process.env.NEXT_PUBLIC_SANITY_DATASET || 'production', | |
projectId: process.env.NEXT_PUBLIC_SANITY_PROJECT_ID, | |
apiVersion: '2021-10-21', | |
} | |
const baseUrl = cdn => `https://${config.projectId}.api${cdn ? 'cdn' : ''}.sanity.io/v${config.apiVersion}` | |
const queryUrl = baseUrl() + `/data/query/${config.dataset}/` |
View migration.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// migration.js | |
/** | |
* Run: | |
* sanity exec --with-user-token migration.js | |
* | |
*/ | |
import sanityClient from 'part:@sanity/base/client' | |
const client = sanityClient.withConfig({ apiVersion: '2021-11-10' }) | |
// Patch 1000 at a time | |
const query = `*[_type == "stream"][0...999]{title, publishedDate, _id, _rev}` |
View blurhash.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Retroactively add Blurhash strings to image assets in your Sanity Content Lake. | |
* 1. yarn add got sharp blurhash | |
* 2. run sanity exec blurhash --with-user-token | |
* 3. repeat (patches 100 assets in 1 transaction pr run) | |
* | |
* Some images might take a while to process. | |
*/ | |
import client from 'part:@sanity/base/client' | |
import got from 'got' |
View parseHTML.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const blockTools = require("@sanity/block-tools").default; | |
const jsdom = require("jsdom"); | |
const { JSDOM } = jsdom; | |
const HTML_SPAN_TAGS = { | |
span: {object: 'text'}, | |
} | |
const defaultSchema = require("./defaultSchema"); | |
function tagName(el) { |
View disable-js.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>No JS please</title> | |
</head> | |
<body> | |
<main> | |
<noscript> | |
Content! | |
<style> |
View PTEditor.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useState, forwardRef, Fragment } from 'react' | |
import { BlockEditor } from 'part:@sanity/form-builder' | |
import Switch from 'part:@sanity/components/toggles/switch' | |
import css from './PTeditor.module.css' | |
import { handlePaste } from './handlePaste' | |
function CustomEditor(props, ref){ | |
const [customPaste, setCustomPaste] = useState(false) | |
function handleCustomPaste () { |
NewerOlder