on master help sign in
pages: public id pages fallback on descriptions
f36729dMatilde Park
pages/applications/[[...application]].js+5−2
@@ -14,7 +14,7 @@ import MetadataBlock from "../../components/gateway/MetadataBlock";
14import MetadataLink from "../../components/gateway/MetadataLink";
14import MetadataLink from "../../components/gateway/MetadataLink";
15import Description from "../../components/gateway/Description";
15import Description from "../../components/gateway/Description";
16
16
17−const ApplicationPage = ({ data, content, params }) => {
17+const ApplicationPage = ({ data, markdown, params }) => {
18 const { application } = params;
18 const { application } = params;
19 if (!ob.isValidPatp(application[0])) {
19 if (!ob.isValidPatp(application[0])) {
20 return <Gateway404 type="application" />;
20 return <Gateway404 type="application" />;
@@ -146,7 +146,10 @@ export const getServerSideProps = async ({ params, res }) => {
146 )
146 )
147 ) || { data: {}, content: "" };
147 ) || { data: {}, content: "" };
148
148
149+ const markdown =
150+ content !== ""
149− const markdown = JSON.stringify(MarkdownParse({ post: { content } }));
151+ ? JSON.stringify(MarkdownParse({ post: { content } }))
152+ : null;
150
153
151 if (!data.title) {
154 if (!data.title) {
152 data = {
155 data = {
pages/groups/[[...group]].js+4−1
@@ -133,7 +133,10 @@ export const getServerSideProps = async ({ params, res }) => {
133 join(process.cwd(), "content/groups", params.group?.join("/") || "/")
133 join(process.cwd(), "content/groups", params.group?.join("/") || "/")
134 ) || { data: {}, content: "" };
134 ) || { data: {}, content: "" };
135
135
136+ const markdown =
137+ content !== ""
136− const markdown = JSON.stringify(MarkdownParse({ post: { content } }));
138+ ? JSON.stringify(MarkdownParse({ post: { content } }))
139+ : null;
137
140
138 if (!data.title) {
141 if (!data.title) {
139 data = { title: params.group?.join("/"), description: "A group on Urbit." };
142 data = { title: params.group?.join("/"), description: "A group on Urbit." };
pages/ids/[id].js+4−1
@@ -207,7 +207,10 @@ export const getServerSideProps = async ({ params, res }) => {
207 join(process.cwd(), "content/ids/", id.slice(1))
207 join(process.cwd(), "content/ids/", id.slice(1))
208 ) || { data: {}, content: "" };
208 ) || { data: {}, content: "" };
209
209
210+ const markdown =
211+ content !== ""
210− const markdown = JSON.stringify(MarkdownParse({ post: { content } }));
212+ ? JSON.stringify(MarkdownParse({ post: { content } }))
213+ : null;
211
214
212 const applications = getAllPosts(
215 const applications = getAllPosts(
213 ["title", "slug", "image", "bgColor"],
216 ["title", "slug", "image", "bgColor"],