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
  • - ๐Ÿ’ธ order + ๐ŸŽค๐Ÿ”ง OlaCast: skill- builders ๐Ÿ”ง ๐Ÿ”ง๐ŸŽค
  • diff --git a/src/pages/bake-podcasts-song.js b/src/pages/bake-podcasts-song.js new file mode 100644 index 0000000..e77cb41 --- /dev/null +++ b/src/pages/bake-podcasts-song.js @@ -0,0 +1,41 @@ +// pages / pizzaTags.js +import { graphql } from "gatsby"; +import { GatsbyImage } from "gatsby-plugin-image"; +import React from "react"; + +import TagList from "../components/TagList"; +// import ToppingsFilter from "../components/ToppingsFilter"; +// +// +export default function bakePodcastsSong({ data, pageContext }) { +// console.log(data) +// const bakingTreasure = data.supplies.nodes; + return ( + <> +
    + +

    + {data.pirates.name} +

    +

    {data.pirates.description}

    + + +
    + + ); +} + +export const query = graphql` + query ($catsby: String!) { + pirates: sanityPerson(slug: {current: {eq: $catsby}}) { + name + id + description + image { + asset { + gatsbyImageData(width: 800, placeholder: BLURRED, formats: AUTO) + } + } + } + } +`; \ No newline at end of file diff --git a/src/pages/pizzaTags.js b/src/pages/pizzaTags.js deleted file mode 100644 index 94ceb53..0000000 --- a/src/pages/pizzaTags.js +++ /dev/null @@ -1,39 +0,0 @@ -// pages / pizzaTags.js -import { graphql } from "gatsby"; -import React from "react"; - -import TagList from "../components/TagList"; -// import ToppingsFilter from "../components/ToppingsFilter"; -// -// -export default function PizzaTagsPage({ data, pageContext }) { -// console.log(data) -// const bakingTreasure = data.supplies.nodes; - return ( - <> -
    - - -

    tags

    -
    - - ); -} - -export const query = graphql` - query TagQuery($catsby: [String]) { - supplies: allMarkdownRemark( - filter: { - frontmatter: { - tags: { - in: $catsby}}}) { - nodes { - id - toppings: frontmatter { - tags - title - } - } - } - } -`; \ No newline at end of file diff --git a/src/templates/bake-podcast-song.js b/src/templates/bake-podcast-song.js new file mode 100644 index 0000000..9ef2441 --- /dev/null +++ b/src/templates/bake-podcast-song.js @@ -0,0 +1,45 @@ +import { graphql } from "gatsby"; +import React from "react"; + +import styled from "styled-components"; + +const PizzaGrid = styled.div` + display: grid; + grid-gap: 2rem; + grid-template-columns: repeat(auto-fill, minmax(400px, 1fr)); + +`; + + + +export default function SinglePizzaPage({data}) { + + return ( + <> +
    + +
    + + +
    + + ) +}; + + +export const query = graphql` + query MarkdownQuery($catsbySlug: String!) { + supplies: markdownRemark( + frontmatter: { + path: { + eq: $catsbySlug + } + } + ) { + frontmatter { + title + } + html + } + } +`; \ No newline at end of file