Skip to content

Instantly share code, notes, and snippets.

View danilowoz's full-sized avatar

Danilo Woznica danilowoz

View GitHub Profile
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// choose either `'stable'` for receiving highly polished,
// or `'canary'` for less polished but more frequent updates
updateChannel: "stable",
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// choose either `'stable'` for receiving highly polished,
// or `'canary'` for less polished but more frequent updates
updateChannel: "stable",
Schrödinger’s commit. 50% chance we fixed the bug
i tried my best
Please don't tell anyone I did this
Check the changes for yourself
Works on my machine
import * as React from 'react'
interface IState {
offSet: number
}
interface IProp {
force?: number
offsetComp?: number
children(offSet: number): React.ReactNode
.container {
display: flex;
flex-flow: column wrap;
align-content: space-between;
/* Your container needs a fixed height, and it
* needs to be taller than your tallest column. */
height: 600px;
}
.item {
@danilowoz
danilowoz / 1-gatsby-node.js
Last active April 28, 2019 19:10
Creating the pages programmatically
const { createFilePath } = require(`gatsby-source-filesystem`)
exports.onCreateNode = ({ node, actions, getNode }) => {
const { createNodeField } = actions
if (node.internal.type === `MarkdownRemark`) {
const value = createFilePath({ node, getNode })
const [month, day, year] = new Date(node.frontmatter.date)
.toLocaleDateString("en-EN", {
year: "numeric",
@danilowoz
danilowoz / 1.1-gatsby-node.js
Created April 28, 2019 19:12
Creating the pages programmatically
const path = require(`path`)
// 1. This is called once the data layer is bootstrapped to let plugins create pages from data.
exports.createPages = ({ graphql, actions }) => {
// 1.1 Getting the method to create pages
const { createPage } = actions
// 1.2 Tell which layout Gatsby should use to thse pages
const blogLayout = path.resolve(`./src/layouts/blog-post.js`)
// 2 Return the method with the query
@danilowoz
danilowoz / 2-blog-post.js
Created April 28, 2019 19:13
Creating programmatically the pages
import React from "react"
import { graphql } from "gatsby"
const BlogPost = ({ data }) => {
const { markdownRemark } = data
const imageSource = markdownRemark.frontmatter.image.childImageSharp.fluid.src
return (
<>
<img src={imageSource} alt={markdownRemark.frontmatter.title} />
@danilowoz
danilowoz / 2-gatsby-node.js
Last active April 28, 2019 19:19
Creating a blog post list page
const blogListLayout = path.resolve(`./src/layouts/blog-list.js`)