More generic code-of-conduct and consititution pages

This commit is contained in:
Aditya Thakral 2021-08-23 10:19:58 -04:00
parent eda8393a7a
commit 18e8e0e459
4 changed files with 20 additions and 28 deletions

View File

@ -3,12 +3,12 @@ import path from "path";
import { createReadAllPage } from "@/components/OrganizedContent/ReadAll"; import { createReadAllPage } from "@/components/OrganizedContent/ReadAll";
import { createReadAllGetStaticProps } from "@/components/OrganizedContent/static"; import { createReadAllGetStaticProps } from "@/components/OrganizedContent/static";
export const CODE_OF_CONDUCT_PAGE = path.join("about", "code-of-conduct"); export const options = {
export default createReadAllPage({
title: "Code of Conduct", title: "Code of Conduct",
image: "images/code-of-conduct.svg", image: "images/code-of-conduct.svg",
pagePath: CODE_OF_CONDUCT_PAGE, pagePath: path.join("about", "code-of-conduct"),
}); };
export const getStaticProps = createReadAllGetStaticProps(CODE_OF_CONDUCT_PAGE); export default createReadAllPage(options);
export const getStaticProps = createReadAllGetStaticProps(options.pagePath);

View File

@ -4,13 +4,9 @@ import {
createSectionGetStaticProps, createSectionGetStaticProps,
} from "@/components/OrganizedContent/static"; } from "@/components/OrganizedContent/static";
import { CODE_OF_CONDUCT_PAGE } from "../code-of-conduct"; import { options } from "../code-of-conduct";
export default createSectionPage({ export default createSectionPage(options);
title: "Code of Conduct",
image: "images/code-of-conduct.svg",
pagePath: CODE_OF_CONDUCT_PAGE,
});
export const getStaticProps = createSectionGetStaticProps(CODE_OF_CONDUCT_PAGE); export const getStaticProps = createSectionGetStaticProps(options.pagePath);
export const getStaticPaths = createSectionGetStaticPaths(CODE_OF_CONDUCT_PAGE); export const getStaticPaths = createSectionGetStaticPaths(options.pagePath);

View File

@ -3,12 +3,12 @@ import path from "path";
import { createReadAllPage } from "@/components/OrganizedContent/ReadAll"; import { createReadAllPage } from "@/components/OrganizedContent/ReadAll";
import { createReadAllGetStaticProps } from "@/components/OrganizedContent/static"; import { createReadAllGetStaticProps } from "@/components/OrganizedContent/static";
export const CONSTITUTION_PAGE = path.join("about", "constitution"); export const options = {
export default createReadAllPage({
title: "Constitution", title: "Constitution",
image: "images/constitution.svg", image: "images/constitution.svg",
pagePath: CONSTITUTION_PAGE, pagePath: path.join("about", "constitution"),
}); };
export const getStaticProps = createReadAllGetStaticProps(CONSTITUTION_PAGE); export default createReadAllPage(options);
export const getStaticProps = createReadAllGetStaticProps(options.pagePath);

View File

@ -4,13 +4,9 @@ import {
createSectionGetStaticProps, createSectionGetStaticProps,
} from "@/components/OrganizedContent/static"; } from "@/components/OrganizedContent/static";
import { CONSTITUTION_PAGE } from "../constitution"; import { options } from "../constitution";
export default createSectionPage({ export default createSectionPage(options);
title: "Constitution",
image: "images/constitution.svg",
pagePath: CONSTITUTION_PAGE,
});
export const getStaticProps = createSectionGetStaticProps(CONSTITUTION_PAGE); export const getStaticProps = createSectionGetStaticProps(options.pagePath);
export const getStaticPaths = createSectionGetStaticPaths(CONSTITUTION_PAGE); export const getStaticPaths = createSectionGetStaticPaths(options.pagePath);