Skip to content

Commit

Permalink
feat: Add gatsby-theme-emma-core (#49)
Browse files Browse the repository at this point in the history
Basically the same process as:
gatsbyjs/gatsby#16166

> A Gatsby theme for creating a blog child theme. It includes all of the data structures you need to get up and running building a blog and includes no additional theming or style opinions.

Just for the Emma theme. Which means:

You can totally customize the design now, but keep the data structure. So awesome <3
As the Theme UI styling for example happens in `emma`, not `emma-core`.
  • Loading branch information
LekoArts authored Aug 23, 2019
1 parent e6aff04 commit 4d8149a
Show file tree
Hide file tree
Showing 24 changed files with 815 additions and 584 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ module.exports = {
"import/extensions": 0,
"react/jsx-one-expression-per-line": 0,
"react/no-danger": 0,
"react/display-name": 1,
"react/display-name": 0,
"react/react-in-jsx-scope": 0,
"react/jsx-uses-react": 1,
"react/forbid-prop-types": 0,
Expand Down
1 change: 0 additions & 1 deletion plop-templates/theme/gatsby-config.js.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ module.exports = themeOptions => ({
siteLanguage: `en`,
siteImage: `/banner.jpg`,
author: `@lekoarts_de`,
basePath,
},
plugins: [
`gatsby-plugin-typescript`,
Expand Down
17 changes: 17 additions & 0 deletions themes/gatsby-theme-emma-core/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
.cache
node_modules
public
projects

.idea
.vscode
.DS_Store

index.d.ts
types.ts

__tests__


tsconfig.json
jest.config.js
79 changes: 79 additions & 0 deletions themes/gatsby-theme-emma-core/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
<p align="center">
<a href="https://themes.lekoarts.de">
<img alt="Gatsby Theme" src="https://img.lekoarts.de/gatsby/gatsby-themes-illustration.png" />
</a>
</p>
<h1 align="center">
@lekoarts/gatsby-theme-emma-core
</h1>

<p align="center">
<a href="https://github.com/LekoArts/gatsby-themes/blob/master/LICENSE">
<img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="@lekoarts/gatsby-theme-emma-core is released under the MIT license." />
</a>
<a href="https://www.npmjs.org/package/@lekoarts/gatsby-theme-emma-core">
<img src="https://img.shields.io/npm/v/@lekoarts/gatsby-theme-emma-core.svg" alt="Current npm package version." />
</a>
<a href="https://npmcharts.com/compare/@lekoarts/gatsby-theme-emma-core?minimal=true">
<img src="https://img.shields.io/npm/dm/@lekoarts/gatsby-theme-emma-core.svg" alt="Downloads per month on npm." />
</a>
<a href="https://npmcharts.com/compare/@lekoarts/gatsby-theme-emma-core?minimal=true">
<img src="https://img.shields.io/npm/dt/@lekoarts/gatsby-theme-emma-core.svg" alt="Total downloads on npm." />
</a>
<img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg" alt="PRs welcome!" />
<a href="https://twitter.com/intent/follow?screen_name=lekoarts_de">
<img src="https://img.shields.io/twitter/follow/lekoarts_de.svg?label=Follow%20@lekoarts_de" alt="Follow @lekoarts_de" />
</a>
</p>

Core Theme for [`@lekoarts/gatsby-theme-emma`](https://github.com/LekoArts/gatsby-themes/tree/master/themes/gatsby-theme-emma). This theme implements the `Project` and `Page` node interfaces and exports templates (+ queries) which you can shadow.

[**Demo Website**](https://emma.lekoarts.de) ([Source Code](https://github.com/LekoArts/gatsby-starter-portfolio-emma))

Also be sure to checkout other [Free & Open Source Gatsby Themes](https://themes.lekoarts.de)

## Installation

```sh
npm install @lekoarts/gatsby-theme-emma-core
```

## Usage

### Theme options

| Key | Default Value | Description |
| -------------- | ------------------ | --------------------------------------------------------------------------------------------------------- |
| `basePath` | `/` | Root url for the theme |
| `projectsPath` | `content/projects` | Location of projects |
| `pagesPath` | `content/pages` | Location of additional pages (optional) |
| `mdx` | `true` | Configure `gatsby-plugin-mdx` (if your website already is using the plugin pass `false` to turn this off) |

The usage of `content/pages` is optional. If no page/MDX file is found the navigation will be hidden.

#### Example usage

```js
// gatsby-config.js
module.exports = {
plugins: [
{
resolve: `@lekoarts/gatsby-theme-emma-core`,
options: {
// basePath defaults to `/`
basePath: `/sideproject`,
// projectsPath defaults to `content/projects`
projectsPath: `content/cool-projects`
}
}
]
};
```

## 🌟 Supporting me

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](https://twitter.com/lekoarts_de) and share the project with me.

Please star this project, share it on Social Media or consider supporting me on [Patreon](https://www.patreon.com/lekoarts)!

If you want to hire me for **contract/freelance work**, you can do so! [Get in touch with me!](https://www.lekoarts.de/en/contact)
66 changes: 66 additions & 0 deletions themes/gatsby-theme-emma-core/gatsby-config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
const withDefaults = require(`./utils/default-options`)

module.exports = themeOptions => {
const options = withDefaults(themeOptions)
const { mdx = true } = themeOptions

return {
siteMetadata: {
siteTitle: `Emma`,
siteTitleAlt: `Emma - @lekoarts/gatsby-theme-emma`,
siteHeadline: `Emma - Gatsby Theme from @lekoarts`,
siteUrl: `https://emma.lekoarts.de`,
siteDescription: `Minimalistic portfolio with full-width grid, page transitions, support for additional MDX pages, and a focus on large images`,
siteLanguage: `en`,
siteImage: `/banner.jpg`,
author: `@lekoarts_de`,
basePath: options.basePath,
projectsPath: options.projectsPath,
pagesPath: options.pagesPath,
},
plugins: [
{
resolve: `gatsby-source-filesystem`,
options: {
name: options.projectsPath,
path: options.projectsPath,
},
},
{
resolve: `gatsby-source-filesystem`,
options: {
name: options.pagesPath,
path: options.pagesPath,
},
},
mdx && {
resolve: `gatsby-plugin-mdx`,
options: {
gatsbyRemarkPlugins: [
{
resolve: `gatsby-remark-images`,
options: {
maxWidth: 820,
quality: 90,
linkImagesToOriginal: false,
},
},
],
plugins: [
{
resolve: `gatsby-remark-images`,
options: {
maxWidth: 820,
quality: 90,
linkImagesToOriginal: false,
},
},
],
},
},
`gatsby-transformer-sharp`,
`gatsby-plugin-sharp`,
`gatsby-plugin-typescript`,
].filter(Boolean),
}
}
Loading

0 comments on commit 4d8149a

Please sign in to comment.