Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
78 lines (57 sloc) 2.73 KB

πŸ“ Micro blog Gatsby theme

code style: prettier CircleCI Slack

In the recent years, we've seen the web, a beautiful idea based on open principles and protocols, turned into a corporate web by investors-backed companies. Twitter, Medium, Facebook have convinced us to fuel their marketing machines making us lose control over our content and our attention.

Microblogging is an initiative inspired by the Indie web and the POSSE principle: publish (on your) own site, syndicate everywhere.

Developers that use Gatsby as a framework to build their static websites, and would like to add a timeline of short updates (micro posts) like Twitter does.

Usage πŸ‘©β€πŸ’»

  1. Add the dependency yarn add gatsby-theme-micro-blog.
  2. Add the plugin to your gatsby-config.js.
module.exports = {
  plugins: [
    {
      resolve: `gatsby-theme-micro-blog`,
      options: {
        rootDir: __dirname
      }
    }
  ],
}
  1. Add the timeline anywhere in your website:
import { Timeline } from 'gatsby-theme-micro-blog'

const MyPage = () => {
  return <Timeline/>
}
  1. Add some posts under the micro-posts directory in your project's root directory with the following structure:
micro-posts/
  1568192080/ # Unix timestamp
    post.mdx
  1568192095 / # Unix timestamp
    post.mdx

The posts are rendered with this component that uses Theme UI's theme specification for sizes, fonts and colors. You can use your own component by creating a component at src/gatsby-theme-micro-blog/components/post.jsx with the following structure:

import React from 'react'

export default ({ date, body, tags }) => {
  return <div>
    // Your component
  </div>
}

References

Open source

Tuist is a proud supporter of the Software Freedom Conservacy

Become a Conservancy Supporter!

License

FOSSA Status

You can’t perform that action at this time.