This file contains hidden or 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 PACKAGE = "nric" | |
let widget = await createWidget(); | |
// Check where the script is running | |
if (config.runsInWidget) { | |
// Runs inside a widget so add it to the homescreen widget | |
Script.setWidget(widget); | |
} else { | |
// Show the medium widget inside the app |
This file contains hidden or 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
{ | |
"name": "Digital Collectible Wrapper", | |
"description": "A dynamic wrapper NFT for linking Digital Collectibles on Instagram and Twitter", | |
"image": "https://github.com/danielkhoo.png" | |
} |
This file contains hidden or 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
//SPDX-License-Identifier: MIT | |
pragma solidity >=0.8.0 <0.9.0; | |
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol"; | |
import "@openzeppelin/contracts/utils/Counters.sol"; | |
/** | |
* @title Digital Collectible | |
* @author Daniel Khoo | |
* @notice A dynamic NFT wrapper for digital collectibles on Instagram / Twitter with editable token URI |
This file contains hidden or 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
<!-- OpenGraph Meta Tags --> | |
<meta name="twitter:card" content="summary" /> | |
<meta name="twitter:creator" content="@jadenkore" /> | |
<meta property="twitter:domain" content="danielkhoo.xyz" /> | |
<meta property="twitter:url" content="https://danielkhoo.xyz/twitter-and-open-graph-cards" /> | |
<meta name="twitter:title" content="Twitter and OpenGraph Cards" /> | |
<meta name="twitter:description" content="Having a personal site is great for standing out and expressing your creativity..." /> | |
<meta name="twitter:image" content="https://danielkhoo.xyz/sd2.png" /> | |
<!-- OpenGraph Meta Tags --> | |
<meta property="og:url" content="https://danielkhoo.xyz/" /> |
This file contains hidden or 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 { ImageResponse } from '@vercel/og' | |
export const config = { | |
runtime: 'edge', | |
} | |
export default async function handler(req) { | |
const HOST = 'https://danielkhoo.xyz' | |
const { searchParams } = req.nextUrl | |
const title = searchParams.get('title') || 'danielkhoo.xyz' | |
const description = searchParams.get('description') || `Hello there! I'm Daniel. Welcome to my online home for ideas, writing and side projects.` |
This file contains hidden or 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 function handler(req, res) { | |
// getPosts is a fn that returns all the posts, you should already have this for a markdown/mdx site | |
const posts = getPosts(); | |
res.statusCode = 200 | |
res.setHeader('Content-Type', 'text/xml') | |
// Instructing the Vercel edge to cache the file | |
res.setHeader('Cache-control', 'stale-while-revalidate, s-maxage=3600') | |
// generate sitemap here |
OlderNewer