Skip to content

Commit

Permalink
📝 docs(config): for export static file
Browse files Browse the repository at this point in the history
  • Loading branch information
lwinmoepaing committed Oct 19, 2023
1 parent ee8bde1 commit 5264380
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 5 deletions.
12 changes: 12 additions & 0 deletions my-loader.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
export default function cloudinaryLoader({
src,
width,
quality,
}: {
src: string;
width: number;
quality?: number;
}) {
// const params = ["f_auto", "c_limit", `w_${width}`, `q_${quality || "auto"}`];
return `${src}`;
}
10 changes: 7 additions & 3 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
const { withContentlayer } = require('next-contentlayer')

const { withContentlayer } = require("next-contentlayer");
const path = require("path");
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
swcMinify: true,
output: "standalone",
output: "export",
images: {
loader: "custom",
loaderFile: "./my-loader.ts",
},
};

module.exports = withContentlayer(nextConfig);
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"start": "next start",
"lint": "next lint",
"lint-staged": "lint-staged — config .lintstagedrc",
"commit": "cz-customizable"
"commit": "cz-customizable",
"serve": "serve ./out"
},
"commit": "./node_modules/cz-customizable/standalone.js",
"config": {
Expand Down
3 changes: 3 additions & 0 deletions src/app/blog/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ const getBlogFromParams = async (slug: string) => {
return blogDetail;
};

export const generateStaticParams = async () =>
allBlogs.map((blog) => ({ slug: blog.slugAsParams }));

type TBlogDetailPageProps = {
params: {
slug: string;
Expand Down
10 changes: 9 additions & 1 deletion src/app/contact-us/page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import Container from "@/components/Common/Container/Container";
import TitleText from "@/components/Common/TitleText/TitleText";
import SquareBox from "@/components/Ui/SquareBox/SquareBox";
import APP_CONFIG from "@/config/config";
import { Metadata } from "next";

Expand All @@ -8,6 +10,12 @@ export const metadata: Metadata = {
};

const ContactUsPage: React.FC = async () => {
return <Container> Contact Us Page </Container>;
return (
<Container>
<SquareBox>
<TitleText>Contact Us Page</TitleText>
</SquareBox>
</Container>
);
};
export default ContactUsPage;
3 changes: 3 additions & 0 deletions src/app/profile/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ export async function generateMetadata({
};
}

export const generateStaticParams = async () =>
allProfiles.map((profile) => ({ slug: profile.slugAsParams }));

type TPProfileDetailPageProps = {
params: {
slug: string;
Expand Down

0 comments on commit 5264380

Please sign in to comment.