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

@themurka/gatsby-theme-minimal-blog

v2.3.8

Published

Typography driven, feature-rich blogging theme with minimal aesthetics. Includes tags/categories support and extensive features for code blocks such as live preview, line numbers, and line highlighting.

Downloads

18

Readme

Typography driven, feature-rich blogging theme with minimal aesthetics. Includes tags/categories support and extensive features for code blocks such as live preview, line numbers, and line highlighting.

Live Preview View Design on Figma

Read the Source Code.

Also be sure to checkout other Free & Open Source Gatsby Themes

Features

  • MDX
  • Theme UI-based theming
  • Light Mode / Dark Mode
  • Typography driven, minimal style
  • Tags/Categories support
  • Code highlighting with prism-react-renderer and react-live support. Also allows adding line numbers, line highlighting, language tabs, and file titles.
  • RSS Feed for blog posts

Installation

npm install @lekoarts/gatsby-theme-minimal-blog

Install as a starter

This will generate a new site that pre-configures use of the theme.

gatsby new minimal-blog LekoArts/gatsby-starter-minimal-blog

View the starter's code

Usage

Theme options

| Key | Default Value | Description | | ----------------- | ---------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | | basePath | / | Root url for the theme | | blogPath | /blog | url for the blog post overview page | | tagsPath | /tags | url for the tags overview page and prefix for tags (e.g. /tags/my-tag) | | postsPath | content/posts | Location of posts | | pagesPath | content/pages | Location of additional pages (optional) | | mdx | true | Configure gatsby-plugin-mdx (if your website already is using the plugin pass false to turn this off) | | formatString | DD.MM.YYYY | Configure the date format for Date fields | | showLineNumbers | true | Show line numbers in code blocks | | navigation | [] | Add links to your internal sites to the left part of the header | | externalLinks | [] | Add links to your external sites to the right part of the header | | feed | true | Configure gatsby-plugin-feed (if your website already is using the plugin pass false to turn this off) | | feedTitle | Minimal Blog - @lekoarts/gatsby-theme-minimal-blog | Pass a string to the title option of gatsby-plugin-feed |

Example usage

// gatsby-config.js
module.exports = {
  plugins: [
    {
      resolve: `@lekoarts/gatsby-theme-minimal-blog`,
      options: {
        showLineNumbers: false,
        navigation: [
          {
            title: `Blog`,
            slug: `/blog`,
          },
          {
            title: `About`,
            slug: `/about`,
          },
        ],
        externalLinks: [
          {
            name: `Twitter`,
            url: `https://twitter.com/lekoarts_de`,
          },
          {
            name: `Instagram`,
            url: `https://www.instagram.com/lekoarts.de/`,
          },
        ],
      },
    },
  ],
};

Additional configuration

In addition to the theme options, there are a handful of items you can customize via the siteMetadata object in your site's gatsby-config.js

// gatsby-config.js
module.exports = {
  siteMetadata: {
    // Used for the title template on pages other than the index site
    siteTitle: `Lupin`,
    // Default title of the page
    siteTitleAlt: `Minimal Blog - @lekoarts/gatsby-theme-minimal-blog`,
    // Can be used for e.g. JSONLD
    siteHeadline: `Minimal Blog - Gatsby Theme from @lekoarts`,
    // Will be used to generate absolute URLs for og:image etc.
    siteUrl: `https://minimal-blog.lekoarts.de`,
    // Used for SEO
    siteDescription: `Typography driven, feature-rich blogging theme with minimal aesthetics. Includes tags/categories support and extensive features for code blocks such as live preview, line numbers, and line highlighting.`,
    // Will be set on the <html /> tag
    siteLanguage: `en`,
    // Used for og:image and must be placed inside the `static` folder
    siteImage: `/banner.jpg`,
    // Twitter Handle
    author: `@lekoarts_de`,
    // Links displayed in the header on the right side
    externalLinks: [
      {
        name: `Twitter`,
        url: `https://twitter.com/lekoarts_de`,
      },
      {
        name: `Instagram`,
        url: `https://www.instagram.com/lekoarts.de/`,
      },
    ],
    // Navigation links
    navigation: [
      {
        title: `Blog`,
        slug: `/blog`,
      },
    ],
  },
};

If you want to add additional items to the navigation or external links (left and right side of header), add objects in the shape shown above to the arrays.

Code Highlighting

Since this theme ships with prism-react-renderer and react-live certain additional features were added to code blocks. You can find an overview / usage example in the example repository! If you want to change certain code styles or add additional language tabs, you need to shadow the file src/@lekoarts/gatsby-theme-minimal-blog/styles/code.js.

Language tabs:

When you add a language (such as e.g. js or javascript) to the code block, a little tab will appear at the top left corner.

```js
// code goes here
```

Code titles:

You can display a title (e.g. the file path) above the code block.

```jsx:title=your-title
// code goes here
```

Or without a specific language:

```:title=your-title
// code goes here
```

Line highlighting:

You can highlight single or multiple (or both) lines in a code block. You need to add a language.

```js {2,4-5}
const test = 3
const foo = 'bar'
const harry = 'potter'
const hermione = 'granger'
const ron = 'weasley'
```

Hide line numbers:

If you want to hide line numbers you can either globally disable them (see Theme options) or on a block-by-block basis. You can also combine that with the other attributes.

```noLineNumbers
// code goes here
```

react-live:

Add react-live to the code block (and render the component) to see a preview below it.

```js react-live
const onClick = () => {
  alert("You opened me");
};
render(<button onClick={onClick}>Alohomora!</button>);
```

Shadowing

Please read the guide Shadowing in Gatsby Themes to understand how to customize the this theme! Generally speaking you will want to place your files into src/@lekoarts/gatsby-theme-minimal-blog/ to shadow/override files.

Adding content

Adding a new blog post

New blog posts will be shown on the index page (the three most recent ones) of this theme and on the blog overview page. They can be added by creating MDX files inside content/posts. General setup:

  1. Create a new folder inside content/posts
  2. Create a new index.mdx file, and add the frontmatter
  3. Add images to the created folder (from step 1) you want to reference in your blog post
  4. Reference an image as your banner in the frontmatter
  5. Write your content below the frontmatter
  6. Add a slug to the frontmatter to use a custom slug, e.g. slug: "/my-slug" (Optional)

Frontmatter reference:

---
title: Introduction to "Defence against the Dark Arts"
date: 2019-11-07
description: Defence Against the Dark Arts (abbreviated as DADA) is a subject taught at Hogwarts School of Witchcraft and Wizardry and Ilvermorny School of Witchcraft and Wizardry.
tags:
  - Tutorial
  - Dark Arts
banner: ./defence-against-the-dark-arts.jpg
---

The fields description and banner are optional! If no description is provided, an excerpt of the blog post will be used. If no banner is provided, the default siteImage (from siteMetadata) is used.

The date field has to be written in the format YYYY-MM-DD!

Adding a new page

Additional pages can be created by placing MDX files inside contents/pages, e.g. an "About" or "Contact" page. You'll manually need to link to those pages, for example by adding them to the navigation (in siteMetadata). General instructions:

  1. Create a new folder inside content/pages
  2. Create a new index.mdx file, and add the frontmatter
  3. Write your content below the frontmatter
  4. Optionally add files/images to the folder you want to reference from the page

Frontmatter reference:

---
title: About
slug: "/about"
---

Changing the "Hero" text

To edit the hero text ("Hi, I'm Lupin...), create a file at src/@lekoarts/gatsby-theme-minimal-blog/texts/hero.mdx to edit the text.

Changing the "Projects" part

To edit the projects part below "Latest posts", create a file at src/@lekoarts/gatsby-theme-minimal-blog/texts/bottom.mdx to edit the contents.

🌟 Supporting me

Thanks for using this project! I'm always interested in seeing what people do with my projects, so don't hesitate to tag me on Twitter and share the project with me.

Please star this project, share it on Social Media or consider supporting me on Patreon or GitHub Sponsor!