├── .gitignore ├── README.md ├── components ├── date.js ├── layout.js ├── layout.module.css ├── nestedList.js └── nestedList.module.scss ├── docs ├── contributing.md ├── faq.md ├── getting-started │ ├── index.md │ ├── installation.md │ └── quickstart.md ├── index.md └── reference │ ├── components.md │ ├── functions.md │ ├── index.md │ └── nested │ ├── index.md │ ├── nested │ ├── index.md │ └── subnested_file.md │ ├── nested_file.md │ └── nested_file2.md ├── lib ├── docs.js └── posts.js ├── package-lock.json ├── package.json ├── pages ├── _app.js ├── docs │ └── [[...id]].js ├── index.js └── posts │ └── [id].js ├── posts ├── pre-rendering.md └── ssg-ssr.md ├── public ├── favicon.ico └── images │ └── profile.png └── styles ├── global.css └── utils.module.css /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # next.js 12 | /.next/ 13 | /out/ 14 | 15 | # production 16 | /build 17 | 18 | # misc 19 | .DS_Store 20 | 21 | # debug 22 | npm-debug.log* 23 | yarn-debug.log* 24 | yarn-error.log* 25 | 26 | # local env files 27 | .env.local 28 | .env.development.local 29 | .env.test.local 30 | .env.production.local 31 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # NextJS Nested demo 2 | 3 | You can view the deployed version here: https://next-nested.vercel.app/ 4 | 5 | This is the source code of the sample website to demonstrate nested markdown structure rendered in next.js. 6 | 7 | This repo includes minimal code to read infinitely nested folders and subfolders containing markdown files and displayes them in a nested manner and the generated slug replicates the file structure. 8 | 9 | For a folder to be read, it needs to contain an index.md. 10 | 11 | Current code assumes YAML frontmatter `title` for the docs files to be necessary and `date` optional but can be tweaked to whatever you may find suitable. 12 | 13 | The basic patterns are outlined below: 14 | 15 | ## Blog 16 | 17 | The blog is the basic flat normal structure. This is same from Next.js tutorial. 18 | 19 | - When to Use Static Generation v.s. Server-side Rendering 20 | January 2, 2020 21 | - Two Forms of Pre-rendering 22 | January 1, 2020 23 | 24 | ## Docs 25 | 26 | The Docs here are generated in nested manner and have urls in same pattern as file structure. 27 | 28 | - **Documentation** /docs/ 29 | - Contributionsnsn /docs/contributing 30 | - Funkquently asked qwestions /docs/faq 31 | - **Getting Started** /docs/getting-started 32 | - Installation /docs/getting-started/installation 33 | - Quick Start /docs/getting-started/quickstart 34 | - **Reference** /docs/reference 35 | - KOMOPONENTS /docs/reference/components 36 | - FUnktions /docs/reference/functions 37 | - **Nested Index** /docs/reference/nested 38 | - Nested File /docs/reference/nested/nested_file 39 | - **Subnested Index** /docs/reference/nested/subnested 40 | - Sub Nested File /docs/reference/nested/subnested/subnested_file 41 | 42 | ## Docs - Flat 43 | 44 | The Docs can also be displayed in a flattened manner as well but have urls in same pattern as file structure. 45 | 46 | - Documentation 47 | - Contributionsnsn 48 | - Funkquently asked qwestions 49 | - Getting Started 50 | - Installation 51 | - Quick Start 52 | - Reference 53 | - KOMOPONENTS 54 | - FUnktions 55 | - Nested Index 56 | - Nested File 57 | - Subnested Index 58 | - Sub Nested File 59 | 60 | ## Known Issues 61 | 62 | - ~~The folders in Docs can't have same name one after the other. This is a deficiency in the algorithm and should not be a major issue. This only affects the foldername and the title can always remain same!~~ Solved 63 | 64 | ## Credits 65 | 66 | The code for pageFileCache was first implemented by @davecaruso. I separated the file reading for reusability in `lib/docs`, and implemented the component/functions to process and display the tree structure. 67 | 68 | --- 69 | 70 |
71 | With :heart: by xypnox 72 |
73 | -------------------------------------------------------------------------------- /components/date.js: -------------------------------------------------------------------------------- 1 | import { parseISO, format } from 'date-fns'; 2 | 3 | export default function Date({ dateString }) { 4 | const date = parseISO(dateString); 5 | return ; 6 | } 7 | -------------------------------------------------------------------------------- /components/layout.js: -------------------------------------------------------------------------------- 1 | import Head from 'next/head'; 2 | import styles from './layout.module.css'; 3 | import utilStyles from '../styles/utils.module.css'; 4 | import Link from 'next/link'; 5 | 6 | const name = 'xypnox'; 7 | export const siteTitle = 'Next.js Nested Website'; 8 | 9 | export default function Layout({ children, home }) { 10 | return ( 11 |
12 | 13 | 14 | 18 | 24 | 25 | 26 | 27 | {!home && ( 28 |
29 | 30 | ← Back to home 31 | 32 |
33 | )} 34 |
{children}
35 | 36 |
37 | <> 38 | 39 | 40 | {name} 45 | 46 | 47 |

48 | With ❤️ by{' '} 49 | 50 | {name} 51 | 52 |

53 | 54 |
55 |
56 | ); 57 | } 58 | -------------------------------------------------------------------------------- /components/layout.module.css: -------------------------------------------------------------------------------- 1 | .container { 2 | max-width: 36rem; 3 | padding: 0 1rem; 4 | margin: 3rem auto 3rem; 5 | } 6 | 7 | .header { 8 | margin: 5rem 0 0; 9 | display: flex; 10 | flex-direction: column; 11 | align-items: center; 12 | border-top: 4px solid #f0f0f0; 13 | padding-top: 2rem; 14 | } 15 | 16 | .headerImage { 17 | width: 5rem; 18 | height: 5rem; 19 | } 20 | 21 | .backToHome { 22 | margin: 3rem 0 0; 23 | } 24 | -------------------------------------------------------------------------------- /components/nestedList.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import Link from 'next/link'; 3 | import styles from './nestedList.module.scss'; 4 | 5 | export default function NestedList({ dirData }) { 6 | return ( 7 |
8 | 9 |
10 | ); 11 | } 12 | 13 | function File({ file }) { 14 | return ( 15 |
16 | 17 | 18 | {file.matter.title}{' '} 19 |
{`/docs/${file.id}`}
20 |
21 | 22 |
23 | ); 24 | } 25 | 26 | function Folder({ folder, children }) { 27 | return ( 28 |
29 | 30 | 31 | {folder.matter.title}{' '} 32 |
{`/docs/${folder.id}`}
33 |
34 | 35 |
{children}
36 |
37 | ); 38 | } 39 | 40 | const TreeRecursive = ({ data }) => { 41 | return data.map((item) => { 42 | if (item.type === 'file') { 43 | return ; 44 | } 45 | 46 | if (item.type === 'folder') { 47 | return ( 48 | 49 | 50 | 51 | ); 52 | } 53 | }); 54 | }; 55 | -------------------------------------------------------------------------------- /components/nestedList.module.scss: -------------------------------------------------------------------------------- 1 | @mixin hover() { 2 | &:hover { 3 | text-decoration: none; 4 | color: #ff0066; 5 | } 6 | } 7 | 8 | .folderLabel { 9 | display: block; 10 | font-weight: bold; 11 | margin: 10px 0 5px; 12 | color: #333; 13 | font-size: 1.2rem; 14 | @include hover(); 15 | } 16 | 17 | .folder { 18 | padding-left: 10px; 19 | .folder .folderLabel { 20 | font-size: 1.2rem; 21 | } 22 | } 23 | 24 | .label { 25 | color: #666; 26 | @include hover(); 27 | } 28 | .folderContents { 29 | margin-left: 10px; 30 | padding-left: 10px; 31 | border-left: 4px solid #f0f0f0; 32 | } 33 | 34 | .file { 35 | font-size: 1rem; 36 | } 37 | 38 | .slugpath { 39 | font-size: 0.7rem; 40 | color: #999; 41 | padding-bottom: 10px; 42 | } 43 | -------------------------------------------------------------------------------- /docs/contributing.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 'Contributionsnsn' 3 | date: '2020-01-03' 4 | --- 5 | 6 | COUINSYGDUGD 7 | FUNK NANY 8 | 9 | COUINSYGDUGD 10 | 11 | Lorizzle ipsum dolizzle sit yo, consectetuer adipiscing elizzle. Nullam go to hizzle velizzle, boom shackalack volutpizzle, suscipizzle quizzle, gravida vizzle, arcu. Pellentesque eget tortor. Sizzle erizzle. Crazy at dolor dapibizzle turpis fizzle tempor. Bling bling pellentesque nibh izzle turpizzle. Check out this izzle tortor. Sure mammasay mammasa mamma oo sa rhoncizzle nisi. In hac dang dawg dictumst. Funky fresh dapibizzle. Fo shizzle tellus shiz, pretium eu, mattis ac, eleifend vitae, nunc. Crackalackin suscipit. Integer mofo fizzle sed nizzle. 12 | 13 | In check out this dizzle nizzle crackalackin. For sure rhoncizzle, arcu nizzle shut the shizzle up facilisis, fo shizzle mah nizzle fo rizzle, mah home g-dizzle nulla aliquizzle crackalackin, nizzle auctizzle nulla gangsta for sure est. Check out this volutpizzle shiznit augue. Yippiyo mofo lectizzle izzle sure. Prizzle consectetuer blandit sapien. Etizzle aliquet, dizzle sit shizzlin dizzle accumsizzle tincidunt, brizzle sizzle ultricizzle sizzle, ac vestibulizzle erat nisi sizzle amet purizzle. Maecenizzle its fo rizzle tortizzle vel yippiyo. Mammasay mammasa mamma oo sa lobortizzle. Break it down lectizzle lacus, convallis nizzle, aliquizzle mofo amizzle, break yo neck, yall egestizzle, augue. Vivamizzle pimpin'. Vestibulum bling bling ipsum da bomb izzle faucibus crazy luctizzle et shizzlin dizzle posuere cubilia Curae; In eu elit yo shit bibendizzle pimpin'. Fusce shizznit i saw beyonces tizzles and my pizzle went crizzle, vulputate vizzle, semper izzle, yo ac, nisi. Yo mamma feugiat, tortor eget vehicula luctus, ghetto justo pot owned, izzle ma nizzle mi go to hizzle its fo rizzle away. 14 | 15 | ```python 16 | def funk(): 17 | return "Funk it kribs one more time" 18 | ``` 19 | 20 | - List it baby 21 | - nested 22 | - all right 23 | - not quite 24 | - my style 25 | - my vibe 26 | 27 | > Anyway! Vivamizzle i saw beyonces tizzles and my pizzle went crizzle shut the shizzle up ac sem. 28 | 29 | Vivamizzle i saw beyonces tizzles and my pizzle went crizzle shut the shizzle up ac sem. Pellentesque fo shizzle dizzle sheezy ligula dapibizzle interdum. Etiam shizzle my nizzle crocodizzle pharetra dui. Aliquizzle bizzle feugizzle . Shut the shizzle up erat volutpat. In sizzle its fo rizzle stuff. Pellentesque its fo rizzle gizzle izzle nunc. Pimpin' a mauris. Ghetto lorem things, molestie shizzlin dizzle, mollis uhuh ... yih!, molestie dope, crunk. Nulla izzle felis fo shizzle cool egestizzle consequizzle. Integizzle break it down erizzle. Bizzle interdizzle. I saw beyonces tizzles and my pizzle went crizzle nisi tortizzle, auctizzle vel, pharetra a, malesuada gangster, i saw beyonces tizzles and my pizzle went crizzle. That's the shizzle dapibus pimpin' mi. Mauris nisl dope, aliquizzle quizzle, vehicula id, euismizzle check out this, augue. Nullam leo. Morbi boom shackalack pimpin' izzle erat semper nizzle. Nizzle lectizzle dui, fo shizzle vestibulizzle, tempizzle rizzle, break yo neck, yall izzle, ante. 30 | -------------------------------------------------------------------------------- /docs/faq.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 'Funkquently asked qwestions' 3 | date: '2020-01-02' 4 | --- 5 | 6 | FUKN 7 | 8 | Lorizzle ipsum dolizzle sit yo, consectetuer adipiscing elizzle. Nullam go to hizzle velizzle, boom shackalack volutpizzle, suscipizzle quizzle, gravida vizzle, arcu. Pellentesque eget tortor. Sizzle erizzle. Crazy at dolor dapibizzle turpis fizzle tempor. Bling bling pellentesque nibh izzle turpizzle. Check out this izzle tortor. Sure mammasay mammasa mamma oo sa rhoncizzle nisi. In hac dang dawg dictumst. Funky fresh dapibizzle. Fo shizzle tellus shiz, pretium eu, mattis ac, eleifend vitae, nunc. Crackalackin suscipit. Integer mofo fizzle sed nizzle. 9 | 10 | In check out this dizzle nizzle crackalackin. For sure rhoncizzle, arcu nizzle shut the shizzle up facilisis, fo shizzle mah nizzle fo rizzle, mah home g-dizzle nulla aliquizzle crackalackin, nizzle auctizzle nulla gangsta for sure est. Check out this volutpizzle shiznit augue. Yippiyo mofo lectizzle izzle sure. Prizzle consectetuer blandit sapien. Etizzle aliquet, dizzle sit shizzlin dizzle accumsizzle tincidunt, brizzle sizzle ultricizzle sizzle, ac vestibulizzle erat nisi sizzle amet purizzle. Maecenizzle its fo rizzle tortizzle vel yippiyo. Mammasay mammasa mamma oo sa lobortizzle. Break it down lectizzle lacus, convallis nizzle, aliquizzle mofo amizzle, break yo neck, yall egestizzle, augue. Vivamizzle pimpin'. Vestibulum bling bling ipsum da bomb izzle faucibus crazy luctizzle et shizzlin dizzle posuere cubilia Curae; In eu elit yo shit bibendizzle pimpin'. Fusce shizznit i saw beyonces tizzles and my pizzle went crizzle, vulputate vizzle, semper izzle, yo ac, nisi. Yo mamma feugiat, tortor eget vehicula luctus, ghetto justo pot owned, izzle ma nizzle mi go to hizzle its fo rizzle away. 11 | 12 | ```python 13 | def funk(): 14 | return "Fukm it baby one more time" 15 | ``` 16 | 17 | - List it baby 18 | - nested 19 | - all right 20 | - not quite 21 | - my style 22 | - my vibe 23 | 24 | > Anyway! Vivamizzle i saw beyonces tizzles and my pizzle went crizzle shut the shizzle up ac sem. 25 | 26 | Vivamizzle i saw beyonces tizzles and my pizzle went crizzle shut the shizzle up ac sem. Pellentesque fo shizzle dizzle sheezy ligula dapibizzle interdum. Etiam shizzle my nizzle crocodizzle pharetra dui. Aliquizzle bizzle feugizzle . Shut the shizzle up erat volutpat. In sizzle its fo rizzle stuff. Pellentesque its fo rizzle gizzle izzle nunc. Pimpin' a mauris. Ghetto lorem things, molestie shizzlin dizzle, mollis uhuh ... yih!, molestie dope, crunk. Nulla izzle felis fo shizzle cool egestizzle consequizzle. Integizzle break it down erizzle. Bizzle interdizzle. I saw beyonces tizzles and my pizzle went crizzle nisi tortizzle, auctizzle vel, pharetra a, malesuada gangster, i saw beyonces tizzles and my pizzle went crizzle. That's the shizzle dapibus pimpin' mi. Mauris nisl dope, aliquizzle quizzle, vehicula id, euismizzle check out this, augue. Nullam leo. Morbi boom shackalack pimpin' izzle erat semper nizzle. Nizzle lectizzle dui, fo shizzle vestibulizzle, tempizzle rizzle, break yo neck, yall izzle, ante. 27 | -------------------------------------------------------------------------------- /docs/getting-started/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 'Getting Started' 3 | date: '2020-01-03' 4 | --- 5 | 6 | Index of the getting started 7 | 8 | Lorizzle ipsum dolizzle sit yo, consectetuer adipiscing elizzle. Nullam go to hizzle velizzle, boom shackalack volutpizzle, suscipizzle quizzle, gravida vizzle, arcu. Pellentesque eget tortor. Sizzle erizzle. Crazy at dolor dapibizzle turpis fizzle tempor. Bling bling pellentesque nibh izzle turpizzle. Check out this izzle tortor. Sure mammasay mammasa mamma oo sa rhoncizzle nisi. In hac dang dawg dictumst. Funky fresh dapibizzle. Fo shizzle tellus shiz, pretium eu, mattis ac, eleifend vitae, nunc. Crackalackin suscipit. Integer mofo fizzle sed nizzle. 9 | 10 | In check out this dizzle nizzle crackalackin. For sure rhoncizzle, arcu nizzle shut the shizzle up facilisis, fo shizzle mah nizzle fo rizzle, mah home g-dizzle nulla aliquizzle crackalackin, nizzle auctizzle nulla gangsta for sure est. Check out this volutpizzle shiznit augue. Yippiyo mofo lectizzle izzle sure. Prizzle consectetuer blandit sapien. Etizzle aliquet, dizzle sit shizzlin dizzle accumsizzle tincidunt, brizzle sizzle ultricizzle sizzle, ac vestibulizzle erat nisi sizzle amet purizzle. Maecenizzle its fo rizzle tortizzle vel yippiyo. Mammasay mammasa mamma oo sa lobortizzle. Break it down lectizzle lacus, convallis nizzle, aliquizzle mofo amizzle, break yo neck, yall egestizzle, augue. Vivamizzle pimpin'. Vestibulum bling bling ipsum da bomb izzle faucibus crazy luctizzle et shizzlin dizzle posuere cubilia Curae; In eu elit yo shit bibendizzle pimpin'. Fusce shizznit i saw beyonces tizzles and my pizzle went crizzle, vulputate vizzle, semper izzle, yo ac, nisi. Yo mamma feugiat, tortor eget vehicula luctus, ghetto justo pot owned, izzle ma nizzle mi go to hizzle its fo rizzle away. 11 | 12 | ```python 13 | def funk(): 14 | return "Funk it kribs one more time" 15 | ``` 16 | 17 | - List it baby 18 | - nested 19 | - all right 20 | - not quite 21 | - my style 22 | - my vibe 23 | 24 | > Anyway! Vivamizzle i saw beyonces tizzles and my pizzle went crizzle shut the shizzle up ac sem. 25 | 26 | Vivamizzle i saw beyonces tizzles and my pizzle went crizzle shut the shizzle up ac sem. Pellentesque fo shizzle dizzle sheezy ligula dapibizzle interdum. Etiam shizzle my nizzle crocodizzle pharetra dui. Aliquizzle bizzle feugizzle . Shut the shizzle up erat volutpat. In sizzle its fo rizzle stuff. Pellentesque its fo rizzle gizzle izzle nunc. Pimpin' a mauris. Ghetto lorem things, molestie shizzlin dizzle, mollis uhuh ... yih!, molestie dope, crunk. Nulla izzle felis fo shizzle cool egestizzle consequizzle. Integizzle break it down erizzle. Bizzle interdizzle. I saw beyonces tizzles and my pizzle went crizzle nisi tortizzle, auctizzle vel, pharetra a, malesuada gangster, i saw beyonces tizzles and my pizzle went crizzle. That's the shizzle dapibus pimpin' mi. Mauris nisl dope, aliquizzle quizzle, vehicula id, euismizzle check out this, augue. Nullam leo. Morbi boom shackalack pimpin' izzle erat semper nizzle. Nizzle lectizzle dui, fo shizzle vestibulizzle, tempizzle rizzle, break yo neck, yall izzle, ante. 27 | -------------------------------------------------------------------------------- /docs/getting-started/installation.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 'Installation' 3 | date: '2020-01-01' 4 | --- 5 | 6 | Installallalala 7 | 8 | Lorizzle ipsum dolizzle sit yo, consectetuer adipiscing elizzle. Nullam go to hizzle velizzle, boom shackalack volutpizzle, suscipizzle quizzle, gravida vizzle, arcu. Pellentesque eget tortor. Sizzle erizzle. Crazy at dolor dapibizzle turpis fizzle tempor. Bling bling pellentesque nibh izzle turpizzle. Check out this izzle tortor. Sure mammasay mammasa mamma oo sa rhoncizzle nisi. In hac dang dawg dictumst. Funky fresh dapibizzle. Fo shizzle tellus shiz, pretium eu, mattis ac, eleifend vitae, nunc. Crackalackin suscipit. Integer mofo fizzle sed nizzle. 9 | 10 | In check out this dizzle nizzle crackalackin. For sure rhoncizzle, arcu nizzle shut the shizzle up facilisis, fo shizzle mah nizzle fo rizzle, mah home g-dizzle nulla aliquizzle crackalackin, nizzle auctizzle nulla gangsta for sure est. Check out this volutpizzle shiznit augue. Yippiyo mofo lectizzle izzle sure. Prizzle consectetuer blandit sapien. Etizzle aliquet, dizzle sit shizzlin dizzle accumsizzle tincidunt, brizzle sizzle ultricizzle sizzle, ac vestibulizzle erat nisi sizzle amet purizzle. Maecenizzle its fo rizzle tortizzle vel yippiyo. Mammasay mammasa mamma oo sa lobortizzle. Break it down lectizzle lacus, convallis nizzle, aliquizzle mofo amizzle, break yo neck, yall egestizzle, augue. Vivamizzle pimpin'. Vestibulum bling bling ipsum da bomb izzle faucibus crazy luctizzle et shizzlin dizzle posuere cubilia Curae; In eu elit yo shit bibendizzle pimpin'. Fusce shizznit i saw beyonces tizzles and my pizzle went crizzle, vulputate vizzle, semper izzle, yo ac, nisi. Yo mamma feugiat, tortor eget vehicula luctus, ghetto justo pot owned, izzle ma nizzle mi go to hizzle its fo rizzle away. 11 | 12 | ```python 13 | def funk(): 14 | return "Funk it baby one more time" 15 | ``` 16 | -------------------------------------------------------------------------------- /docs/getting-started/quickstart.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 'Quick Start' 3 | date: '2020-01-02' 4 | --- 5 | 6 | Starts like a induction motor. 7 | 8 | Lorizzle ipsum dolizzle sit yo, consectetuer adipiscing elizzle. Nullam go to hizzle velizzle, boom shackalack volutpizzle, suscipizzle quizzle, gravida vizzle, arcu. Pellentesque eget tortor. Sizzle erizzle. Crazy at dolor dapibizzle turpis fizzle tempor. Bling bling pellentesque nibh izzle turpizzle. Check out this izzle tortor. Sure mammasay mammasa mamma oo sa rhoncizzle nisi. In hac dang dawg dictumst. Funky fresh dapibizzle. Fo shizzle tellus shiz, pretium eu, mattis ac, eleifend vitae, nunc. Crackalackin suscipit. Integer mofo fizzle sed nizzle. 9 | 10 | In check out this dizzle nizzle crackalackin. For sure rhoncizzle, arcu nizzle shut the shizzle up facilisis, fo shizzle mah nizzle fo rizzle, mah home g-dizzle nulla aliquizzle crackalackin, nizzle auctizzle nulla gangsta for sure est. Check out this volutpizzle shiznit augue. Yippiyo mofo lectizzle izzle sure. Prizzle consectetuer blandit sapien. Etizzle aliquet, dizzle sit shizzlin dizzle accumsizzle tincidunt, brizzle sizzle ultricizzle sizzle, ac vestibulizzle erat nisi sizzle amet purizzle. Maecenizzle its fo rizzle tortizzle vel yippiyo. Mammasay mammasa mamma oo sa lobortizzle. Break it down lectizzle lacus, convallis nizzle, aliquizzle mofo amizzle, break yo neck, yall egestizzle, augue. Vivamizzle pimpin'. Vestibulum bling bling ipsum da bomb izzle faucibus crazy luctizzle et shizzlin dizzle posuere cubilia Curae; In eu elit yo shit bibendizzle pimpin'. Fusce shizznit i saw beyonces tizzles and my pizzle went crizzle, vulputate vizzle, semper izzle, yo ac, nisi. Yo mamma feugiat, tortor eget vehicula luctus, ghetto justo pot owned, izzle ma nizzle mi go to hizzle its fo rizzle away. 11 | 12 | ```python 13 | def funk(): 14 | return "Funk it baby one more time" 15 | ``` 16 | 17 | - List it baby 18 | - nested 19 | - all right 20 | - not quite 21 | - my style 22 | - my vibe 23 | 24 | > Anyway! Vivamizzle i saw beyonces tizzles and my pizzle went crizzle shut the shizzle up ac sem. 25 | 26 | Vivamizzle i saw beyonces tizzles and my pizzle went crizzle shut the shizzle up ac sem. Pellentesque fo shizzle dizzle sheezy ligula dapibizzle interdum. Etiam shizzle my nizzle crocodizzle pharetra dui. Aliquizzle bizzle feugizzle . Shut the shizzle up erat volutpat. In sizzle its fo rizzle stuff. Pellentesque its fo rizzle gizzle izzle nunc. Pimpin' a mauris. Ghetto lorem things, molestie shizzlin dizzle, mollis uhuh ... yih!, molestie dope, crunk. Nulla izzle felis fo shizzle cool egestizzle consequizzle. Integizzle break it down erizzle. Bizzle interdizzle. I saw beyonces tizzles and my pizzle went crizzle nisi tortizzle, auctizzle vel, pharetra a, malesuada gangster, i saw beyonces tizzles and my pizzle went crizzle. That's the shizzle dapibus pimpin' mi. Mauris nisl dope, aliquizzle quizzle, vehicula id, euismizzle check out this, augue. Nullam leo. Morbi boom shackalack pimpin' izzle erat semper nizzle. Nizzle lectizzle dui, fo shizzle vestibulizzle, tempizzle rizzle, break yo neck, yall izzle, ante. 27 | -------------------------------------------------------------------------------- /docs/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 'Documentation' 3 | date: '2020-01-02' 4 | --- 5 | 6 | Lorizzle ipsum dolizzle sit yo, consectetuer adipiscing elizzle. Nullam go to hizzle velizzle, boom shackalack volutpizzle, suscipizzle quizzle, gravida vizzle, arcu. Pellentesque eget tortor. Sizzle erizzle. Crazy at dolor dapibizzle turpis fizzle tempor. Bling bling pellentesque nibh izzle turpizzle. Check out this izzle tortor. Sure mammasay mammasa mamma oo sa rhoncizzle nisi. In hac dang dawg dictumst. Funky fresh dapibizzle. Fo shizzle tellus shiz, pretium eu, mattis ac, eleifend vitae, nunc. Crackalackin suscipit. Integer mofo fizzle sed nizzle. 7 | 8 | In check out this dizzle nizzle crackalackin. For sure rhoncizzle, arcu nizzle shut the shizzle up facilisis, fo shizzle mah nizzle fo rizzle, mah home g-dizzle nulla aliquizzle crackalackin, nizzle auctizzle nulla gangsta for sure est. Check out this volutpizzle shiznit augue. Yippiyo mofo lectizzle izzle sure. Prizzle consectetuer blandit sapien. Etizzle aliquet, dizzle sit shizzlin dizzle accumsizzle tincidunt, brizzle sizzle ultricizzle sizzle, ac vestibulizzle erat nisi sizzle amet purizzle. Maecenizzle its fo rizzle tortizzle vel yippiyo. Mammasay mammasa mamma oo sa lobortizzle. Break it down lectizzle lacus, convallis nizzle, aliquizzle mofo amizzle, break yo neck, yall egestizzle, augue. Vivamizzle pimpin'. Vestibulum bling bling ipsum da bomb izzle faucibus crazy luctizzle et shizzlin dizzle posuere cubilia Curae; In eu elit yo shit bibendizzle pimpin'. Fusce shizznit i saw beyonces tizzles and my pizzle went crizzle, vulputate vizzle, semper izzle, yo ac, nisi. Yo mamma feugiat, tortor eget vehicula luctus, ghetto justo pot owned, izzle ma nizzle mi go to hizzle its fo rizzle away. 9 | -------------------------------------------------------------------------------- /docs/reference/components.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 'KOMOPONENTS' 3 | date: '2020-01-04' 4 | --- 5 | 6 | CoMPONENTs 7 | 8 | Lorizzle ipsum dolizzle sit yo, consectetuer adipiscing elizzle. Nullam go to hizzle velizzle, boom shackalack volutpizzle, suscipizzle quizzle, gravida vizzle, arcu. Pellentesque eget tortor. Sizzle erizzle. Crazy at dolor dapibizzle turpis fizzle tempor. Bling bling pellentesque nibh izzle turpizzle. Check out this izzle tortor. Sure mammasay mammasa mamma oo sa rhoncizzle nisi. In hac dang dawg dictumst. Funky fresh dapibizzle. Fo shizzle tellus shiz, pretium eu, mattis ac, eleifend vitae, nunc. Crackalackin suscipit. Integer mofo fizzle sed nizzle. 9 | 10 | In check out this dizzle nizzle crackalackin. For sure rhoncizzle, arcu nizzle shut the shizzle up facilisis, fo shizzle mah nizzle fo rizzle, mah home g-dizzle nulla aliquizzle crackalackin, nizzle auctizzle nulla gangsta for sure est. Check out this volutpizzle shiznit augue. Yippiyo mofo lectizzle izzle sure. Prizzle consectetuer blandit sapien. Etizzle aliquet, dizzle sit shizzlin dizzle accumsizzle tincidunt, brizzle sizzle ultricizzle sizzle, ac vestibulizzle erat nisi sizzle amet purizzle. Maecenizzle its fo rizzle tortizzle vel yippiyo. Mammasay mammasa mamma oo sa lobortizzle. Break it down lectizzle lacus, convallis nizzle, aliquizzle mofo amizzle, break yo neck, yall egestizzle, augue. Vivamizzle pimpin'. Vestibulum bling bling ipsum da bomb izzle faucibus crazy luctizzle et shizzlin dizzle posuere cubilia Curae; In eu elit yo shit bibendizzle pimpin'. Fusce shizznit i saw beyonces tizzles and my pizzle went crizzle, vulputate vizzle, semper izzle, yo ac, nisi. Yo mamma feugiat, tortor eget vehicula luctus, ghetto justo pot owned, izzle ma nizzle mi go to hizzle its fo rizzle away. 11 | 12 | ```python 13 | def funk(): 14 | return "Funk it kribs one more time" 15 | ``` 16 | 17 | - List it baby 18 | - nested 19 | - all right 20 | - not quite 21 | - my style 22 | - my life 23 | 24 | > Anyway! Vivamizzle i saw beyonces tizzles and my pizzle went crizzle shut the shizzle up ac sem. 25 | 26 | Vivamizzle i saw beyonces tizzles and my pizzle went crizzle shut the shizzle up ac sem. Pellentesque fo shizzle dizzle sheezy ligula dapibizzle interdum. Etiam shizzle my nizzle crocodizzle pharetra dui. Aliquizzle bizzle feugizzle . Shut the shizzle up erat volutpat. In sizzle its fo rizzle stuff. Pellentesque its fo rizzle gizzle izzle nunc. Pimpin' a mauris. Ghetto lorem things, molestie shizzlin dizzle, mollis uhuh ... yih!, molestie dope, crunk. Nulla izzle felis fo shizzle cool egestizzle consequizzle. Integizzle break it down erizzle. Bizzle interdizzle. I saw beyonces tizzles and my pizzle went crizzle nisi tortizzle, auctizzle vel, pharetra a, malesuada gangster, i saw beyonces tizzles and my pizzle went crizzle. That's the shizzle dapibus pimpin' mi. Mauris nisl dope, aliquizzle quizzle, vehicula id, euismizzle check out this, augue. Nullam leo. Morbi boom shackalack pimpin' izzle erat semper nizzle. Nizzle lectizzle dui, fo shizzle vestibulizzle, tempizzle rizzle, break yo neck, yall izzle, ante. 27 | -------------------------------------------------------------------------------- /docs/reference/functions.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 'FUnktions' 3 | date: '2020-01-03' 4 | --- 5 | 6 | FUNK NANY. 7 | 8 | Lorizzle ipsum dolizzle sit yo, consectetuer adipiscing elizzle. Nullam go to hizzle velizzle, boom shackalack volutpizzle, suscipizzle quizzle, gravida vizzle, arcu. Pellentesque eget tortor. Sizzle erizzle. Crazy at dolor dapibizzle turpis fizzle tempor. Bling bling pellentesque nibh izzle turpizzle. Check out this izzle tortor. Sure mammasay mammasa mamma oo sa rhoncizzle nisi. In hac dang dawg dictumst. Funky fresh dapibizzle. Fo shizzle tellus shiz, pretium eu, mattis ac, eleifend vitae, nunc. Crackalackin suscipit. Integer mofo fizzle sed nizzle. 9 | 10 | In check out this dizzle nizzle crackalackin. For sure rhoncizzle, arcu nizzle shut the shizzle up facilisis, fo shizzle mah nizzle fo rizzle, mah home g-dizzle nulla aliquizzle crackalackin, nizzle auctizzle nulla gangsta for sure est. Check out this volutpizzle shiznit augue. Yippiyo mofo lectizzle izzle sure. Prizzle consectetuer blandit sapien. Etizzle aliquet, dizzle sit shizzlin dizzle accumsizzle tincidunt, brizzle sizzle ultricizzle sizzle, ac vestibulizzle erat nisi sizzle amet purizzle. Maecenizzle its fo rizzle tortizzle vel yippiyo. Mammasay mammasa mamma oo sa lobortizzle. Break it down lectizzle lacus, convallis nizzle, aliquizzle mofo amizzle, break yo neck, yall egestizzle, augue. Vivamizzle pimpin'. Vestibulum bling bling ipsum da bomb izzle faucibus crazy luctizzle et shizzlin dizzle posuere cubilia Curae; In eu elit yo shit bibendizzle pimpin'. Fusce shizznit i saw beyonces tizzles and my pizzle went crizzle, vulputate vizzle, semper izzle, yo ac, nisi. Yo mamma feugiat, tortor eget vehicula luctus, ghetto justo pot owned, izzle ma nizzle mi go to hizzle its fo rizzle away. 11 | 12 | ```python 13 | def funk(): 14 | return "Funk it kribs one more time" 15 | ``` 16 | 17 | - List it baby 18 | - nested 19 | - all right 20 | - not quite 21 | - my style 22 | - my vibe 23 | 24 | > Anyway! Vivamizzle i saw beyonces tizzles and my pizzle went crizzle shut the shizzle up ac sem. 25 | 26 | Vivamizzle i saw beyonces tizzles and my pizzle went crizzle shut the shizzle up ac sem. Pellentesque fo shizzle dizzle sheezy ligula dapibizzle interdum. Etiam shizzle my nizzle crocodizzle pharetra dui. Aliquizzle bizzle feugizzle . Shut the shizzle up erat volutpat. In sizzle its fo rizzle stuff. Pellentesque its fo rizzle gizzle izzle nunc. Pimpin' a mauris. Ghetto lorem things, molestie shizzlin dizzle, mollis uhuh ... yih!, molestie dope, crunk. Nulla izzle felis fo shizzle cool egestizzle consequizzle. Integizzle break it down erizzle. Bizzle interdizzle. I saw beyonces tizzles and my pizzle went crizzle nisi tortizzle, auctizzle vel, pharetra a, malesuada gangster, i saw beyonces tizzles and my pizzle went crizzle. That's the shizzle dapibus pimpin' mi. Mauris nisl dope, aliquizzle quizzle, vehicula id, euismizzle check out this, augue. Nullam leo. Morbi boom shackalack pimpin' izzle erat semper nizzle. Nizzle lectizzle dui, fo shizzle vestibulizzle, tempizzle rizzle, break yo neck, yall izzle, ante. 27 | -------------------------------------------------------------------------------- /docs/reference/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 'Reference' 3 | date: '2020-01-03' 4 | --- 5 | 6 | Index Reference 7 | 8 | Lorizzle ipsum dolizzle sit yo, consectetuer adipiscing elizzle. Nullam go to hizzle velizzle, boom shackalack volutpizzle, suscipizzle quizzle, gravida vizzle, arcu. Pellentesque eget tortor. Sizzle erizzle. Crazy at dolor dapibizzle turpis fizzle tempor. Bling bling pellentesque nibh izzle turpizzle. Check out this izzle tortor. Sure mammasay mammasa mamma oo sa rhoncizzle nisi. In hac dang dawg dictumst. Funky fresh dapibizzle. Fo shizzle tellus shiz, pretium eu, mattis ac, eleifend vitae, nunc. Crackalackin suscipit. Integer mofo fizzle sed nizzle. 9 | 10 | In check out this dizzle nizzle crackalackin. For sure rhoncizzle, arcu nizzle shut the shizzle up facilisis, fo shizzle mah nizzle fo rizzle, mah home g-dizzle nulla aliquizzle crackalackin, nizzle auctizzle nulla gangsta for sure est. Check out this volutpizzle shiznit augue. Yippiyo mofo lectizzle izzle sure. Prizzle consectetuer blandit sapien. Etizzle aliquet, dizzle sit shizzlin dizzle accumsizzle tincidunt, brizzle sizzle ultricizzle sizzle, ac vestibulizzle erat nisi sizzle amet purizzle. Maecenizzle its fo rizzle tortizzle vel yippiyo. Mammasay mammasa mamma oo sa lobortizzle. Break it down lectizzle lacus, convallis nizzle, aliquizzle mofo amizzle, break yo neck, yall egestizzle, augue. Vivamizzle pimpin'. Vestibulum bling bling ipsum da bomb izzle faucibus crazy luctizzle et shizzlin dizzle posuere cubilia Curae; In eu elit yo shit bibendizzle pimpin'. Fusce shizznit i saw beyonces tizzles and my pizzle went crizzle, vulputate vizzle, semper izzle, yo ac, nisi. Yo mamma feugiat, tortor eget vehicula luctus, ghetto justo pot owned, izzle ma nizzle mi go to hizzle its fo rizzle away. 11 | 12 | ```python 13 | def funk(): 14 | return "Funk it kribs one more time" 15 | ``` 16 | 17 | - List it baby 18 | - nested 19 | - all right 20 | - not quite 21 | - my style 22 | - my vibe 23 | 24 | > Anyway! Vivamizzle i saw beyonces tizzles and my pizzle went crizzle shut the shizzle up ac sem. 25 | 26 | Vivamizzle i saw beyonces tizzles and my pizzle went crizzle shut the shizzle up ac sem. Pellentesque fo shizzle dizzle sheezy ligula dapibizzle interdum. Etiam shizzle my nizzle crocodizzle pharetra dui. Aliquizzle bizzle feugizzle . Shut the shizzle up erat volutpat. In sizzle its fo rizzle stuff. Pellentesque its fo rizzle gizzle izzle nunc. Pimpin' a mauris. Ghetto lorem things, molestie shizzlin dizzle, mollis uhuh ... yih!, molestie dope, crunk. Nulla izzle felis fo shizzle cool egestizzle consequizzle. Integizzle break it down erizzle. Bizzle interdizzle. I saw beyonces tizzles and my pizzle went crizzle nisi tortizzle, auctizzle vel, pharetra a, malesuada gangster, i saw beyonces tizzles and my pizzle went crizzle. That's the shizzle dapibus pimpin' mi. Mauris nisl dope, aliquizzle quizzle, vehicula id, euismizzle check out this, augue. Nullam leo. Morbi boom shackalack pimpin' izzle erat semper nizzle. Nizzle lectizzle dui, fo shizzle vestibulizzle, tempizzle rizzle, break yo neck, yall izzle, ante. 27 | -------------------------------------------------------------------------------- /docs/reference/nested/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 'Nested Index' 3 | date: '2020-01-03' 4 | --- 5 | 6 | Index Reference 7 | 8 | Lorizzle ipsum dolizzle sit yo, consectetuer adipiscing elizzle. Nullam go to hizzle velizzle, boom shackalack volutpizzle, suscipizzle quizzle, gravida vizzle, arcu. Pellentesque eget tortor. Sizzle erizzle. Crazy at dolor dapibizzle turpis fizzle tempor. Bling bling pellentesque nibh izzle turpizzle. Check out this izzle tortor. Sure mammasay mammasa mamma oo sa rhoncizzle nisi. In hac dang dawg dictumst. Funky fresh dapibizzle. Fo shizzle tellus shiz, pretium eu, mattis ac, eleifend vitae, nunc. Crackalackin suscipit. Integer mofo fizzle sed nizzle. 9 | 10 | In check out this dizzle nizzle crackalackin. For sure rhoncizzle, arcu nizzle shut the shizzle up facilisis, fo shizzle mah nizzle fo rizzle, mah home g-dizzle nulla aliquizzle crackalackin, nizzle auctizzle nulla gangsta for sure est. Check out this volutpizzle shiznit augue. Yippiyo mofo lectizzle izzle sure. Prizzle consectetuer blandit sapien. Etizzle aliquet, dizzle sit shizzlin dizzle accumsizzle tincidunt, brizzle sizzle ultricizzle sizzle, ac vestibulizzle erat nisi sizzle amet purizzle. Maecenizzle its fo rizzle tortizzle vel yippiyo. Mammasay mammasa mamma oo sa lobortizzle. Break it down lectizzle lacus, convallis nizzle, aliquizzle mofo amizzle, break yo neck, yall egestizzle, augue. Vivamizzle pimpin'. Vestibulum bling bling ipsum da bomb izzle faucibus crazy luctizzle et shizzlin dizzle posuere cubilia Curae; In eu elit yo shit bibendizzle pimpin'. Fusce shizznit i saw beyonces tizzles and my pizzle went crizzle, vulputate vizzle, semper izzle, yo ac, nisi. Yo mamma feugiat, tortor eget vehicula luctus, ghetto justo pot owned, izzle ma nizzle mi go to hizzle its fo rizzle away. 11 | 12 | ```python 13 | def funk(): 14 | return "Funk it kribs one more time" 15 | ``` 16 | 17 | - List it baby 18 | - nested 19 | - all right 20 | - not quite 21 | - my style 22 | - my vibe 23 | 24 | > Anyway! Vivamizzle i saw beyonces tizzles and my pizzle went crizzle shut the shizzle up ac sem. 25 | 26 | Vivamizzle i saw beyonces tizzles and my pizzle went crizzle shut the shizzle up ac sem. Pellentesque fo shizzle dizzle sheezy ligula dapibizzle interdum. Etiam shizzle my nizzle crocodizzle pharetra dui. Aliquizzle bizzle feugizzle . Shut the shizzle up erat volutpat. In sizzle its fo rizzle stuff. Pellentesque its fo rizzle gizzle izzle nunc. Pimpin' a mauris. Ghetto lorem things, molestie shizzlin dizzle, mollis uhuh ... yih!, molestie dope, crunk. Nulla izzle felis fo shizzle cool egestizzle consequizzle. Integizzle break it down erizzle. Bizzle interdizzle. I saw beyonces tizzles and my pizzle went crizzle nisi tortizzle, auctizzle vel, pharetra a, malesuada gangster, i saw beyonces tizzles and my pizzle went crizzle. That's the shizzle dapibus pimpin' mi. Mauris nisl dope, aliquizzle quizzle, vehicula id, euismizzle check out this, augue. Nullam leo. Morbi boom shackalack pimpin' izzle erat semper nizzle. Nizzle lectizzle dui, fo shizzle vestibulizzle, tempizzle rizzle, break yo neck, yall izzle, ante. 27 | -------------------------------------------------------------------------------- /docs/reference/nested/nested/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 'Ah look same folder name' 3 | date: '2020-01-03' 4 | --- 5 | 6 | Index Reference 7 | 8 | Lorizzle ipsum dolizzle sit yo, consectetuer adipiscing elizzle. Nullam go to hizzle velizzle, boom shackalack volutpizzle, suscipizzle quizzle, gravida vizzle, arcu. Pellentesque eget tortor. Sizzle erizzle. Crazy at dolor dapibizzle turpis fizzle tempor. Bling bling pellentesque nibh izzle turpizzle. Check out this izzle tortor. Sure mammasay mammasa mamma oo sa rhoncizzle nisi. In hac dang dawg dictumst. Funky fresh dapibizzle. Fo shizzle tellus shiz, pretium eu, mattis ac, eleifend vitae, nunc. Crackalackin suscipit. Integer mofo fizzle sed nizzle. 9 | 10 | In check out this dizzle nizzle crackalackin. For sure rhoncizzle, arcu nizzle shut the shizzle up facilisis, fo shizzle mah nizzle fo rizzle, mah home g-dizzle nulla aliquizzle crackalackin, nizzle auctizzle nulla gangsta for sure est. Check out this volutpizzle shiznit augue. Yippiyo mofo lectizzle izzle sure. Prizzle consectetuer blandit sapien. Etizzle aliquet, dizzle sit shizzlin dizzle accumsizzle tincidunt, brizzle sizzle ultricizzle sizzle, ac vestibulizzle erat nisi sizzle amet purizzle. Maecenizzle its fo rizzle tortizzle vel yippiyo. Mammasay mammasa mamma oo sa lobortizzle. Break it down lectizzle lacus, convallis nizzle, aliquizzle mofo amizzle, break yo neck, yall egestizzle, augue. Vivamizzle pimpin'. Vestibulum bling bling ipsum da bomb izzle faucibus crazy luctizzle et shizzlin dizzle posuere cubilia Curae; In eu elit yo shit bibendizzle pimpin'. Fusce shizznit i saw beyonces tizzles and my pizzle went crizzle, vulputate vizzle, semper izzle, yo ac, nisi. Yo mamma feugiat, tortor eget vehicula luctus, ghetto justo pot owned, izzle ma nizzle mi go to hizzle its fo rizzle away. 11 | 12 | ```python 13 | def funk(): 14 | return "Funk it kribs one more time" 15 | ``` 16 | 17 | - List it baby 18 | - nested 19 | - all right 20 | - not quite 21 | - my style 22 | - my vibe 23 | 24 | > Anyway! Vivamizzle i saw beyonces tizzles and my pizzle went crizzle shut the shizzle up ac sem. 25 | 26 | Vivamizzle i saw beyonces tizzles and my pizzle went crizzle shut the shizzle up ac sem. Pellentesque fo shizzle dizzle sheezy ligula dapibizzle interdum. Etiam shizzle my nizzle crocodizzle pharetra dui. Aliquizzle bizzle feugizzle . Shut the shizzle up erat volutpat. In sizzle its fo rizzle stuff. Pellentesque its fo rizzle gizzle izzle nunc. Pimpin' a mauris. Ghetto lorem things, molestie shizzlin dizzle, mollis uhuh ... yih!, molestie dope, crunk. Nulla izzle felis fo shizzle cool egestizzle consequizzle. Integizzle break it down erizzle. Bizzle interdizzle. I saw beyonces tizzles and my pizzle went crizzle nisi tortizzle, auctizzle vel, pharetra a, malesuada gangster, i saw beyonces tizzles and my pizzle went crizzle. That's the shizzle dapibus pimpin' mi. Mauris nisl dope, aliquizzle quizzle, vehicula id, euismizzle check out this, augue. Nullam leo. Morbi boom shackalack pimpin' izzle erat semper nizzle. Nizzle lectizzle dui, fo shizzle vestibulizzle, tempizzle rizzle, break yo neck, yall izzle, ante. 27 | -------------------------------------------------------------------------------- /docs/reference/nested/nested/subnested_file.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 'Sub Nested File' 3 | date: '2020-01-03' 4 | --- 5 | 6 | Index Reference 7 | 8 | Lorizzle ipsum dolizzle sit yo, consectetuer adipiscing elizzle. Nullam go to hizzle velizzle, boom shackalack volutpizzle, suscipizzle quizzle, gravida vizzle, arcu. Pellentesque eget tortor. Sizzle erizzle. Crazy at dolor dapibizzle turpis fizzle tempor. Bling bling pellentesque nibh izzle turpizzle. Check out this izzle tortor. Sure mammasay mammasa mamma oo sa rhoncizzle nisi. In hac dang dawg dictumst. Funky fresh dapibizzle. Fo shizzle tellus shiz, pretium eu, mattis ac, eleifend vitae, nunc. Crackalackin suscipit. Integer mofo fizzle sed nizzle. 9 | 10 | In check out this dizzle nizzle crackalackin. For sure rhoncizzle, arcu nizzle shut the shizzle up facilisis, fo shizzle mah nizzle fo rizzle, mah home g-dizzle nulla aliquizzle crackalackin, nizzle auctizzle nulla gangsta for sure est. Check out this volutpizzle shiznit augue. Yippiyo mofo lectizzle izzle sure. Prizzle consectetuer blandit sapien. Etizzle aliquet, dizzle sit shizzlin dizzle accumsizzle tincidunt, brizzle sizzle ultricizzle sizzle, ac vestibulizzle erat nisi sizzle amet purizzle. Maecenizzle its fo rizzle tortizzle vel yippiyo. Mammasay mammasa mamma oo sa lobortizzle. Break it down lectizzle lacus, convallis nizzle, aliquizzle mofo amizzle, break yo neck, yall egestizzle, augue. Vivamizzle pimpin'. Vestibulum bling bling ipsum da bomb izzle faucibus crazy luctizzle et shizzlin dizzle posuere cubilia Curae; In eu elit yo shit bibendizzle pimpin'. Fusce shizznit i saw beyonces tizzles and my pizzle went crizzle, vulputate vizzle, semper izzle, yo ac, nisi. Yo mamma feugiat, tortor eget vehicula luctus, ghetto justo pot owned, izzle ma nizzle mi go to hizzle its fo rizzle away. 11 | 12 | ```python 13 | def funk(): 14 | return "Funk it kribs one more time" 15 | ``` 16 | 17 | - List it baby 18 | - nested 19 | - all right 20 | - not quite 21 | - my style 22 | - my vibe 23 | 24 | > Anyway! Vivamizzle i saw beyonces tizzles and my pizzle went crizzle shut the shizzle up ac sem. 25 | 26 | Vivamizzle i saw beyonces tizzles and my pizzle went crizzle shut the shizzle up ac sem. Pellentesque fo shizzle dizzle sheezy ligula dapibizzle interdum. Etiam shizzle my nizzle crocodizzle pharetra dui. Aliquizzle bizzle feugizzle . Shut the shizzle up erat volutpat. In sizzle its fo rizzle stuff. Pellentesque its fo rizzle gizzle izzle nunc. Pimpin' a mauris. Ghetto lorem things, molestie shizzlin dizzle, mollis uhuh ... yih!, molestie dope, crunk. Nulla izzle felis fo shizzle cool egestizzle consequizzle. Integizzle break it down erizzle. Bizzle interdizzle. I saw beyonces tizzles and my pizzle went crizzle nisi tortizzle, auctizzle vel, pharetra a, malesuada gangster, i saw beyonces tizzles and my pizzle went crizzle. That's the shizzle dapibus pimpin' mi. Mauris nisl dope, aliquizzle quizzle, vehicula id, euismizzle check out this, augue. Nullam leo. Morbi boom shackalack pimpin' izzle erat semper nizzle. Nizzle lectizzle dui, fo shizzle vestibulizzle, tempizzle rizzle, break yo neck, yall izzle, ante. 27 | -------------------------------------------------------------------------------- /docs/reference/nested/nested_file.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 'Nested File' 3 | date: '2020-01-03' 4 | --- 5 | 6 | Index Reference 7 | 8 | Lorizzle ipsum dolizzle sit yo, consectetuer adipiscing elizzle. Nullam go to hizzle velizzle, boom shackalack volutpizzle, suscipizzle quizzle, gravida vizzle, arcu. Pellentesque eget tortor. Sizzle erizzle. Crazy at dolor dapibizzle turpis fizzle tempor. Bling bling pellentesque nibh izzle turpizzle. Check out this izzle tortor. Sure mammasay mammasa mamma oo sa rhoncizzle nisi. In hac dang dawg dictumst. Funky fresh dapibizzle. Fo shizzle tellus shiz, pretium eu, mattis ac, eleifend vitae, nunc. Crackalackin suscipit. Integer mofo fizzle sed nizzle. 9 | 10 | In check out this dizzle nizzle crackalackin. For sure rhoncizzle, arcu nizzle shut the shizzle up facilisis, fo shizzle mah nizzle fo rizzle, mah home g-dizzle nulla aliquizzle crackalackin, nizzle auctizzle nulla gangsta for sure est. Check out this volutpizzle shiznit augue. Yippiyo mofo lectizzle izzle sure. Prizzle consectetuer blandit sapien. Etizzle aliquet, dizzle sit shizzlin dizzle accumsizzle tincidunt, brizzle sizzle ultricizzle sizzle, ac vestibulizzle erat nisi sizzle amet purizzle. Maecenizzle its fo rizzle tortizzle vel yippiyo. Mammasay mammasa mamma oo sa lobortizzle. Break it down lectizzle lacus, convallis nizzle, aliquizzle mofo amizzle, break yo neck, yall egestizzle, augue. Vivamizzle pimpin'. Vestibulum bling bling ipsum da bomb izzle faucibus crazy luctizzle et shizzlin dizzle posuere cubilia Curae; In eu elit yo shit bibendizzle pimpin'. Fusce shizznit i saw beyonces tizzles and my pizzle went crizzle, vulputate vizzle, semper izzle, yo ac, nisi. Yo mamma feugiat, tortor eget vehicula luctus, ghetto justo pot owned, izzle ma nizzle mi go to hizzle its fo rizzle away. 11 | 12 | ```python 13 | def funk(): 14 | return "Funk it kribs one more time" 15 | ``` 16 | 17 | - List it baby 18 | - nested 19 | - all right 20 | - not quite 21 | - my style 22 | - my vibe 23 | 24 | > Anyway! Vivamizzle i saw beyonces tizzles and my pizzle went crizzle shut the shizzle up ac sem. 25 | 26 | Vivamizzle i saw beyonces tizzles and my pizzle went crizzle shut the shizzle up ac sem. Pellentesque fo shizzle dizzle sheezy ligula dapibizzle interdum. Etiam shizzle my nizzle crocodizzle pharetra dui. Aliquizzle bizzle feugizzle . Shut the shizzle up erat volutpat. In sizzle its fo rizzle stuff. Pellentesque its fo rizzle gizzle izzle nunc. Pimpin' a mauris. Ghetto lorem things, molestie shizzlin dizzle, mollis uhuh ... yih!, molestie dope, crunk. Nulla izzle felis fo shizzle cool egestizzle consequizzle. Integizzle break it down erizzle. Bizzle interdizzle. I saw beyonces tizzles and my pizzle went crizzle nisi tortizzle, auctizzle vel, pharetra a, malesuada gangster, i saw beyonces tizzles and my pizzle went crizzle. That's the shizzle dapibus pimpin' mi. Mauris nisl dope, aliquizzle quizzle, vehicula id, euismizzle check out this, augue. Nullam leo. Morbi boom shackalack pimpin' izzle erat semper nizzle. Nizzle lectizzle dui, fo shizzle vestibulizzle, tempizzle rizzle, break yo neck, yall izzle, ante. 27 | -------------------------------------------------------------------------------- /docs/reference/nested/nested_file2.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 'Nested File 2' 3 | date: '2020-01-03' 4 | --- 5 | 6 | Nest it baby one more time 7 | 8 | Lorizzle ipsum dolizzle sit yo, consectetuer adipiscing elizzle. Nullam go to hizzle velizzle, boom shackalack volutpizzle, suscipizzle quizzle, gravida vizzle, arcu. Pellentesque eget tortor. Sizzle erizzle. Crazy at dolor dapibizzle turpis fizzle tempor. Bling bling pellentesque nibh izzle turpizzle. Check out this izzle tortor. Sure mammasay mammasa mamma oo sa rhoncizzle nisi. In hac dang dawg dictumst. Funky fresh dapibizzle. Fo shizzle tellus shiz, pretium eu, mattis ac, eleifend vitae, nunc. Crackalackin suscipit. Integer mofo fizzle sed nizzle. 9 | 10 | In check out this dizzle nizzle crackalackin. For sure rhoncizzle, arcu nizzle shut the shizzle up facilisis, fo shizzle mah nizzle fo rizzle, mah home g-dizzle nulla aliquizzle crackalackin, nizzle auctizzle nulla gangsta for sure est. Check out this volutpizzle shiznit augue. Yippiyo mofo lectizzle izzle sure. Prizzle consectetuer blandit sapien. Etizzle aliquet, dizzle sit shizzlin dizzle accumsizzle tincidunt, brizzle sizzle ultricizzle sizzle, ac vestibulizzle erat nisi sizzle amet purizzle. Maecenizzle its fo rizzle tortizzle vel yippiyo. Mammasay mammasa mamma oo sa lobortizzle. Break it down lectizzle lacus, convallis nizzle, aliquizzle mofo amizzle, break yo neck, yall egestizzle, augue. Vivamizzle pimpin'. Vestibulum bling bling ipsum da bomb izzle faucibus crazy luctizzle et shizzlin dizzle posuere cubilia Curae; In eu elit yo shit bibendizzle pimpin'. Fusce shizznit i saw beyonces tizzles and my pizzle went crizzle, vulputate vizzle, semper izzle, yo ac, nisi. Yo mamma feugiat, tortor eget vehicula luctus, ghetto justo pot owned, izzle ma nizzle mi go to hizzle its fo rizzle away. 11 | 12 | ```python 13 | def funk(): 14 | return "Funk it kribs one more time" 15 | ``` 16 | 17 | - List it baby 18 | - nested 19 | - all right 20 | - not quite 21 | - my style 22 | - my vibe 23 | 24 | > Anyway! Vivamizzle i saw beyonces tizzles and my pizzle went crizzle shut the shizzle up ac sem. 25 | 26 | Vivamizzle i saw beyonces tizzles and my pizzle went crizzle shut the shizzle up ac sem. Pellentesque fo shizzle dizzle sheezy ligula dapibizzle interdum. Etiam shizzle my nizzle crocodizzle pharetra dui. Aliquizzle bizzle feugizzle . Shut the shizzle up erat volutpat. In sizzle its fo rizzle stuff. Pellentesque its fo rizzle gizzle izzle nunc. Pimpin' a mauris. Ghetto lorem things, molestie shizzlin dizzle, mollis uhuh ... yih!, molestie dope, crunk. Nulla izzle felis fo shizzle cool egestizzle consequizzle. Integizzle break it down erizzle. Bizzle interdizzle. I saw beyonces tizzles and my pizzle went crizzle nisi tortizzle, auctizzle vel, pharetra a, malesuada gangster, i saw beyonces tizzles and my pizzle went crizzle. That's the shizzle dapibus pimpin' mi. Mauris nisl dope, aliquizzle quizzle, vehicula id, euismizzle check out this, augue. Nullam leo. Morbi boom shackalack pimpin' izzle erat semper nizzle. Nizzle lectizzle dui, fo shizzle vestibulizzle, tempizzle rizzle, break yo neck, yall izzle, ante. 27 | -------------------------------------------------------------------------------- /lib/docs.js: -------------------------------------------------------------------------------- 1 | import fs from 'fs-extra'; 2 | import path from 'path'; 3 | 4 | import matter from 'gray-matter'; 5 | import remark, { data } from 'remark'; 6 | import html from 'remark-html'; 7 | 8 | // Wrapper to flatten and return nested path list as flat array expected by next 9 | export async function getPathList(folder, ogPath, pageFileCache) { 10 | let nestedPaths = await getNestedPathList(folder, ogPath, pageFileCache); 11 | return flatten(nestedPaths).filter((x) => !!x); 12 | } 13 | 14 | // Recursivly scan the documentation folder. This includes any extra resolution magic 15 | // such as index.md acting as the folder index 16 | export async function getNestedPathList(folder, ogPath, pageFileCache) { 17 | return ( 18 | await Promise.all( 19 | (await fs.readdir(folder)).map(async (file) => { 20 | const joined = path.join(folder, file); 21 | 22 | // Call recursively if a directory 23 | if ((await fs.stat(joined)).isDirectory()) { 24 | return getNestedPathList(joined, ogPath, pageFileCache); 25 | } 26 | 27 | // If a content markdown is found 28 | if (joined.endsWith('.md')) { 29 | let alteredPath = joined 30 | .slice(folder.length + 1) 31 | .replace(/\.md$/, '') 32 | .replace(/\index$/, ''); 33 | 34 | // In recursive depths, add folder name and trim any stray '/' 35 | if (folder !== ogPath) { 36 | alteredPath = folder.replace(ogPath, '') + '/' + alteredPath; 37 | } 38 | alteredPath = trimChar(alteredPath, '/'); 39 | 40 | pageFileCache[alteredPath] = joined; 41 | return { 42 | params: { 43 | id: alteredPath.split('/'), 44 | }, 45 | }; 46 | } else { 47 | return null; 48 | } 49 | }) 50 | ) 51 | ).filter((x) => !!x); 52 | } 53 | 54 | export async function getPostData(id, fullPath) { 55 | const fileContents = fs.readFileSync(fullPath, 'utf8'); 56 | 57 | // Use gray-matter to parse the post metadata section 58 | const matterResult = matter(fileContents); 59 | 60 | // Use remark to convert markdown into HTML string 61 | const processedContent = await remark() 62 | .use(html) 63 | .process(matterResult.content); 64 | const contentHtml = processedContent.toString(); 65 | 66 | // Combine the data with the id and contentHtml 67 | return { 68 | id, 69 | contentHtml, 70 | ...matterResult.data, 71 | }; 72 | } 73 | 74 | export async function getSortedFlatData(folder) { 75 | let fullFolderPath = path.join(process.cwd(), '/' + folder); 76 | // Get file names under /posts 77 | const pageFileCache = {}; 78 | const paths = await getPathList( 79 | fullFolderPath, 80 | fullFolderPath, 81 | pageFileCache 82 | ); 83 | 84 | const allPostsData = paths 85 | .map((p) => p.params.id.join('/')) 86 | .map((fileName) => { 87 | const id = fileName; 88 | 89 | // Read markdown file as string 90 | const fullPath = pageFileCache[id]; 91 | const fileContents = fs.readFileSync(fullPath, 'utf8'); 92 | 93 | // Use gray-matter to parse the post metadata section 94 | const matterResult = matter(fileContents); 95 | 96 | // Combine the data with the id 97 | return { 98 | id, 99 | ...matterResult.data, 100 | }; 101 | }); 102 | // Sort posts by date 103 | return allPostsData.sort((a, b) => { 104 | if (a.id > b.id) { 105 | return 1; 106 | } else { 107 | return -1; 108 | } 109 | }); 110 | } 111 | 112 | // helper function useful to quickly print the nested paths while debugging 113 | function printPaths(paths, space = '') { 114 | for (let path of paths) { 115 | if (!Array.isArray(path)) { 116 | console.log(space, path.params.id); 117 | } else { 118 | printPaths(path, space + ' '); 119 | } 120 | } 121 | } 122 | 123 | // Generate nested data from nested paths and pageFileCache 124 | // Input paths, pageFileCache generated by getNestedPathList() 125 | function nestData(paths, pageFileCache, start = ['']) { 126 | // output = { 127 | // type: 'folder', 128 | // id: '', 129 | // path: 'fullpath', 130 | // matter: {frontmatter YAML} 131 | // files: [ 132 | // { 133 | // type: 'file', 134 | // path: 'fullpath' 135 | // id: 'slug/id' 136 | // matter: ... 137 | // }, 138 | // { 139 | // type: 'file', 140 | // ... 141 | // }, 142 | // { 143 | // type: 'folder', 144 | // ... 145 | // files: [ 146 | // ... 147 | // ], 148 | // }, 149 | // ] 150 | // } 151 | let files = []; 152 | let startPath = pageFileCache[start.join('/')]; 153 | 154 | // Remove the element start by compairing ID array 155 | paths = paths.filter((p) => { 156 | return ( 157 | Array.isArray(p) || 158 | !( 159 | p.params.id.length === start.length && 160 | p.params.id.every((value, index) => value === start[index]) 161 | ) 162 | ); 163 | }); 164 | 165 | for (let path of paths) { 166 | if (!Array.isArray(path)) { 167 | let id = path.params.id.join('/'); 168 | let fullPath = pageFileCache[id]; 169 | 170 | // Use gray-matter to parse the post metadata section 171 | const fileContents = fs.readFileSync(fullPath, 'utf8'); 172 | const matterResult = matter(fileContents); 173 | 174 | files.push({ 175 | type: 'file', 176 | id: id, 177 | path: pageFileCache[id], 178 | matter: matterResult.data, 179 | }); 180 | } else { 181 | // New start will have smallest id length 182 | let newStart = path.reduce((str, p) => { 183 | if (!Array.isArray(p)) { 184 | if (Array.isArray(str)) { 185 | return p; 186 | } 187 | return str.params.id.length < p.params.id.length ? str : p; 188 | } 189 | return str; 190 | }).params.id; 191 | 192 | files.push(nestData(path, pageFileCache, newStart)); 193 | } 194 | } 195 | 196 | // Use gray-matter to parse the post metadata section 197 | const fileContents = fs.readFileSync(startPath, 'utf8'); 198 | const matterResult = matter(fileContents); 199 | 200 | return { 201 | type: 'folder', 202 | id: start.join('/'), 203 | path: startPath, 204 | matter: matterResult.data, 205 | files: files, 206 | }; 207 | } 208 | 209 | export async function getFolderNestedData(folder) { 210 | let fullFolderPath = path.join(process.cwd(), '/' + folder); 211 | 212 | const pageFileCache = {}; 213 | const paths = await getNestedPathList( 214 | fullFolderPath, 215 | fullFolderPath, 216 | pageFileCache 217 | ); 218 | 219 | return nestData(paths, { ...pageFileCache }); 220 | } 221 | 222 | // Escape special characters for use in a regular expression 223 | var escapeRegExp = function (strToEscape) { 224 | return strToEscape.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&'); 225 | }; 226 | 227 | // Trim Characters at the start and the end 228 | var trimChar = function (origString, charToTrim) { 229 | charToTrim = escapeRegExp(charToTrim); 230 | var regEx = new RegExp('^[' + charToTrim + ']+|[' + charToTrim + ']+$', 'g'); 231 | return origString.replace(regEx, ''); 232 | }; 233 | 234 | // Flattens nested arrays 235 | function flatten(items) { 236 | const flat = []; 237 | 238 | items.forEach((item) => { 239 | if (Array.isArray(item)) { 240 | flat.push(...flatten(item)); 241 | } else { 242 | flat.push(item); 243 | } 244 | }); 245 | 246 | return flat; 247 | } 248 | -------------------------------------------------------------------------------- /lib/posts.js: -------------------------------------------------------------------------------- 1 | import fs from 'fs'; 2 | import path from 'path'; 3 | import matter from 'gray-matter'; 4 | import remark from 'remark'; 5 | import html from 'remark-html'; 6 | 7 | const postsDirectory = path.join(process.cwd(), 'posts'); 8 | 9 | export function getSortedPostsData() { 10 | // Get file names under /posts 11 | const fileNames = fs.readdirSync(postsDirectory); 12 | const allPostsData = fileNames.map((fileName) => { 13 | // Remove ".md" from file name to get id 14 | const id = fileName.replace(/\.md$/, ''); 15 | 16 | // Read markdown file as string 17 | const fullPath = path.join(postsDirectory, fileName); 18 | const fileContents = fs.readFileSync(fullPath, 'utf8'); 19 | 20 | // Use gray-matter to parse the post metadata section 21 | const matterResult = matter(fileContents); 22 | 23 | // Combine the data with the id 24 | return { 25 | id, 26 | ...matterResult.data, 27 | }; 28 | }); 29 | // Sort posts by date 30 | return allPostsData.sort((a, b) => { 31 | if (a.date < b.date) { 32 | return 1; 33 | } else { 34 | return -1; 35 | } 36 | }); 37 | } 38 | 39 | export function getAllPostIds() { 40 | const fileNames = fs.readdirSync(postsDirectory); 41 | 42 | // Returns an array that looks like this: 43 | // [ 44 | // { 45 | // params: { 46 | // id: 'ssg-ssr' 47 | // } 48 | // }, 49 | // { 50 | // params: { 51 | // id: 'pre-rendering' 52 | // } 53 | // } 54 | // ] 55 | return fileNames.map((fileName) => { 56 | return { 57 | params: { 58 | id: fileName.replace(/\.md$/, ''), 59 | }, 60 | }; 61 | }); 62 | } 63 | 64 | export async function getPostData(id) { 65 | const fullPath = path.join(postsDirectory, `${id}.md`); 66 | const fileContents = fs.readFileSync(fullPath, 'utf8'); 67 | 68 | // Use gray-matter to parse the post metadata section 69 | const matterResult = matter(fileContents); 70 | 71 | // Use remark to convert markdown into HTML string 72 | const processedContent = await remark() 73 | .use(html) 74 | .process(matterResult.content); 75 | const contentHtml = processedContent.toString(); 76 | 77 | // Combine the data with the id and contentHtml 78 | return { 79 | id, 80 | contentHtml, 81 | ...matterResult.data, 82 | }; 83 | } 84 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "learn-starter", 3 | "version": "0.1.0", 4 | "private": true, 5 | "scripts": { 6 | "dev": "next dev", 7 | "build": "next build", 8 | "start": "next start" 9 | }, 10 | "dependencies": { 11 | "date-fns": "^2.16.1", 12 | "fs-extra": "^9.0.1", 13 | "gray-matter": "^4.0.2", 14 | "next": "^10.0.0", 15 | "react": "16.13.1", 16 | "react-dom": "16.13.1", 17 | "remark": "^13.0.0", 18 | "remark-html": "^13.0.1", 19 | "sass": "^1.30.0" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /pages/_app.js: -------------------------------------------------------------------------------- 1 | import '../styles/global.css'; 2 | 3 | export default function App({ Component, pageProps }) { 4 | return ; 5 | } 6 | -------------------------------------------------------------------------------- /pages/docs/[[...id]].js: -------------------------------------------------------------------------------- 1 | import path from 'path'; 2 | import { getPathList, getPostData } from '../../lib/docs'; 3 | import Head from 'next/head'; 4 | import Layout from '../../components/layout'; 5 | import utilStyles from '../../styles/utils.module.css'; 6 | import Date from '../../components/date'; 7 | 8 | // File path for docs root 9 | const DOCS_ROOT = path.join(process.cwd(), '/docs'); 10 | 11 | export default function Docs({ postData }) { 12 | // const content = hydrate(source, { components }); 13 | 14 | return ( 15 | 16 | {/* Add this tag */} 17 | 18 | {postData.title} 19 | 20 |
21 |

{postData.title}

22 | {postData.date && ( 23 |
24 | 25 |
26 | )} 27 |
28 |
29 |
30 | ); 31 | } 32 | 33 | // Define a cache that will map the slug to the actual path. 34 | // This is used to work around the index.mdx issue that I'm having 35 | const pageFileCache = {}; 36 | 37 | export const getStaticProps = async ({ params }) => { 38 | // Retrieve full path from a cache. Generate cache if it doesnt exist. 39 | // id is undefined at index '/', set slugpath as '' instead 40 | let slugPath; 41 | if (params.id) { 42 | slugPath = params.id.join('/'); 43 | } else { 44 | slugPath = ''; 45 | } 46 | if (!pageFileCache[slugPath]) { 47 | await getStaticPaths({}); 48 | } 49 | const markdownFile = pageFileCache[slugPath]; 50 | 51 | // Get postdata for the slug and markdown file 52 | const postData = await getPostData(slugPath, markdownFile); 53 | 54 | return { 55 | props: { 56 | postData, 57 | }, 58 | }; 59 | }; 60 | 61 | // Get static paths being a wrapper around the getPathList 62 | export const getStaticPaths = async () => { 63 | let paths = await getPathList(DOCS_ROOT, DOCS_ROOT, pageFileCache); 64 | 65 | return { 66 | paths, 67 | fallback: false, 68 | }; 69 | }; 70 | -------------------------------------------------------------------------------- /pages/index.js: -------------------------------------------------------------------------------- 1 | import Head from 'next/head'; 2 | import Layout, { siteTitle } from '../components/layout'; 3 | 4 | import utilStyles from '../styles/utils.module.css'; 5 | import { getSortedPostsData } from '../lib/posts'; 6 | 7 | import { getFolderNestedData, getSortedFlatData } from '../lib/docs'; 8 | import Link from 'next/link'; 9 | import Date from '../components/date'; 10 | import NestedList from '../components/nestedList'; 11 | 12 | export async function getStaticProps() { 13 | const allPostsData = getSortedPostsData(); 14 | const allDocsNestedData = await getFolderNestedData('docs'); 15 | const allDocsFlatData = await getSortedFlatData('docs'); 16 | 17 | return { 18 | props: { 19 | allPostsData, 20 | allDocsNestedData, 21 | allDocsFlatData, 22 | }, 23 | }; 24 | } 25 | 26 | export default function Home({ 27 | allPostsData, 28 | allDocsNestedData, 29 | allDocsFlatData, 30 | }) { 31 | return ( 32 | 33 | 34 | {siteTitle} 35 | 36 |
37 |

NextJS Nested demo

38 |

39 | This is a sample website to demonstrate nested markdown structure 40 | rendered in next.js. 41 |

42 |

43 | The code for the website can be found at:{' '} 44 | 49 | @xypnox/next-nested 50 | 51 |

52 |
53 |
54 |

Blog

55 |

The blog is the basic flat normal structure.

56 |
    57 | {allPostsData.map(({ id, date, title }) => ( 58 |
  • 59 | 60 | {title} 61 | 62 |
    63 | 64 | 65 | 66 |
  • 67 | ))} 68 |
69 |
70 |
71 |

Docs

72 |

73 | The Docs are generated in nested manner and have urls in same pattern 74 | as file structure. 75 |

76 | 77 | 78 |
79 | 80 |
81 |

Docs - Flat

82 |

83 | The Docs can also be displayed in a flattened manner as well but have 84 | urls in same pattern as file structure. (These have not been sorted by 85 | date) 86 |

87 | 88 |
    89 | {allDocsFlatData.map(({ id, date, title }) => ( 90 |
  • 91 | 92 | {title} 93 | 94 |
    95 | 96 | {date && ( 97 | 98 | 99 | 100 | )} 101 |
  • 102 | ))} 103 |
104 |
105 |
106 | ); 107 | } 108 | -------------------------------------------------------------------------------- /pages/posts/[id].js: -------------------------------------------------------------------------------- 1 | import Head from 'next/head'; 2 | import Layout from '../../components/layout'; 3 | import { getAllPostIds, getPostData } from '../../lib/posts'; 4 | import utilStyles from '../../styles/utils.module.css'; 5 | import Date from '../../components/date'; 6 | 7 | export async function getStaticPaths() { 8 | const paths = getAllPostIds(); 9 | return { 10 | paths, 11 | fallback: false, 12 | }; 13 | } 14 | 15 | export async function getStaticProps({ params }) { 16 | const postData = await getPostData(params.id); 17 | return { 18 | props: { 19 | postData, 20 | }, 21 | }; 22 | } 23 | 24 | export default function Post({ postData }) { 25 | return ( 26 | 27 | {/* Add this tag */} 28 | 29 | {postData.title} 30 | 31 |
32 |

{postData.title}

33 |
34 | 35 |
36 |
37 |
38 |
39 | ); 40 | } 41 | -------------------------------------------------------------------------------- /posts/pre-rendering.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 'Two Forms of Pre-rendering' 3 | date: '2020-01-01' 4 | --- 5 | 6 | Next.js has two forms of pre-rendering: **Static Generation** and **Server-side Rendering**. The difference is in **when** it generates the HTML for a page. 7 | 8 | - **Static Generation** is the pre-rendering method that generates the HTML at **build time**. The pre-rendered HTML is then _reused_ on each request. 9 | - **Server-side Rendering** is the pre-rendering method that generates the HTML on **each request**. 10 | 11 | Importantly, Next.js lets you **choose** which pre-rendering form to use for each page. You can create a "hybrid" Next.js app by using Static Generation for most pages and using Server-side Rendering for others. 12 | -------------------------------------------------------------------------------- /posts/ssg-ssr.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 'When to Use Static Generation v.s. Server-side Rendering' 3 | date: '2020-01-02' 4 | --- 5 | 6 | We recommend using **Static Generation** (with and without data) whenever possible because your page can be built once and served by CDN, which makes it much faster than having a server render the page on every request. 7 | 8 | You can use Static Generation for many types of pages, including: 9 | 10 | - Marketing pages 11 | - Blog posts 12 | - E-commerce product listings 13 | - Help and documentation 14 | 15 | You should ask yourself: "Can I pre-render this page **ahead** of a user's request?" If the answer is yes, then you should choose Static Generation. 16 | 17 | On the other hand, Static Generation is **not** a good idea if you cannot pre-render a page ahead of a user's request. Maybe your page shows frequently updated data, and the page content changes on every request. 18 | 19 | In that case, you can use **Server-Side Rendering**. It will be slower, but the pre-rendered page will always be up-to-date. Or you can skip pre-rendering and use client-side JavaScript to populate data. 20 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xypnox/next-nested/a283f43bc620d7628e27ec8ce4b54f955f2d9047/public/favicon.ico -------------------------------------------------------------------------------- /public/images/profile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xypnox/next-nested/a283f43bc620d7628e27ec8ce4b54f955f2d9047/public/images/profile.png -------------------------------------------------------------------------------- /styles/global.css: -------------------------------------------------------------------------------- 1 | html, 2 | body { 3 | padding: 0; 4 | margin: 0; 5 | font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, 6 | Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif; 7 | line-height: 1.6; 8 | font-size: 18px; 9 | } 10 | 11 | * { 12 | box-sizing: border-box; 13 | } 14 | 15 | a { 16 | color: #0070f3; 17 | text-decoration: none; 18 | } 19 | 20 | a:hover { 21 | text-decoration: underline; 22 | } 23 | 24 | img { 25 | max-width: 100%; 26 | display: block; 27 | } 28 | -------------------------------------------------------------------------------- /styles/utils.module.css: -------------------------------------------------------------------------------- 1 | .heading2Xl { 2 | font-size: 2.5rem; 3 | line-height: 1.2; 4 | font-weight: 800; 5 | letter-spacing: -0.05rem; 6 | margin: 1rem 0; 7 | } 8 | 9 | .headingXl { 10 | font-size: 2rem; 11 | line-height: 1.3; 12 | font-weight: 800; 13 | letter-spacing: -0.05rem; 14 | margin: 1rem 0; 15 | } 16 | 17 | .headingLg { 18 | font-size: 1.5rem; 19 | line-height: 1.4; 20 | margin: 1rem 0; 21 | } 22 | 23 | .headingMd { 24 | font-size: 1.2rem; 25 | line-height: 1.5; 26 | } 27 | 28 | .borderCircle { 29 | border-radius: 9999px; 30 | } 31 | 32 | .colorInherit { 33 | color: inherit; 34 | } 35 | 36 | .padding1px { 37 | padding-top: 1px; 38 | } 39 | 40 | .list { 41 | list-style: none; 42 | padding: 0; 43 | margin: 0; 44 | } 45 | 46 | .listItem { 47 | margin: 0 0 1.25rem; 48 | } 49 | 50 | .lightText { 51 | color: #999; 52 | } 53 | --------------------------------------------------------------------------------