Skip to content

Commit 433080c

Browse files
author
hugur
committed
1 parent 83a0c54 commit 433080c

File tree

2 files changed

+57
-59
lines changed

2 files changed

+57
-59
lines changed

README.md

Lines changed: 28 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1-
This repository is a gatsby theme, that can be used/installed as a
1+
This repository is a gatsby theme development project. The theme (not the example folder) can be used/installed as a
22
gatsby plugin in an other gatsby project.
33

4-
Gatsby theme take advantage of `yarn` and its `workspace` feature, to
5-
offer ease of development.
4+
## Installation
5+
6+
To use this theme in a project, read the docs at `./gatsby-theme-w3f/readme.md`; this project is available as [@w3f/gatsby-theme-w3f package](https://www.npmjs.com/package/@w3f/gatsby-theme-w3f) on npm repository.
67

7-
## Development
8+
## Development (of the theme & example project)
9+
10+
Gatsby theme take advantage of `yarn` and its `workspace` feature, to
11+
offer ease of development.
812

913
To develop locally on the theme, run the following commands from the
1014
root of this repository:
@@ -19,7 +23,26 @@ yarn workspace example develop
1923
> When the example is running, it will use the theme folder (inside
2024
> this repository), as a gatsby module
2125
22-
## Repository Layout
26+
### Use netlify-cms on the example site
27+
28+
In a new shell (aside the local development environment for this
29+
project), run the commands:
30+
31+
- `cd example`
32+
- `npx netlify-cms-proxy-server`
33+
34+
> Note: if you want to use netlify-cms against the local repository
35+
> (instead of the one on the remote), in `./example/.env.development`,
36+
> add the line `GATSBY_NETLIFY_CMS_GIT_LOCAL=true`.
37+
38+
### Debug
39+
40+
To debug yarn workspaces on which this theme development is based, you
41+
can use the command `yarn workspaces info` in the project's root
42+
folder ([see
43+
docs](https://www.gatsbyjs.com/tutorial/building-a-theme/)).
44+
45+
## Repository Layout (theme & example project)
2346

2447
This repository, has two projects in two folders, the theme, and a theme example.
2548

@@ -52,55 +75,3 @@ You can run the example project with:
5275
```shell
5376
yarn workspace example develop
5477
```
55-
56-
## Using the theme in a new project
57-
58-
This project is available as [@w3f/gatsby-theme-w3f package](https://www.npmjs.com/package/@w3f/gatsby-theme-w3f) on npm repository.
59-
60-
### Installation
61-
62-
To use this theme, install it in a project, as a npm module: `npm i --save @w3f/gatsby-theme-w3f`.
63-
64-
### Customization of existing theme files
65-
66-
You can overide existing theme files in your project directory
67-
structure. For this, we use the [Gatsby shadowing
68-
technique](https://www.gatsbyjs.com/docs/how-to/plugins-and-themes/shadowing/),
69-
at the path `./src/@w3f/gatsby-theme-w3f/` of your project.
70-
71-
72-
> For example, to overide the theme file
73-
> `./src/components/HeaderNav.js`, we can create the file
74-
> `./src/@w3f/gatsby-theme-w3f/components/HeaderNav.js` in our
75-
> project.
76-
77-
The same goes for every other theme files.
78-
79-
### Develop new project features/pages
80-
81-
If you'd like to develop other features (pages, components etc.) in
82-
your project, you can do it as usual for every other gatsby projects,
83-
in its `./src/` folder.
84-
85-
Otherwise, to emphasize modularity, you can develop the independant
86-
features, as [Gatsby local
87-
plugins](https://www.gatsbyjs.com/docs/creating-a-local-plugin/).
88-
89-
### Use netlify-cms on the example site
90-
91-
In a new shell (aside the local development environment for this
92-
project), run the commands:
93-
94-
- `cd example`
95-
- `npx netlify-cms-proxy-server`
96-
97-
> Note: if you want to use netlify-cms against the local repository
98-
> (instead of the one on the remote), in `./example/.env.development`,
99-
> add the line `GATSBY_NETLIFY_CMS_GIT_LOCAL=true`.
100-
101-
### Debug
102-
103-
To debug yarn workspaces on which this theme development is based, you
104-
can use the command `yarn workspaces info` in the project's root
105-
folder ([see
106-
docs](https://www.gatsbyjs.com/tutorial/building-a-theme/)).

gatsby-theme-w3f/README.md

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Website
1+
# `@w3f/gatsby-theme-w3f` (npm)
22

33
This is a gatsby theme project, and cannot be run directly.
44

@@ -8,7 +8,34 @@ You can either:
88

99
This document outlines how the theme is setup, its plugin and configuration.
1010

11-
For usage on how to use as a theme, see `../readme.md`.
11+
# Installation as a theme in a project
12+
13+
To use this theme, install it in a project, as a npm module: `npm i --save @w3f/gatsby-theme-w3f`.
14+
15+
## Customization of existing theme files
16+
17+
You can overide existing theme files in your project directory
18+
structure. For this, we use the [Gatsby shadowing
19+
technique](https://www.gatsbyjs.com/docs/how-to/plugins-and-themes/shadowing/),
20+
at the path `./src/@w3f/gatsby-theme-w3f/` of your project.
21+
22+
23+
> For example, to overide the theme file
24+
> `./src/components/HeaderNav.js`, we can create the file
25+
> `./src/@w3f/gatsby-theme-w3f/components/HeaderNav.js` in our
26+
> project.
27+
28+
The same goes for every other theme files.
29+
30+
## Develop new project features/pages
31+
32+
If you'd like to develop other features (pages, components etc.) in
33+
your project, you can do it as usual for every other gatsby projects,
34+
in its `./src/` folder.
35+
36+
Otherwise, to emphasize modularity, you can develop the independant
37+
features, as [Gatsby local
38+
plugins](https://www.gatsbyjs.com/docs/creating-a-local-plugin/).
1239

1340
# Setup, configuration & plugins
1441

0 commit comments

Comments
 (0)