Giter Club home page Giter Club logo

gatsby-starter-all-content's Introduction

gatsby-starter-all-content

This is a template for the content page of my website:

Dillion content page

Anyone interested in having something--where all content you've written on different platforms can be stored in one place--you're free to use this template.

Watch this video where I explain how to use the starter or read the text instructions below.

Installation

You can use this starter with these commands:

gatsby new YOUR-WEBSITE https://github.com/dillionmegida/gatsby-starter-all-content

# goto your website directory
cd YOUR-WEBSITE

# start server
gatsby develop

On localhost:8000, you'll find two pages: the blog and content pages. The content page looks similar to this:

Content page template

These are all demo content.

The content page is a compilation of all your content, including the blog posts on your website.

Read the following section to learn how to add your own content.

Usage

All content live in the two directories: data/blog and data/content. The former is for blog posts on your website, and the latter is for all content you've written on different platforms.

For the latter, files are named by their platform with the .yml extension. For example, hashnode's content are stored in data/content/hashnode.yml. The structure of the file is as follows:

- platform: Hashnode
  link: [link to your hashnode profile, or null]
  content:
    - item:
      title: [title1 of your content]
      link: [link to your content]
      tags: [helpful tags for your content]
    - item:
      title: [title2 of your content]
      link: [link to your content]
      tags: [helpful tags for your content]
    - ...and so on

You can add as many content in the content array.

Adding new platforms

The first step is adding the file as described above to add a new platform.

Then you'd need to do a few more things:

In src/pages/content, create a new graphql query in the exported query object below the file. Say your platform is Hashnode, you'd need to add the following query:

hashnode: allHashnodeYaml {
      edges {
        node {
          id
          platform
          link
          content {
            title
            link
            tags
          }
        }
      }
    }

Next, add this platform to the allContent array in the Content component in the same file:

//
const {
  // previous content here
  // ..,
  hashnode,
} = data
const allContent = [
  // add previous content to the array
  // ..,
  hashnode,
]
//

And that's all. On your content page, you can see the content of your new platform.

Also, note that the order of the platforms in the allContent array determines how they are displayed on the content grid.

Helpful Notes

  • react-mansory-css is the library used to display the mansory grid layout. Thank you, Paul.
  • use-media is the library used to change the number of columns based on the screen side. Thank you streamich.

Contributing

Highly recommended. Please create a pull request if you have contributions.

gatsby-starter-all-content's People

Contributors

dillionmegida avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.