-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simplify view component and add image sizes for fill items
- Loading branch information
Showing
43 changed files
with
1,174 additions
and
748 deletions.
There are no files selected for viewing
File renamed without changes.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import {NextRequest} from "next/server"; | ||
import {InvalidateViews} from "../invalidate-views"; | ||
|
||
// Invalidate all view tags. | ||
export const GET = async (request: NextRequest) => { | ||
return InvalidateViews(request, 'views:stanford_event'); | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import {NextRequest, NextResponse} from "next/server"; | ||
import {revalidateTag} from "next/cache"; | ||
|
||
export const InvalidateViews = (request: NextRequest, tags: string | string[]) => { | ||
const secret = request.nextUrl.searchParams.get('secret'); | ||
if (secret !== process.env.DRUPAL_REVALIDATE_SECRET) { | ||
return NextResponse.json({message: 'Invalid token'}, {status: 403}); | ||
} | ||
if (typeof tags === 'string') tags = [tags]; | ||
tags.forEach(tag => revalidateTag(tag)); | ||
return NextResponse.json({revalidated: true, tags}); | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import {NextRequest} from "next/server"; | ||
import {InvalidateViews} from "../invalidate-views"; | ||
|
||
// Invalidate all view tags. | ||
export const GET = async (request: NextRequest) => { | ||
return InvalidateViews(request, 'views:stanford_news'); | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import {NextRequest} from "next/server"; | ||
import {InvalidateViews} from "../invalidate-views"; | ||
|
||
// Invalidate all view tags. | ||
export const GET = async (request: NextRequest) => { | ||
return InvalidateViews(request, 'views:stanford_page'); | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import {NextRequest} from "next/server"; | ||
import {InvalidateViews} from "../invalidate-views"; | ||
|
||
// Invalidate all view tags. | ||
export const GET = async (request: NextRequest) => { | ||
return InvalidateViews(request, 'views:stanford_person'); | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import {NextRequest} from "next/server"; | ||
import {InvalidateViews} from "../invalidate-views"; | ||
|
||
// Invalidate all view tags. | ||
export const GET = async (request: NextRequest) => { | ||
return InvalidateViews(request, 'views:stanford_publication'); | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import {NextRequest} from "next/server"; | ||
import {InvalidateViews} from "./invalidate-views"; | ||
|
||
// Invalidate all view tags. | ||
export const GET = async (request: NextRequest) => { | ||
return InvalidateViews(request, 'views'); | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,10 @@ | ||
import {MetadataRoute} from "next"; | ||
|
||
const xml2js = require('xml2js'); | ||
|
||
type DrupalSitemapItem = { | ||
loc: string[]; | ||
lastmod?: string[]; | ||
} | ||
|
||
type DrupalSitemap = { | ||
urlset: { | ||
url: DrupalSitemapItem[]; | ||
} | ||
} | ||
import {getAllDrupalPaths} from "@lib/drupal/get-paths"; | ||
|
||
const Sitemap = async (): Promise<MetadataRoute.Sitemap> => { | ||
const xmlParser = new xml2js.Parser(); | ||
|
||
const allPaths = await getAllDrupalPaths(); | ||
const urls: MetadataRoute.Sitemap = []; | ||
|
||
try { | ||
const drupalSitemap: DrupalSitemapItem[] = await fetch(process.env.NEXT_PUBLIC_DRUPAL_BASE_URL + '/sitemap.xml', {next: {revalidate: 60}}) | ||
.then(response => response.text()) | ||
.then<DrupalSitemap>(result => xmlParser.parseStringPromise(result)) | ||
.then(sitemap => sitemap['urlset'].url); | ||
|
||
const publicDomain = process.env.NEXT_PUBLIC_DOMAIN ?? ''; | ||
drupalSitemap?.map(item => { | ||
urls.push({ | ||
url: item.loc[0].replace(/http[s]?:\/\/.*?\//g, publicDomain + `/`), | ||
lastModified: item.lastmod?.[0], | ||
}) | ||
}) | ||
} catch (e) { | ||
console.error('Sitemap.xml error: ', e); | ||
} | ||
allPaths.get('node')?.map(path => urls.push({url: `/${path}`})) | ||
return urls | ||
} | ||
export default Sitemap; |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,58 +15,57 @@ | |
"dependencies": { | ||
"@formkit/auto-animate": "^0.8.1", | ||
"@heroicons/react": "^2.1.1", | ||
"@mui/base": "^5.0.0-beta.29", | ||
"@mui/base": "^5.0.0-beta.32", | ||
"@tailwindcss/container-queries": "^0.1.1", | ||
"@types/node": "^20.10.5", | ||
"@types/react": "^18.2.46", | ||
"@types/node": "^20.11.5", | ||
"@types/react": "^18.2.48", | ||
"@types/react-dom": "^18.2.18", | ||
"@uidotdev/usehooks": "^2.4.1", | ||
"autoprefixer": "^10.4.16", | ||
"axios": "^1.6.3", | ||
"clsx": "^2.0.0", | ||
"decanter": "^7.1.2", | ||
"autoprefixer": "^10.4.17", | ||
"axios": "^1.6.5", | ||
"clsx": "^2.1.0", | ||
"decanter": "^7.2.0", | ||
"drupal-jsonapi-params": "^2.3.1", | ||
"eslint": "^8.56.0", | ||
"eslint-config-next": "^14.0.4", | ||
"graphql": "^16.8.1", | ||
"graphql-request": "^6.1.0", | ||
"graphql-tag": "^2.12.6", | ||
"html-entities": "^2.4.0", | ||
"html-react-parser": "^5.0.11", | ||
"next": "^13.5.6", | ||
"html-react-parser": "^5.1.1", | ||
"next": "^14.0.5-canary.65", | ||
"next-drupal": "^1.6.0", | ||
"nextjs-google-analytics": "^2.3.3", | ||
"postcss": "^8.4.32", | ||
"postcss": "^8.4.33", | ||
"qs": "^6.11.2", | ||
"react": "^18.2.0", | ||
"react-dom": "^18.2.0", | ||
"react-focus-lock": "^2.9.6", | ||
"react-tiny-oembed": "^1.1.0", | ||
"sharp": "^0.33.1", | ||
"sharp": "^0.33.2", | ||
"tailwind-merge": "^2.2.0", | ||
"tailwindcss": "^3.4.0", | ||
"tailwindcss": "^3.4.1", | ||
"typescript": "^5.3.3", | ||
"usehooks-ts": "^2.9.1", | ||
"xml2js": "^0.6.2" | ||
"usehooks-ts": "^2.9.4" | ||
}, | ||
"devDependencies": { | ||
"@graphql-codegen/cli": "^5.0.0", | ||
"@graphql-codegen/cli": "^5.0.1", | ||
"@graphql-codegen/typescript-graphql-request": "^6.1.0", | ||
"@graphql-codegen/typescript-operations": "^4.0.1", | ||
"@graphql-codegen/typescript-operations": "^4.1.0", | ||
"@next/bundle-analyzer": "^14.0.4", | ||
"@storybook/addon-essentials": "^7.6.6", | ||
"@storybook/addon-interactions": "^7.6.6", | ||
"@storybook/addon-links": "^7.6.6", | ||
"@storybook/addon-essentials": "^7.6.9", | ||
"@storybook/addon-interactions": "^7.6.9", | ||
"@storybook/addon-links": "^7.6.9", | ||
"@storybook/addon-styling": "^1.3.7", | ||
"@storybook/blocks": "^7.6.6", | ||
"@storybook/nextjs": "^7.6.6", | ||
"@storybook/react": "^7.6.6", | ||
"@storybook/blocks": "^7.6.9", | ||
"@storybook/nextjs": "^7.6.9", | ||
"@storybook/react": "^7.6.9", | ||
"@storybook/testing-library": "^0.2.2", | ||
"concurrently": "^8.2.2", | ||
"encoding": "^0.1.13", | ||
"eslint-plugin-storybook": "^0.6.15", | ||
"eslint-plugin-unused-imports": "^3.0.0", | ||
"storybook": "^7.6.6" | ||
"storybook": "^7.6.9" | ||
}, | ||
"packageManager": "[email protected]" | ||
} |
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
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
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
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
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
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
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
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
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
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
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
Oops, something went wrong.