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.
1npm i --save @shetharp/gatsby-theme-galleon2# or3yarn add @shetharp/gatsby-theme-galleon
gatsby-config.js
file1module.exports = {2 plugins: ["@shetharp/gatsby-theme-galleon"],3};
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:
1gatsby new gatsby-theme-custom https://github.com/shetharp/gatsby-theme-galleon2cd gatsby-theme-custom3yarn4yarn 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.
1```js2// code goes here3```
You can display a title (e.g. the file path) above the code block.
1```jsx:title=your-title2// code goes here3```
Or without a specific language:
1```:title=your-title2// code goes here3```
You can highlight single or multiple (or both) lines in a code block. You need to add a language.
1```js {2,4-5}2const test = 3;3const foo = "bar";4const harry = "potter";5const hermione = "granger";6const ron = "weasley";7```
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.
1```noLineNumbers2// code goes here3```
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)1---2title: Introduction to "Defence against the Dark Arts"3date: 2019-11-074description: 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.5tags:6 - Tutorial7 - Dark Arts8banner: ./defence-against-the-dark-arts.jpg9---1011Blog 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 frontmatter1---2title: About3slug: "/about"4---56Page 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.