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.
- Add the dependency
yarn add gatsby-theme-micro-blog
. - Add the plugin to your
gatsby-config.js
.
module.exports = {
plugins: [
{
resolve: `gatsby-theme-micro-blog`,
options: {
rootDir: __dirname
}
}
],
}
- Add the timeline anywhere in your website:
import { Timeline } from 'gatsby-theme-micro-blog'
const MyPage = () => {
return <Timeline/>
}
- 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>
}
Tuist is a proud supporter of the Software Freedom Conservacy