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.
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. Using the Gatsby Theme @lekoarts/gatsby-theme-minimal-blog
.
Also be sure to check out other Free & Open Source Gatsby Themes and my Personal Website.
Deploy this starter with one click on Netlify:
Use the Gatsby CLI to clone the site and install dependencies:
npx gatsby new gatsby-starter-minimal-blog https://github.com/LekoArts/gatsby-starter-minimal-blog
cd gatsby-starter-minimal-blog
Start the site by running npm run develop
.
Your site is now running at http://localhost:8000
!
If you want to learn more about how you can use a Gatsby starter that is configured with a Gatsby theme, you can check out this shorter or longer tutorial. The tutorials don’t exactly apply to this starter however the concepts are the same.
Important Note: Please read the guide Shadowing in Gatsby Themes to understand how to customize the underlying theme!
This starter creates a new Gatsby site that installs and configures the theme @lekoarts/gatsby-theme-minimal-blog
.
Have a look at the theme’s README and files to see what options are available and how you can shadow the various components including Theme UI. Generally speaking you will want to place your files into src/@lekoarts/gatsby-theme-minimal-blog/
to shadow/override files. The Theme UI config can be configured by shadowing its files in src/gatsby-plugin-theme-ui/
.
Since the underlying theme ships with prism-react-renderer 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:
```none 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 highlight=2,4-5
const test = 3
const foo = 'bar'
const harry = 'potter'
const hermione = 'granger'
const ron = 'weasley'
```
Show line numbers:
If you want to show line numbers you can either globally enable them (see theme options) or on a block-by-block basis. You can also combine that with the other attributes.
```js withLineNumbers
// code goes here
```
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:
content/posts
index.mdx
file, and add the frontmatterbanner
in the frontmatterslug
to the frontmatter to use a custom slug, e.g. slug: "/my-slug"
(Optional)defer
to opt-in into Deferred Static Generation (DSG) (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.
defer: false
tags:
- Tutorial
- Dark Arts
banner: ./defence-against-the-dark-arts.jpg
canonicalUrl: https://random-blog-about-curses.com/curses-counter-curses-and-more
---
The fields description
, banner
, defer
and canonicalUrl
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. If no canonicalUrl
is provided, it will not be included in the header.
The date
field has to be written in the format YYYY-MM-DD
!
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:
content/pages
index.mdx
file, and add the frontmatterdefer
to opt-in into Deferred Static Generation (DSG) (optional)Frontmatter reference:
---
title: About
slug: "/about"
defer: false
---
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.
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.
Inside the <Post />
component there’s also a <PostFooter />
component that you can shadow to display elements between the end of the post and the global footer. By default it returns null
. Create a file at src/@lekoarts/gatsby-theme-minimal-blog/components/post-footer.jsx
to edit this section. The <PostFooter />
component receives the complete post
prop that <Post />
also receives.
static
folderThe static
folder contains the icons, social media images and robots.txt
. Don’t forget to change these files, too! You can use Real Favicon Generator to generate the image files inside static
.
If you have general questions or need help with Gatsby, please go to one of the support platforms mentioned in Gatsby’s documentation. If you have a specific question about this project, you can head to the GitHub Discussions of the repository.
Looking for more guidance? Full documentation for Gatsby lives on Gatsby’s website.
To learn more about Gatsby themes specifically, I recommend checking out the theme docs.
For most developers, I recommend starting with the in-depth tutorial for creating a site with Gatsby. It starts with zero assumptions about your level of ability and walks through every step of the process.
To dive straight into code samples, head to Gatsby’s documentation. In particular, check out the How-to Guides and Reference items in the primary navigation.
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 GitHub Sponsors!