Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nojira | Update nextjs to v13.4.20-canary.12; enable static export; remove use of next image #112

Closed
wants to merge 28 commits into from
Closed
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
5e7d8c6
Update nextjs to v13.4.18, eslint-config-next and @netlify/plugin-nex…
yvonnetangsu Aug 18, 2023
5242c88
Add try/catch to generateMetaData
yvonnetangsu Aug 19, 2023
a0cdb09
Merge branch 'dev' into feature/nojira_update-package
yvonnetangsu Aug 21, 2023
f87724a
Just trying next canary
yvonnetangsu Aug 21, 2023
12483f7
See if this fixes the problem where I can't directly type in the URL
yvonnetangsu Aug 30, 2023
5c0bd6e
Merge branch 'dev' into feature/nojira_update-package
yvonnetangsu Aug 30, 2023
463b494
Remove throw error for generate metadata
yvonnetangsu Aug 30, 2023
a2b23ae
Trying output: export again
yvonnetangsu Aug 30, 2023
c5aaf7a
add export back to generateStaticParams
yvonnetangsu Aug 30, 2023
44cd07b
Change build directory and have NETLIFY_NEXT_PLUGIN_SKIP="true" for SSG
yvonnetangsu Aug 30, 2023
2f50c09
Remove the use of next Image
yvonnetangsu Aug 30, 2023
15c35aa
New homepage hero
yvonnetangsu Sep 25, 2023
e8413a8
sr only H1
yvonnetangsu Sep 25, 2023
42d3b51
make font size fluid; positioning of hero elements
yvonnetangsu Sep 25, 2023
389404e
Play with hero animation
yvonnetangsu Sep 25, 2023
be0f92e
Clean up
yvonnetangsu Sep 25, 2023
e795c9f
More finetuning responsive
yvonnetangsu Sep 25, 2023
7ab1cde
Create Blurry Poster component
yvonnetangsu Sep 26, 2023
9218696
Merge branch 'dev' into feature/GIVCAMP-201_blurry-bg-poster
yvonnetangsu Sep 26, 2023
72ce669
BlurryPoster and new MVP Homepage components; better typing for Story…
yvonnetangsu Sep 26, 2023
79ab80f
more styles
yvonnetangsu Sep 26, 2023
9a5eefe
linter and clean up
yvonnetangsu Sep 26, 2023
f09565d
Image on left option
yvonnetangsu Sep 28, 2023
6fc8d67
eslint update and lint fix
yvonnetangsu Sep 28, 2023
289dbfa
Merge branch 'feature/GIVCAMP-201_blurry-bg-poster' into feature/noji…
yvonnetangsu Sep 28, 2023
380e048
Revert old homepage; uninstall netlify nextjs plugin
yvonnetangsu Sep 28, 2023
30bb0a5
Merge branch 'feature/GIVCAMP-201_blurry-bg-poster' into feature/noji…
yvonnetangsu Sep 28, 2023
a5a7fcf
Uninstall netlify plugin nextjs
yvonnetangsu Sep 28, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions app/[...slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ type ParamsType = {
slug: string[];
};

async function generateStaticParams() {
export async function generateStaticParams() {
Copy link
Member Author

Choose a reason for hiding this comment

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

To use static export, I need to add export back here. Previously it generates a type error, but it seems ok now.

const storyblokApi: StoryblokClient = getStoryblokApi();
let sbParams: ISbStoriesParams = {
version: activeEnv === 'development' ? 'draft' : 'published',
Expand Down Expand Up @@ -60,7 +60,8 @@ export async function generateMetadata({ params }: { params: ParamsType }): Prom
const meta = getPageMetadata({ blok, slug });

return meta;
}
};


export default async function Page({ params }: { params: ParamsType }) {
const { data } = await getStoryData(params);
Expand Down
3 changes: 1 addition & 2 deletions components/BracketCard/BracketCard.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { HTMLAttributes } from 'react';
import Image from 'next/image';
import { cnb } from 'cnbuilder';
import { AnimateInView } from '../Animate';
import { Bracket } from '../Bracket';
Expand Down Expand Up @@ -77,7 +76,7 @@ export const BracketCard = ({
<Grid sm={12} className={styles.imageGrid(textOnLeft)}>
<div className={styles.imageWrapper(textOnLeft)}>
<div className={styles.imageAspectRatio}>
<Image
<img
width={900}
height={750}
src={getProcessedImage(imageSrc, '900x750', imageFocus)}
Expand Down
3 changes: 1 addition & 2 deletions components/InitiativeCard/InitiativeCard.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { HTMLAttributes } from 'react';
import Image from 'next/image';
import { cnb } from 'cnbuilder';
import { AnimateInView, type AnimationType } from '../Animate';
import { CtaLink } from '../Cta/CtaLink';
Expand Down Expand Up @@ -47,7 +46,7 @@ export const InitiativeCard = ({
>
<div className={styles.topWrapper}>
<div className={styles.imageWrapper}>
<Image
<img
width={600}
height={800}
alt=""
Expand Down
3 changes: 1 addition & 2 deletions components/LocalFooter/LocalFooter.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import Image from 'next/image';
import { Paragraph, Heading, Text } from '../Typography';
import { Container } from '../Container';
import { Grid } from '../Grid';
Expand All @@ -10,7 +9,7 @@ import { initiatives, themes } from '@/utilities/routes';

export const LocalFooter = () => (
<>
<Image
<img
width={2000}
height={40}
alt=""
Expand Down
3 changes: 1 addition & 2 deletions components/Storyblok/SbBasicPage.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { storyblokEditable, type SbBlokData } from '@storyblok/react/rsc';
import Image from 'next/image';
import { CreateBloks } from '../CreateBloks';
import { Hero } from '../Hero/Hero';
import { Masthead } from '../Masthead';
Expand Down Expand Up @@ -33,7 +32,7 @@ export const SbBasicPage = ({
<Hero heading={title} />
<CreateBloks blokSection={content} />
{getNumBloks(ankle) > 0 && (
<Image
<img
width={2000}
height={40}
alt=""
Expand Down
5 changes: 2 additions & 3 deletions components/Storyblok/SbHomepage.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { storyblokEditable, type SbBlokData } from '@storyblok/react/rsc';
import Image from 'next/image';
import { CreateBloks } from '../CreateBloks';
import { Heading } from '../Typography';
import { HomepageHero } from '../Homepage/HomepageHero';
Expand Down Expand Up @@ -63,7 +62,7 @@ export const SbHomepagePage = ({
<div>
<Heading as="h1" srOnly>{title || 'Homepage'}</Heading>
<HomepageHero />
<Image
<img
width={2000}
height={40}
alt=""
Expand Down Expand Up @@ -95,7 +94,7 @@ export const SbHomepagePage = ({
</FindPurposeSection>
<CreateBloks blokSection={content} />
{getNumBloks(ankle) > 0 && (
<Image
<img
width={2000}
height={40}
alt=""
Expand Down
5 changes: 2 additions & 3 deletions components/Storyblok/SbStory.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { storyblokEditable, type SbBlokData } from '@storyblok/react/rsc';
import Image from 'next/image';
import { CreateBloks } from '@/components/CreateBloks';
import { Masthead } from '@/components/Masthead';
import { StoryHero, type StoryHeroProps } from '@/components/Hero';
Expand Down Expand Up @@ -68,7 +67,7 @@ export const SbStory = ({
tabColor={tabColor}
topics={topics}
/>
<Image
<img
width={2000}
height={40}
alt=""
Expand Down Expand Up @@ -101,7 +100,7 @@ export const SbStory = ({
</>
)}
{getNumBloks(blok.ankle) > 0 && (
<Image
<img
width={2000}
height={40}
alt=""
Expand Down
3 changes: 1 addition & 2 deletions components/VerticalCard/VerticalCard.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { cnb } from 'cnbuilder';
import Image from 'next/image';
import { AnimateInView, type AnimationType } from '../Animate';
import { CtaLink } from '../Cta/CtaLink';
import { Heading, type HeadingType, Paragraph } from '../Typography';
Expand Down Expand Up @@ -56,7 +55,7 @@ export const VerticalCard = ({
<div className={styles.cardWrapper}>
{imageSrc && (
<div className={styles.imageWrapper}>
<Image
<img
alt=""
width={600}
height={600}
Expand Down
7 changes: 6 additions & 1 deletion netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@
# ##############################################################################
[build]
command = "npm run build"
publish = ".next"
publish = "out"

[build.environment]
# For apps that use next export to generate static HTML
# set the NETLIFY_NEXT_PLUGIN_SKIP to true.
NETLIFY_NEXT_PLUGIN_SKIP="true"
Comment on lines +5 to +10
Copy link
Member Author

Choose a reason for hiding this comment

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

These need to be set to use static export

Copy link
Member

Choose a reason for hiding this comment

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

What? Really? Link to Doxn?

Copy link
Member Author

@yvonnetangsu yvonnetangsu Aug 30, 2023

Choose a reason for hiding this comment

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

Here you go @sherakama
https://nextjs.org/docs/app/building-your-application/deploying/static-exports

It would also show me an error on the Netlify build page to do these two things

Copy link
Member Author

Choose a reason for hiding this comment

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

TBH I'm not 100% sure I want to go with this - but at least I finally get it to work once 😂 All the combination of things that blocked this from working before.....


# PLUGINS
# ##############################################################################
Expand Down
2 changes: 2 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
trailingSlash: true,
output: 'export',
Comment on lines 2 to +4
Copy link
Member Author

Choose a reason for hiding this comment

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

To enable static export

images: {
remotePatterns: [
{
Expand Down
Loading