diff --git a/content/skill-building/1-/1-.md b/content/skill-building/1-/1-.md index 393af08..809be40 100644 --- a/content/skill-building/1-/1-.md +++ b/content/skill-building/1-/1-.md @@ -1,12 +1,15 @@ --- -title: 1.-2.-3. Baking pages with Cap'n Granny Sharksby's createPages hooks -url: https://www.conferencebuddy.io/ -date: 2022-07-10 -city: Frankfurt -country: Germany +title: 1. Baking pages from tags with Cap'n Granny Sharksby's createPages hooks +url: https://www.olavea.com/olacast/ +date: 2022-01-02 +city: Oslo +country: Norway tags: ["animals", "Chicago", "zoos", "royal_icing"] description: Lorem Ipsum some conference text that is a lot longer than the other one so we can see how it looks. -path: /1-2-3-createPages-from-markdown-files +path: 1-2-3-createPages-from-markdown-files --- +# 1. Baking pages from tags with Cap'n Granny Sharksby's createPages hooks +## bleh bleh bleh +"bleh bleh bleh."Says ๐งโโ๏ธ ๐ดโโ ๏ธ \ No newline at end of file diff --git a/content/skill-building/2-/2-.md b/content/skill-building/2-/2-.md new file mode 100644 index 0000000..a17c29d --- /dev/null +++ b/content/skill-building/2-/2-.md @@ -0,0 +1,14 @@ +--- +title: 2. bleh bleh bleh +url: https://www.olavea.com/olacast/ +date: 2022-01-09 +city: Oslo +country: Norway +tags: ["animals", "Chicago", "zoos", "royal_icing"] + + +description: Lorem Ipsum some conference text that is a lot longer than the other one so we can see how it looks. +path: 2-createPages-from-markdown-files +--- +# bleh bleh bleh +"bleh bleh bleh."Says ๐งโโ๏ธ ๐ดโโ ๏ธ \ No newline at end of file diff --git a/content/skill-building/A-createPages-from-markdown-files/A-createPages-from-markdown-files-.md b/content/skill-building/A-createPages-from-markdown-files/A-createPages-from-markdown-files-.md index 2b8df31..e9c58dd 100644 --- a/content/skill-building/A-createPages-from-markdown-files/A-createPages-from-markdown-files-.md +++ b/content/skill-building/A-createPages-from-markdown-files/A-createPages-from-markdown-files-.md @@ -1,7 +1,7 @@ --- title: A. ยซAhoy! Cookie?!ยป Cap'n Fox shouts and embarks. ๐ฆ -url: https://www.conferencebuddy.io/ +url: https://www.olavea.com/olacast/ date: 2022-06-10 city: Frankfurt country: Germany @@ -13,7 +13,8 @@ path: /A-createPages-from-markdown-files --- # bleh bleh bleh -bleh bleh bleh +"bleh bleh bleh."Says ๐งโโ๏ธ ๐ดโโ ๏ธ + I added my first blog post in markdown, this one. diff --git a/content/skill-building/E-createPages-from-markdown-files copy/E-createPages-from-markdown-files-.md b/content/skill-building/E-createPages-from-markdown-files copy/E-createPages-from-markdown-files-.md index 2158380..a101faf 100644 --- a/content/skill-building/E-createPages-from-markdown-files copy/E-createPages-from-markdown-files-.md +++ b/content/skill-building/E-createPages-from-markdown-files copy/E-createPages-from-markdown-files-.md @@ -1,7 +1,7 @@ --- title: E. ยซAhoy! Cookie?!ยป Cap'n Fox shouts and embarks. ๐ฆ -url: https://www.conferencebuddy.io/ +url: https://www.olavea.com/olacast/ date: 2022-04-10 city: Frankfurt country: Germany @@ -11,7 +11,8 @@ tags: ["animals", "Chicago", "zoos", "royal_icing"] description: Lorem Ipsum some conference text that is a lot longer than the other one so we can see how it looks. path: /E-createPages-from-markdown-files --- - +# bleh bleh bleh +"bleh bleh bleh."Says ๐งโโ๏ธ ๐ดโโ ๏ธ I added my first blog post in markdown, this one. diff --git a/gatsby-config.js b/gatsby-config.js index afc7591..1b00db6 100755 --- a/gatsby-config.js +++ b/gatsby-config.js @@ -6,6 +6,7 @@ require('dotenv').config({ module.exports = { siteMetadata: { siteUrl: "https://timeship1.gatsbyjs.io/", + url: "https://www.olavea.com/", title: `TimeShip1`, description: "Lillian and Friends Building Skill", }, @@ -18,24 +19,18 @@ module.exports = { // or gatsby-transformer-sharp in SSR or DSG pages. The best workaround is to use an image CDN such as Cloudinary or imgix to host your images. This will give you faster builds and rendering too. `gatsby-transformer-sharp`, `gatsby-transformer-remark`, + // In your gatsby-config.js // { // resolve: `gatsby-transformer-remark`, // options: { // plugins: [ // { - // resolve: `gatsby-remark-prismjs`, - // }, - // { - // resolve: `gatsby-remark-images`, - // options: { - // maxWidth: 800, - // linkImagesToOriginal: false, - // }, - // }, - // { // resolve: `@raae/gatsby-remark-oembed`, // options: { + // // usePrefix defaults to false + // // usePrefix: true is the same as ["oembed"] + // usePrefix: ["oembed", "video"], // providers: { // // Important to exclude providers // // that adds js to the page. @@ -45,18 +40,40 @@ module.exports = { // "Instagram", // "Twitter", // "Flickr", - // "YouTube", // ], // }, // }, // }, + // ], + // }, + // }, + // { + // resolve: `gatsby-transformer-remark`, + // options: { + // plugins: [ + // { + // resolve: `@raae/gatsby-remark-oembed`, + // options: { + // providers: { + // // Important to exclude providers + // // that adds js to the page. + // // If you do not need them. + // exclude: [ + // "Reddit", + // "Instagram", + // "Twitter", + // "Flickr", + // "YouTube", + // ], + // }, + // }, + // }, // { // resolve: `gatsby-remark-responsive-iframe`, // }, // ], // }, // }, - { resolve: `gatsby-source-filesystem`, options: { @@ -96,7 +113,7 @@ module.exports = { options: { projectId: 'fr5nacyp', dataset: 'production', - watchMode: true, + watchMode: false, token: process.env.SANITY_TOKEN, }, }, diff --git a/gatsby-node.js b/gatsby-node.js index 039e5dd..c5034cd 100644 --- a/gatsby-node.js +++ b/gatsby-node.js @@ -3,6 +3,63 @@ // Baking pages // with Cap'n Granny Sharksby's // createPages hook +async function bakePodcastsIntoPages({ graphql,actions }) { +// console.log('๐ Captain Granny Sharksbys createPages hook ๐'); +// 1. + const bakingSong = require.resolve('./src/templates/bake-podcast-song.js') +// Look for _ _ _ in http://localhost:8000/topping/Duct-Tape ๐ป +// 2. + const { data } = await graphql(`{ + supplies: allMarkdownRemark(sort: { + order: ASC, + fields: frontmatter___title + }) { + nodes { + id + strawberry: frontmatter { + path + title + } + } + } + } + `) +// 3. + data.supplies.nodes.forEach((ahoyGoodie, index) => { +// console.log('Defer index:', index, ahoyGoodie); +// A. โ B. โ C. โ DSG ๐ฉ + actions.createPage({ +// A. ยซAhoy! Goodie?!ยป +// Cap'n Fox shouts and embarks. ๐ฆ + path: `/olacast/${ahoyGoodie.strawberry.path}`, +// B. Owlsby sings badly +// and bakes baby sharks. ๐ฆ + component: bakingSong, +// C. Catsby looks tasty +// Fox gets hungry for kitten. ๐ฏ + context: { + catsbySlug: ahoyGoodie.strawberry.path, + fox: 'Catsby looks tasty I getz hungry for kitten', + }, +// D. Don't Show Goodies to Fox +// and maybe get bitten. DSGโ๐ฉ +// catsby build and look for _ _ _ in terminal ๐ + defer: index + 1 > 2, +// D. Data tree ๐ค๐ฒ +// E. Every node you must sort ๐ฐ +// F. Fields Forever `fields: ,` ๐ +// E. forEach index +// R. RRR! defer: index + 1 > 2 ๐ฉ + +// How does Catsby help Lilly make an index of all the toppings? +// What is the way Lilly makes index travel from +// D. Data tree ๐ค๐ฒ +// R. RRR! defer: index + 1 > 2 ๐ฉ + }) +}); + +} +//3. async function bakeMarkdownIntoGoodies({ graphql, actions }) { // console.log('Captain Granny Sharksbys createPages hook'); ๐ // 1. bakingSong = Lilly the Bunny sings like a ๐ฆข @@ -59,58 +116,68 @@ async function bakeMarkdownIntoGoodies({ graphql, actions }) { }) }); } -// We don't use this yet // Captain Granny Sharksby createPages hook โฉ๏ธ -async function turnTagzIntoPages({ graphql, actions }) { +async function bakePeopleIntoPages({ graphql, actions }) { // console.log('createPages hook from Captain Sharksby โฉ๏ธ ๐'); // 1. bakingSong = Lilly the Bunny require the bakingSong from granny Shark's gingerbread Recipe - const bakingSong = require.resolve('./src/pages/pizzaTags.js') + const bakingSong = require.resolve('./src/pages/bake-podcasts-song.js') // Look for _ _ _ in http://localhost:8000/tag/eminem ๐ป // 2. supplies: tags in markdown files const { data } = await graphql(`{ - postsRemark: allMarkdownRemark( - sort: {order: DESC, fields: frontmatter___date} - limit: 10 - ) { - edges { - node { - frontmatter { - url - tags - } + pirates: allSanityPerson { + totalCount + nodes { + name + id + slug { + current } } } - tagsGroup: allMarkdownRemark(limit: 20) { - group(field: frontmatter___tags) { - totalCount - fieldValue - } - } }`) // 3. turn toppings into pages with // createPage method from Captain Sharksby - data.tagsGroup.group.forEach((ahoyGoodie, index) => { + data.pirates.nodes.forEach((ahoyGoodie) => { // console.log('Defer index:', ahoyGoodie); actions.createPage({ // A. ยซAhoy! Cookie?!ยป // Cap'n Fox shouts and embarks. ๐ฆ - path: `/tag/${ahoyGoodie.fieldValue}`, + path: `/pirate/${ahoyGoodie.slug.current}`, // B. Bunny sings badly // and bakes baby sharks. ๐ฐ component: bakingSong, // C. Catsby looks tasty // Fox gets hungry for kitten. ๐ฏ -// context: { -// catsby: ahoyGoodie.toppings.tags , -// //toppingRegex: `/${ahoyCookie}/`, -// // TODO Regex for Topping -// // toppingRegex: `/${ahoyCookie.frontmatter.tags}/i`, -// }, - defer: index + 1 > 2 + context: { + catsby: ahoyGoodie.slug.current, + //name: `/${ahoyCookie}/`, +// TODO Regex for Topping +// toppingRegex: `/${ahoyCookie.frontmatter.tags}/i`, + }, +// defer: index + 1 > 2, + ownerNodeId: ahoyGoodie.id, }) - }); -// 5. Pass tag data to pizzaTags.js + }); +// // 3. Figure out how many pages there are based on how many slicemasters there are, and how many per page! +// const pageSize = parseInt(process.env.GATSBY_PAGE_SIZE); +// const pageCount = Math.ceil(data.slicemasters.totalCount / pageSize); +// console.log( +// `There are ${data.slicemasters.totalCount} total people. And we have ${pageCount} pages with ${pageSize} per page` +// ); +// // 4. Loop from 1 to n and create the pages for them +// Array.from({ length: pageCount }).forEach((_, i) => { +// console.log(`Creating page ${i}`); +// actions.createPage({ +// path: `/slicemasters/${i + 1}`, +// component: path.resolve('./src/pages/slicemasters.js'), +// // This data is pass to the template when we create it +// context: { +// skip: i * pageSize, +// currentPage: i + 1, +// pageSize, +// }, +// }); +// }); } // Troya Catsby and Lilly Owlsby Baking pages // with Cap'n Granny Sharksby's @@ -312,8 +379,9 @@ exports.createPages = async (params) => { // wait for all promises to be resolved before finishing this function await Promise.all([ bakeMarkdownIntoGoodies(params), - turnTagzIntoPages(params), + bakePodcastsIntoPages(params), + bakePeopleIntoPages(params), turnToolsIntoPages(params), bakingPhotosIntoPages(params), diff --git a/src/components/Nav.js b/src/components/Nav.js index 6ce43fb..48562a0 100644 --- a/src/components/Nav.js +++ b/src/components/Nav.js @@ -68,7 +68,7 @@ export default function Nav() { ๐ & Friends
{data.pirates.description}
+ + +tags
-