diff --git a/web/next.config.js b/web/next.config.js index 28a009ad..e1c81a01 100644 --- a/web/next.config.js +++ b/web/next.config.js @@ -24,6 +24,9 @@ module.exports = { }, }, images: { + // Setting to bypass build error for `next export`, see https://stackoverflow.com/a/70047180/1222351 + loader: 'akamai', + path: '', domains: ['lh3.googleusercontent.com', 'i.imgur.com'], }, async redirects() { diff --git a/web/pages/server-sitemap.xml.tsx b/web/pages/server-sitemap.xml.tsx deleted file mode 100644 index 246bb9ee..00000000 --- a/web/pages/server-sitemap.xml.tsx +++ /dev/null @@ -1,27 +0,0 @@ -import { sortBy } from 'lodash' -import { GetServerSideProps } from 'next' -import { getServerSideSitemap, ISitemapField } from 'next-sitemap' - -import { DOMAIN } from 'common/envs/constants' -import { LiteMarket } from './api/v0/_types' - -export const getServerSideProps: GetServerSideProps = async (ctx) => { - // Fetching data from https://manifold.markets/api - const response = await fetch(`https://${DOMAIN}/api/v0/markets`) - - const liteMarkets = (await response.json()) as LiteMarket[] - const sortedMarkets = sortBy(liteMarkets, (m) => -m.volume24Hours) - - const fields = sortedMarkets.map((market) => ({ - // See https://www.sitemaps.org/protocol.html - loc: market.url, - changefreq: market.volume24Hours > 10 ? 'hourly' : 'daily', - priority: market.volume24Hours + market.volume7Days > 100 ? 0.7 : 0.1, - // TODO: Add `lastmod` aka last modified time - })) as ISitemapField[] - - return await getServerSideSitemap(ctx, fields) -} - -// Default export to prevent next.js errors -export default function Sitemap() {}