Skip to content

Commit

Permalink
fixed error in paragraph rows
Browse files Browse the repository at this point in the history
  • Loading branch information
pookmish committed Nov 23, 2023
1 parent f05201c commit cf154c3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 12 deletions.
27 changes: 16 additions & 11 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
const drupalUrl = new URL(process.env.NEXT_PUBLIC_DRUPAL_BASE_URL);

const imagePatterns = [
{
// Allow any stanford domain for images, but require https.
protocol: 'https',
hostname: '**.stanford.edu',
},
{
protocol: drupalUrl.protocol.replace(':', ''),
hostname: drupalUrl.hostname,
},
];
if (process.env.NEXT_IMAGE_DOMAIN) {
imagePatterns.push({hostname: process.env.NEXT_IMAGE_DOMAIN})
}

const nextConfig = {
images: {
remotePatterns: [
{
// Allow any stanford domain for images, but require https.
protocol: 'https',
hostname: '**.stanford.edu',
},
{
protocol: drupalUrl.protocol.replace(':', ''),
hostname: drupalUrl.hostname,
},
],
remotePatterns: imagePatterns,
},
async rewrites() {
return {
Expand Down
2 changes: 1 addition & 1 deletion src/components/paragraphs/rows/rows.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const Rows = async ({components}: { components: StanfordParagraph[] }) => {
const layouts: Layout = {};

const draftMode = isDraftMode();
components = await getResources<StanfordParagraph>(components, draftMode);
components = (await getResources<StanfordParagraph>(components, draftMode)).filter(item => !!item);

// Set the layouts first.
components.map(item => {
Expand Down

1 comment on commit cf154c3

@vercel
Copy link

@vercel vercel bot commented on cf154c3 Nov 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.