2.0.6 • Published 3 years ago

gatsby-theme-serenity v2.0.6

Weekly downloads
1
License
MIT
Repository
-
Last release
3 years ago

Gatsby Theme Serenity 平静

CircleCI Current npm package version.

Demo

You can see my personal blog using this theme and the Github repository with the configuration and content

Quick Start

mkdir my-site
cd my-site
yarn init

# install gatsby-theme-serenity and it's dependencies
yarn add gatsby react react-dom gatsby-theme-serenity

You can add now the yarn scripts to your package.json file

{
  "scripts": {
    "build": "gatsby build",
    "clean": "gatsby clean",
    "develop": "gatsby develop"
  }
}

Then create the gatsby-config.js file:

touch gatsby-config.js

And add the theme configuration to it:

module.exports = {
  plugins: [
    {
      resolve: "gatsby-theme-serenity",
      options: {
           title: "Serenity 平静",
           subtitle: "a short subtitle for the meta title on the home page",
           description: "A minimal theme for your personal blog or webpage",
           siteUrl: "https://asiermarques.com",
           defaultPreviewImage: "/og-default.png",
           author: {
               name: "Asier Marqués",
               bio: "Software Engineer",
               url: "https://asiermarques.com",
               links: {
                   twitter: "https://twitter.com/asiermarques",
                   linkedin: "https://linkedin.com/in/asier",
                   github: "https://github.com/asiermarques",
                   instagram: "https://instagram.com/asiermarques",
                   mail: "mailto:asiermarques@gmail.com"
               }
           },
           links: [
               {
                   title: "Articles",
                   href: "/"
               },
               {
                   title: "About me",
                   href: "/about-me"
               },
           ],
           articles_per_page: 4,
           language: "en"
       },
    },
  ],
}

That's it, you can now run your gatsby site using

yarn develop

This will run a local web server and create the content and static folders with all the required files to run your website.

Adding content

The content need to be stored in the content directory as markdown files.

Every markdown file need to have a frontmatter section in it. Here is an example:

---
date: 2020-11-20 00:30:03+00:00
slug: /2020/hello-world/
title: Hello World
template: post
coverImage: /the-image.jpg
tags:
  - Writing
draft: false
description: "This is your first article, you can find it in the /content directory"
---

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce eu lorem eget metus venenatis dignissim.

As you see the frontmatter section has some variables, some are required but others not

variablerequireddescription
datetruethe ISO 8601 date of the article or page YYYY-MM-DD HH:mm:ss±hh:mm
slugtruethe path for the article or page, for example /2020/hello-world
titletruethe title of the article or page
descriptionfalsethe description for the article or page
drafttrueis the article is published or not
templatetruethe template: the possible values are: post or page
coverImagefalsethe cover image for the article
tagsfalsean array of YAML tags
2.0.3

3 years ago

2.0.2

3 years ago

2.0.5

3 years ago

2.0.4

3 years ago

2.0.6

3 years ago

2.0.1

3 years ago

1.1.54

3 years ago

1.1.53

3 years ago

1.1.52

3 years ago

1.1.51

3 years ago

1.1.50

3 years ago

1.1.49

3 years ago

1.1.48

3 years ago

1.1.47

3 years ago

1.1.46

3 years ago

1.1.45

3 years ago

1.1.44

3 years ago

1.1.43

3 years ago

1.1.42

3 years ago

1.1.41

3 years ago

1.1.38

3 years ago

1.1.37

3 years ago

1.1.39

3 years ago

1.1.40

3 years ago

1.1.29

3 years ago

1.1.28

3 years ago

1.1.30

3 years ago

1.1.23

3 years ago

1.1.27

3 years ago

1.1.26

3 years ago

1.1.25

3 years ago

1.1.24

3 years ago

1.1.22

3 years ago

1.1.21

3 years ago

1.1.19

3 years ago

1.1.20

3 years ago

1.1.18

3 years ago

1.1.17

3 years ago

1.1.16

3 years ago

1.1.15

3 years ago

1.1.14

3 years ago

1.1.11

3 years ago

1.1.10

3 years ago

1.1.13

3 years ago

1.1.9

3 years ago

1.1.8

3 years ago

1.1.7

3 years ago

1.1.6

3 years ago

1.1.5

3 years ago

1.1.4

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago