Skip to content

Commit

Permalink
Change approach to discovery links
Browse files Browse the repository at this point in the history
  • Loading branch information
molly committed Feb 27, 2024
1 parent 6a1e094 commit d118ac7
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 29 deletions.
10 changes: 10 additions & 0 deletions src/components/CustomEntryHead.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,16 @@ export default function CustomEntryHead({
key="twitterdescription"
content={description}
/>
<link
rel="alternate"
type="application/json+oembed"
href={`https://www.web3isgoinggreat.com/api/oembed?url=https://www.web3isgoinggreat.com/single/${id}&format=json`}
/>
<link
rel="alternate"
type="application/xml+oembed"
href={`https://www.web3isgoinggreat.com/api/oembed?url=https://www.web3isgoinggreat.com/single/${id}&format=xml`}
/>
{additionalHead}
</Head>
);
Expand Down
12 changes: 11 additions & 1 deletion src/components/CustomHead.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import PropTypes from "prop-types";
import Head from "next/head";
import PropTypes from "prop-types";

export default function CustomEntryHead({ title, description, urlPath }) {
return (
Expand Down Expand Up @@ -31,6 +31,16 @@ export default function CustomEntryHead({ title, description, urlPath }) {
key="twitterdescription"
content={description}
/>
<link
rel="alternate"
type="application/json+oembed"
href={`https://www.web3isgoinggreat.com/api/oembed?url=https://web3isgoinggreat.com/${urlPath}&format=json`}
/>
<link
rel="alternate"
type="application/xml+oembed"
href={`https://www.web3isgoinggreat.com/api/oembed?url=https://www.web3isgoinggreat.com/${urlPath}&format=xml`}
/>
</Head>
);
}
Expand Down
2 changes: 0 additions & 2 deletions src/components/timeline/Timeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import {
import Link from "next/link";
import { InView, useInView } from "react-intersection-observer";

import { getOembedHeaders } from "../../js/oembed";
import BackBar from "../BackBar";
import CustomEntryHead from "../CustomEntryHead";
import Error from "../Error";
Expand Down Expand Up @@ -98,7 +97,6 @@ export default function Timeline({
<CustomEntryHead
entry={data.pages[0].entries[0]}
collectionDescription={collectionDescription}
additionalHead={startAtId ? getOembedHeaders(startAtId) : null}
/>
);
}
Expand Down
14 changes: 0 additions & 14 deletions src/js/oembed.js

This file was deleted.

14 changes: 12 additions & 2 deletions src/pages/_app.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import "../styles/main.sass";
import Head from "next/head";
import PropTypes from "prop-types";
import ReactGA from "react-ga";
import Head from "next/head";
import { QueryClient, QueryClientProvider } from "react-query";
import Layout from "../components/Layout";
import { AppProvider } from "../context/AppContext";
import "../styles/main.sass";

if (typeof window !== "undefined") {
ReactGA.initialize("UA-215114522-1");
Expand Down Expand Up @@ -92,6 +92,16 @@ function CustomApp({ Component, pageProps }) {
key="twitterimagealt"
content="Illustration: A sad-looking Bored Ape Yacht Club NFT monkey looks at a world engulfed in flames. Text next to it says 'Web3 is Going Just Great.'"
/>
<link
rel="alternate"
type="application/json+oembed"
href="https://www.web3isgoinggreat.com/api/oembed?url=https://web3isgoinggreat.com/&format=json"
/>
<link
rel="alternate"
type="application/xml+oembed"
href="https://www.web3isgoinggreat.com/api/oembed?url=https://www.web3isgoinggreat.com/&format=xml"
/>
</Head>
<QueryClientProvider client={queryClient}>
<AppProvider>
Expand Down
6 changes: 1 addition & 5 deletions src/pages/embed/[id].js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import Error from "../../components/Error";
import Entry from "../../components/timeline/Entry";
import { getMetadata } from "../../db/metadata";
import { EntryPropType } from "../../js/entry";
import { getOembedHeaders } from "../../js/oembed";

export async function getServerSideProps(context) {
const props = { entry: null };
Expand Down Expand Up @@ -50,10 +49,7 @@ export default function EmbedEntry({
}
return (
<>
<CustomEntryHead
entry={entry}
additionalHead={getOembedHeaders(entry.id)}
/>
<CustomEntryHead entry={entry} />
<article className="embed-wrapper">
<Entry
className="single even"
Expand Down
6 changes: 1 addition & 5 deletions src/pages/single/[id].js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import Entry from "../../components/timeline/Entry";
import Header from "../../components/timeline/Header";
import { getMetadata } from "../../db/metadata";
import { EntryPropType } from "../../js/entry";
import { getOembedHeaders } from "../../js/oembed";

export async function getServerSideProps(context) {
const props = { entry: null };
Expand Down Expand Up @@ -74,10 +73,7 @@ export default function SingleEntry({

return (
<>
<CustomEntryHead
entry={entry}
additionalHead={getOembedHeaders(entry.id)}
/>
<CustomEntryHead entry={entry} />
<Header
windowWidth={windowWidth}
isBrowserRendering={isBrowserRendering}
Expand Down

0 comments on commit d118ac7

Please sign in to comment.