npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@codebrahma/gatsby-theme-blog

v1.0.14

Published

A Gatsby theme for creating a blog.

Downloads

106

Readme

:fire: A Gatsby blog theme supporting local filesystem content, MDX and image processing.

The theme provides several built-in features to set the bare-minimum for building a blog including:

  • Content sourcing and transformation from the filesystem via gatsby-source-filesystem
  • MDX support via gatsby-plugin-mdx
  • Image processing via gatsby-plugin-sharp and gatsby-remark-images
  • Auto creation of individual blog post pages
  • Auto creation of tags/category/author pages
  • Blog list page with Pagination - you specify the number of blogs in a page in the Theme Options.

Installation

  npm install @codebrahma/gatsby-theme-blog

:rocket: Usage

Theme Options

|Key | Default Value | Description | |---------------|---------------|---------------------------------------------------------------------------------------------------------| |basePath | "/blog" | Root URL to all blog posts | |contentPath | "posts" | Location of blog posts | |itemsPerPage | 7 | Number of items per page | |mdx | true | Configure gatsby-plugin-mdx (if your website already is using the plugin pass false to turn this off) |

Example Usage

// gatsby-config.js
module.exports = {
  plugins: [
    {
      resolve: `@codebrahma/gatsby-theme-blog`,
      options: {
        contentPath: 'content/posts',
        basePath: '/blogs',
        itemsPerPage: 5
      }
    }
  ]
}

content/posts directory contains all your Markdown files powering the blog.

  mkdir -p content/posts/hello-world
  touch content/posts/hello-world/hello-world.md

💡 A sample post is below:

---
title: 'Hello World'
date: 2019-10-30
featuredpost: false
description: Hello World, this is my first post.
keywords:
- gatsby
- is
- wonderful
link: /hello-world
category:
- Gatsby
author: Codebrahma
image: ./image.png
tags:
- gatsby
- react
templateKey: blog-post
---

Hello World! This is my first post! I'll have great features enabled by default, including:
 
- Syntax highlighting with triple backticks
- Responsive images
- Responsive iframe embeds
- and more!

:sparkles: Additional Configuration:

  • In addition to the theme options you can add your own Layout component to the blogs. Create a file src/@codebrahma/gatsby-theme-blog/components/layout.js in your site for Component Shadowing.

A sample layout file:

// src/@codebrahma/gatsby-theme-blog/components/layout.js
import React from 'react'
import Header from './Header'
import Footer from './Footer'

const Layout = ({ children }) => {
  return (
    <div>
      <Header />
      <main>
        {children}
      </main>
      <Footer />
    </div>
  )
}

:art: Theming

  • Add your own set of design tokens to create a whole new look for the theme. Take a look at current theme file and get creative. Upgrade by creating your own theme.js file.

  • Example:

// src/@codebrahma/gatsby-theme-blog/components/layout.js
import React from 'react'
import theme from './theme'
import { ThemeProvider } from 'theme-ui'

const Layout = ({ children }) => {
  return (
    <ThemeProvider theme={theme}>
      <main>
        {children}
      </main>
    </ThemeProvider>
  )
}

:handshake: Contributing

Contributions, issues and feature requests are welcome. Feel free to check issues page if you want to contribute.

:pencil: Licence

This project is MIT licensed.