⚓️ Build a gorgeous developer blog with support for Typescript, MDX, syntax-highlighted code blocks, and tags.
MIT License
Galleon is a Gatsby theme built on top of @lekoarts/gatsby-theme-minimal-blog
.
Use Galleon to quickly build a gorgeous developer blog with support for Typescript, MDX, syntax-highlighted code blocks, and tags.
npm i --save @shetharp/gatsby-theme-galleon
# or
yarn add @shetharp/gatsby-theme-galleon
gatsby-config.js
filemodule.exports = {
plugins: ["@shetharp/gatsby-theme-galleon"],
};
Modify the theme options and site metadata in your gatsby-config.js
file.
Create .mdx
files for your site's pages or posts.
Shadow, override, and customize the theme to fit your needs.
To start developing your own theme using this repo as a starting point:
gatsby new gatsby-theme-custom https://github.com/shetharp/gatsby-theme-galleon
cd gatsby-theme-custom
yarn
yarn workspace demo develop
Replace gatsby-theme-custom
with whatever you wish to name your theme.
The theme
workspace directory contains the components, styles, and theme configurations.
package.json
to match the details for your theme (such as name, author, repository, etc.)The demo
workspace directory contains the content, components, and styles for an example site that consumes the theme.
package.json
to include your theme as a dependency. Make sure the name of the dependency matches the name in your theme's package.json
file!gatsby-config.js
to include your theme as a pluginGalleon builds on top of the features provided in @lekoarts/gatsby-theme-minimal-blog.
If you want to change certain code styles or add additional language tabs, you need to shadow the file src/@shetharp/gatsby-theme-galleon/styles/code.js
.
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
```
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
```
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";
```
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
```
Please read the guide Shadowing in Gatsby Themes to understand how to customize the this theme!
In general, you will want to place your files in src/@shetharp/gatsby-theme-galleon/
to shadow or override files.
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)---
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
---
Blog post content goes here...
📍 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
!
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 frontmatter---
title: About
slug: "/about"
---
Page content goes here...
src/@shetharp/gatsby-theme-galleon/texts/hero.mdx
to shadow the text.src/@shetharp/gatsby-theme-galleon/texts/bottom.mdx
to shadow the contents.