├── .gitignore ├── utils └── prismic-client.js ├── package.json ├── _data └── glossary.js ├── index.md ├── netlify.toml ├── _includes └── default.njk └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | _site 3 | 4 | # Local Netlify folder 5 | .netlify -------------------------------------------------------------------------------- /utils/prismic-client.js: -------------------------------------------------------------------------------- 1 | const Prismic = require('@prismicio/client'); 2 | 3 | const options = { 4 | // accessToken: 5 | }; 6 | 7 | exports.client = Prismic.client('http://drasnerd.prismic.io/api', options); 8 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "drasnerd.com", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "build": "eleventy", 8 | "dev": "eleventy --serve" 9 | }, 10 | "keywords": [], 11 | "author": "", 12 | "license": "ISC", 13 | "dependencies": { 14 | "@prismicio/client": "^4.0.0", 15 | "bulma": "^0.9.2" 16 | }, 17 | "devDependencies": { 18 | "@11ty/eleventy": "^0.12.1" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /_data/glossary.js: -------------------------------------------------------------------------------- 1 | // const { client } = require('../utils/prismic-client'); 2 | 3 | const { client } = require('../utils/prismic-client'); 4 | 5 | module.exports = async () => { 6 | const result = await client.query(''); 7 | 8 | // hard-code getting the page 9 | const page = result.results[0]; 10 | const data = page.data.page; 11 | const title = data.title.value[0].text; 12 | 13 | const terms = data.body.value 14 | .filter((entry) => { 15 | return entry.slice_type === 'glossary_term'; 16 | }) 17 | .map((slice) => { 18 | const fields = slice['non-repeat']; 19 | return { 20 | term: fields.term.value[0].text, 21 | definition: fields.definition.value[0].text, 22 | }; 23 | }); 24 | 25 | return { 26 | title, 27 | terms, 28 | }; 29 | }; 30 | -------------------------------------------------------------------------------- /index.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default.njk 3 | title: Drasnerd 4 | --- 5 | 6 | 23 | 24 |

{{ glossary.title }}

25 | 26 |
27 | {% for term in glossary.terms %} 28 | 29 |
30 |
31 |

{{ term.term }}

32 |
33 |

{{term.definition}}

34 |
35 |
36 |
37 | 38 | {% endfor %} 39 |
40 | -------------------------------------------------------------------------------- /netlify.toml: -------------------------------------------------------------------------------- 1 | # example netlify.toml 2 | [build] 3 | command = "npm run build" 4 | functions = "netlify/functions" 5 | publish = "_site" 6 | 7 | ## Uncomment to use this redirect for Single Page Applications like create-react-app. 8 | ## Not needed for static site generators. 9 | #[[redirects]] 10 | # from = "/*" 11 | # to = "/index.html" 12 | # status = 200 13 | 14 | ## (optional) Settings for Netlify Dev 15 | ## https://github.com/netlify/cli/blob/master/docs/netlify-dev.md#project-detection 16 | #[dev] 17 | # command = "yarn start" # Command to start your dev server 18 | # port = 3000 # Port that the dev server will be listening on 19 | # publish = "dist" # Folder with the static content for _redirect file 20 | 21 | ## more info on configuring this file: https://www.netlify.com/docs/netlify-toml-reference/ 22 | -------------------------------------------------------------------------------- /_includes/default.njk: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | {{ title }} 8 | 9 | 35 | 36 | 37 |
38 | {{ content | safe }} 39 |
40 | 41 | 42 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 | 3 | Learn With Jason 4 | 5 |

6 |

7 | Troll Your Boss With The Jamstack (with Cassidy Williams) 8 |

9 |

10 | This app was built live on Learn With Jason and it was super fun and I’m sad you weren’t there. 11 |

12 |

13 | But don’t worry! You can still: 14 | watch the video · 15 | see the demo · 16 | deploy this project · 17 | see upcoming episodes 18 |

19 | 20 |   21 | 22 | How fast can two cyberspace hooligans build an app to troll their boss? Tune in and find out as Cassidy Williams and Jason Lengstorf drag Sarah Drasner in app form! 23 | 24 |   25 | 26 | ## More Information 27 | 28 | - [Watch this app get built live + see links and additional resources][episode] 29 | - [Follow _Learn With Jason_ on Twitch][twitch] to watch future episodes live 30 | - [Add the _Learn With Jason_ schedule to your Google Calendar][cal] 31 | 32 |   33 |

34 | 35 | Deploy this project to Netlify 36 | 37 |

38 | 39 | [episode]: https://www.learnwithjason.dev/troll-your-boss-with-the-jamstack 40 | [twitch]: https://jason.af/twitch 41 | [cal]: https://jason.af/lwj/cal --------------------------------------------------------------------------------