Skip to content

Commit bb80ca4

Browse files
committed
feat(theme): material UI
"fix #3", "fix #5", "fix #6", "fix #7", "fix #8", "fix #10", "fix #18", "fix #22"
1 parent 00df7c8 commit bb80ca4

File tree

149 files changed

+3954
-3001
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

149 files changed

+3954
-3001
lines changed

README.md

Lines changed: 12 additions & 208 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<p align="center">
2-
<img width="500" height="500" src="https://raw.githubusercontent.com/eshlox/gatsby-theme-axii/master/packages/site/src/images/avatar.png" />
2+
<img width="500" height="500" src="https://raw.githubusercontent.com/eshlox/gatsby-theme-axii/master/packages/site/content/images/avatar.png" />
33
</p>
44

55
# AXII - A Gatsby blog theme
@@ -14,219 +14,15 @@
1414

1515
## Features
1616

17+
- Material UI
1718
- Markdown/MDX support
1819
- Aloglia search
1920
- Light/Dark mode
2021
- SEO, RSS, sitemap
2122

22-
## Example site - source code
23+
## Theme documentation
2324

24-
You can find the example site code in [packages/site](https://github.com/eshlox/gatsby-theme-axii/tree/master/packages/site) directory.
25-
26-
## How to use the theme
27-
28-
1. Create a new directory and add `package.json` file with this content:
29-
30-
```json
31-
{
32-
"private": true,
33-
"name": "blog",
34-
"version": "0.0.1",
35-
"license": "MIT",
36-
"scripts": {
37-
"build": "gatsby build",
38-
"develop": "gatsby develop",
39-
"clean": "gatsby clean"
40-
}
41-
}
42-
```
43-
44-
2. Installation
45-
46-
```
47-
npm install gatsby @eshlox/gatsby-theme-axii
48-
```
49-
50-
3. Create `.env` file to provide Algolia credentials.
51-
52-
```env
53-
ALGOLIA_APPLICATION_ID=APP-ID
54-
ALGOLIA_ADMIN_API_KEY=ADMIN-API-KEY
55-
ALGOLIA_SEARCH_API_KEY=SEARCH-API-KEY
56-
```
57-
58-
4. Run the development server.
59-
60-
```sh
61-
npm run develop
62-
```
63-
64-
5. Build the site.
65-
66-
```sh
67-
npm run build
68-
```
69-
70-
## Configuration
71-
72-
Create a `gatsby-config.js` file, use the configuration below and modify it to your needs.
73-
74-
```js
75-
// Loads environment variables from a .env file into process.env
76-
require("dotenv").config();
77-
78-
const options = {
79-
// The directory with blog posts (markdown/mdx files)
80-
contentPosts: "content/posts",
81-
// The site configuration
82-
siteMetadata: {
83-
// The site URL
84-
siteUrl: `https://gatsby-theme-axii.netlify.com`,
85-
// The index page title
86-
siteTitle: `Homepage`,
87-
// The site description
88-
siteDescription: `Very simple blog theme.`,
89-
// Author data
90-
author: {
91-
nickname: `eshlox`,
92-
// Author name. It's added to each page title.
93-
name: `Foo Bar`,
94-
email: `email@example.com`
95-
},
96-
// Social accounts. Remove to disable.
97-
social: {
98-
twitter: {
99-
username: "eshlox",
100-
url: "https://twitter.com/eshlox"
101-
},
102-
github: {
103-
url: "https://github.com/eshlox/gatsby-theme-axii"
104-
},
105-
linkedin: {
106-
url: "https://linkedin.com/eshlox"
107-
},
108-
telegram: {
109-
url: "https://telegram.me/eshlox"
110-
}
111-
},
112-
// Data used for the manifest page file
113-
manifest: {
114-
name: `AXII - A Gatsby blog theme`,
115-
short_name: `AXII`
116-
},
117-
// Data used to display support component. Remove to disable.
118-
support: {
119-
buymeacoffee: {
120-
url: "https://www.buymeacoffee.com/eshlox"
121-
}
122-
},
123-
// Comments services. Remove to disable.
124-
comments: {
125-
disqus: {
126-
shortname: "axii-a-gatsby-theme"
127-
}
128-
},
129-
// Alogolia application ID and credentials
130-
search: {
131-
algolia: {
132-
posts: {
133-
applicationId: process.env.ALGOLIA_APPLICATION_ID,
134-
searchApiKey: process.env.ALGOLIA_SEARCH_API_KEY,
135-
adminApiKey: process.env.ALGOLIA_ADMIN_API_KEY
136-
}
137-
}
138-
}
139-
}
140-
};
141-
142-
const plugins = [
143-
{
144-
resolve: "@eshlox/gatsby-theme-axii",
145-
options
146-
}
147-
];
148-
149-
module.exports = {
150-
plugins
151-
};
152-
```
153-
154-
### Index page
155-
156-
To build the index page, create an `index.mdx` file in `src/pages` directory. It supports MDX so you can import and use all components. Components from [src/components](https://github.com/eshlox/gatsby-theme-axii/tree/master/packages/gatsby-theme-axii/src/components) are available automatically. Example:
157-
158-
```mdx
159-
import Avatar from "@eshlox/gatsby-theme-axii/src/components/Avatar";
160-
import Seo from "@eshlox/gatsby-theme-axii/src/components/SEO";
161-
import {
162-
Section,
163-
SectionContainer
164-
} from "@eshlox/gatsby-theme-axii/src/components/Section";
165-
166-
<Seo />
167-
<SectionContainer>
168-
<Section>
169-
<h1>eshlox</h1>
170-
</Section>
171-
<Section>
172-
<Avatar />
173-
</Section>
174-
<Section>
175-
<h1>My awesome blog.</h1>
176-
</Section>
177-
</SectionContainer>
178-
```
179-
180-
### Avatar and site favicon.
181-
182-
Add `avatar.png` and `icon.png` (favicon) files to the `src/images` directory.
183-
184-
### Blog posts
185-
186-
By default, blog posts should be stored in the `content/posts` directory. Example structure:
187-
188-
```
189-
content
190-
└── posts
191-
└── 2019
192-
├── music-from-aladdin-2019
193-
│   └── index.mdx
194-
├── photos-from-unsplash
195-
│   ├── images
196-
│   │   ├── carly-johnston-ndsA009eNy8-unsplash.jpg
197-
│   │   ├── eberhard-grossgasteiger-iYyfRNIgckk-unsplash.jpg
198-
│   │   ├── jamie-fenn-kj7Gp4LIvtw-unsplash.jpg
199-
│   │   └── todd-trapani-kLKg4fJlmqM-unsplash.jpg
200-
│   └── index.mdx
201-
└── twitter-test
202-
└── index.mdx
203-
```
204-
205-
Example post file:
206-
207-
```md
208-
---
209-
title: Post title
210-
date: 2019-11-05
211-
categories: ["category"]
212-
tags: ["tag1", "tag2"]
213-
language: en
214-
slug: post-title
215-
comments: false
216-
---
217-
218-
Post body.
219-
```
220-
221-
| Key | Required | Default Value | Description |
222-
| ------------ | -------- | ------------------------ | --------------------------- |
223-
| `title` | `True` | | Post title |
224-
| `date` | `True` | | Post creation date |
225-
| `categories` | `False` | | List of the post categories |
226-
| `tags` | `False` | | List of the post tags |
227-
| `language` | `False` | `en` | Post language |
228-
| `slug` | `False` | Autogenerated from title | Post slug (used in URL) |
229-
| `comments` | `False` | `True` | Enable/disable comments |
25+
https://github.com/eshlox/gatsby-theme-axii/blob/master/packages/gatsby-theme-axii/README.md
23026

23127
## Development
23228

@@ -249,3 +45,11 @@ yarn workspace site develop
24945
```sh
25046
lerna publish
25147
```
48+
49+
### Yarn
50+
51+
## Add package
52+
53+
```sh
54+
yarn workspace @eshlox/gatsby-theme-axii add packageName
55+
```

0 commit comments

Comments
 (0)