-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## Status **READY** ## Description - Fixed broken static page building due to the changes that I last made. - Changed `yarn` commands to `npm`.
- Loading branch information
Showing
9 changed files
with
71 additions
and
1,633 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
v20.10.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,17 @@ | ||
# www.theology101.church | ||
https://www.theology101.church powered by NextJS + GitHub | ||
|
||
## Installation | ||
|
||
All required commands are in `Makefile`. | ||
|
||
- **`make` | `make help`** Shows list of available commands. | ||
- **`make install`** Installs required external packages. | ||
- **`make dev`** Runs the project in `dev` mode. | ||
- **`make build`** Runs build scripts and generates static pages. | ||
|
||
## Development process | ||
|
||
- Run the `dev` server with `make dev` | ||
- When your job is done, check if the static page building is working or not | ||
with `make build` and ensure that no errors are being produced. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
import { staticPathFactory, categoryStaticPropsFactory } from '@utils/static'; | ||
import { TopicsTagsPage } from '@components/topics_tags'; | ||
|
||
export default function Page() { | ||
return <TopicsTagsPage title="Tag" type="tags" lookup="tag" />; | ||
export const getStaticPaths = staticPathFactory('tags'); | ||
|
||
export const getStaticProps = categoryStaticPropsFactory('tags'); | ||
|
||
export default function Page({ entry, videoIds }) { | ||
return <TopicsTagsPage title="Tag" entry={entry} videoIds={videoIds} />; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
import { staticPathFactory, categoryStaticPropsFactory } from '@utils/static'; | ||
import { TopicsTagsPage } from '@components/topics_tags'; | ||
|
||
export default function Page() { | ||
return <TopicsTagsPage title="Topic" type="topics" lookup="topic" />; | ||
export const getStaticPaths = staticPathFactory('topics'); | ||
|
||
export const getStaticProps = categoryStaticPropsFactory('topics'); | ||
|
||
export default function Page({ entry, videoIds }) { | ||
return <TopicsTagsPage title="Topic" entry={entry} videoIds={videoIds} />; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import THEOLOGY101_DATA from '@data/theology101.json'; | ||
import { NAMES_BY_SLUG } from '@constants/seo'; | ||
|
||
export function staticPathFactory(key) { | ||
const obj = key == 'video_id' ? THEOLOGY101_DATA.lookups : NAMES_BY_SLUG; | ||
return async () => ({ | ||
paths: Object.keys(obj[key]).map((slug) => ({ | ||
params: { slug }, | ||
})), | ||
fallback: false, | ||
}); | ||
} | ||
|
||
export function categoryStaticPropsFactory(category) { | ||
return async ({ params: { slug } }) => { | ||
const entry = NAMES_BY_SLUG[category][slug]; | ||
|
||
return entry ? { | ||
props: { | ||
entry, | ||
videoIds: THEOLOGY101_DATA.lookups.tag[entry] || [], | ||
}, | ||
} : { notFound: true }; | ||
}; | ||
} |
Oops, something went wrong.