Skip to content

Commit 6748be9

Browse files
committed
docs: Improve getting started paragraph
1 parent 78f028d commit 6748be9

File tree

1 file changed

+42
-31
lines changed

1 file changed

+42
-31
lines changed

README.md

Lines changed: 42 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -10,70 +10,81 @@
1010
</h1>
1111
</div>
1212

13-
Handmade Blog is a classic static blog generator for people who want to start a blog quickly. It supports article type document for a blog post, work type document for portfolio, code highlights, [KaTeX](https://katex.org/) syntax, footnotes, and others.
13+
Handmade Blog is a classic static blog generator for people who want to start a blog quickly. It supports article type document for a blog post, work type document for portfolio, code highlights, [KaTeX](https://katex.org/) syntax, footnotes, and more.
1414

1515
## Demo: [Here](https://handmade-blog.netlify.com/)
1616

1717
![Article page preview](https://user-images.githubusercontent.com/6410412/74097056-be43d100-4b4a-11ea-806b-7bd263d7f623.png)
1818

1919
## Getting Started
2020

21-
1. Click the 'Use this template' button above the file list to create a new repository. If you want to use github.io domain, have to name the repository `{YOUR_ID}.github.io`.
21+
1. Click the 'Use this template' button above the file list to create a new repository. If you want to use github.io domain, have to name the repository `{YOUR_ID}.github.io`. (e.g., `betty-grof.github.io`) Don't forget to enable the 'Include all branches' option.
2222

23-
2. Clone this repository, and install node modules.
23+
![Click the 'Use this template' button](https://user-images.githubusercontent.com/6410412/93741226-f524ae00-fc26-11ea-8f88-ba634d2de66b.png)
2424

25-
```bash
26-
$ git clone https://github.com/{YOUR_ID}/{REPOSITORY_NAME}.git
27-
$ cd {REPOSITORY_NAME}
25+
![Name repository to id.github.io, and enable 'Include all branches' option](https://user-images.githubusercontent.com/6410412/93741223-f48c1780-fc26-11ea-9980-8911e531a29c.png)
26+
27+
2. Click the 'Settings' tab in your repository, and set the source branch for GitHub Pages to `gh-pages` branch. GitHub Pages will host your website based on `gh-pages` branch. You'll be able to access the website via `https://{YOUR_ID}.github.io/` in a few minutes.
28+
29+
![Click the 'Settings' tab](https://user-images.githubusercontent.com/6410412/93750006-d11c9900-fc35-11ea-9ac1-4f92216f28f9.png)
30+
31+
![Set source branch of the github pages to gh-pages branch](https://user-images.githubusercontent.com/6410412/93741218-f2c25400-fc26-11ea-9e30-eddb9a2a3b3f.png)
32+
33+
3. Clone the repository, and install node packages.
34+
35+
```shell script
36+
$ git clone https://github.com/{YOUR_ID}/{REPOSITORY_NAME}.git # git clone https://github.com/betty-grof/betty-grof.github.io.git
37+
$ cd {REPOSITORY_NAME} # cd betty-grof.github.io
2838
$ npm install
2939
```
3040

31-
3. Please create `development` branch and follow [this document](https://help.github.com/en/github/administering-a-repository/setting-the-default-branch) to set the branch to a default. Because GitHub pages hosts the site based on `master` branch. In addition, separating `master` branch and `development` branch is a good practice!
32-
3341
4. Modify `config.json` file in `services` directory to set your blog title and subtitle.
3442

3543
```json
3644
{
37-
"blogTitle": "Lorem Ipsum",
38-
"blogSubtitle": "lorem ipsum",
45+
"blogTitle": "Betty Grof",
46+
"blogSubtitle": "Oh My Glob",
3947
"article": {
4048
"tableOfContents": true
4149
}
4250
}
4351
```
4452

45-
5. Start local server at `http://localhost:1234/`. `npm start` script opens local server based on `server` directory. It occurs an error because there aren't published articles and works pages yet.
53+
5. Start a local server at `http://localhost:1234/`. `npm start` script opens the local server based on `server` directory.
4654

47-
```bash
55+
```shell script
4856
$ npm start
4957
```
58+
59+
![The website that is titled 'Betty Grof' at http://localhost:1234/](https://user-images.githubusercontent.com/6410412/93754683-155f6780-fc3d-11ea-99de-92c747c103f9.png)
60+
61+
6. Commit and push the changes in your working directory to the remote repository.
5062

51-
6. Publish the example articles and works by `npm run publish`. It converts a markdown documents in `_articles` or `_works` directory to HTML files.
52-
53-
```bash
54-
$ npm run publish article
55-
$ npm run publish work
56-
```
63+
```shell script
64+
$ git add ./services/config.json
65+
$ git commit -m "Set the blog title and subtitle"
66+
$ git push origin master
67+
```
5768

58-
7. Run `deploy` script if you're ready to host a live server. This script builds local files to `dist` directory and pushes it to `master` branch that contains only the files in `dist` directory. GitHub will host live server at `https://{YOUR_ID}.github.io/` based on `master` automatically.
69+
7. Run `deploy` script if you're ready to host a live server. This script builds local files to `dist` directory and pushes it to `gh-pages` branch that contains only the files in `dist` directory. GitHub Pages will host live server at `https://{YOUR_ID}.github.io/` based on `gh-pages` branch automatically.
5970
60-
```bash
71+
```shell script
6172
$ npm run deploy
6273
```
6374
6475
## Usage
6576
66-
### Writing and publishing document
77+
### Write and publish a document
6778
6879
1. Write a document in `_articles` or `_works` directory.
6980
70-
1. Run `npm run publish article` or `npm run publish work` script to convert markdown to HTML.
81+
1. Run `npm run publish article` or `npm run publish work` script to convert markdown documents to HTML.
7182
7283
1. Preview converted document on the local server using `npm start` script.
7384
74-
1. Run `npm run deploy` to publish the document to live server.
85+
1. Commit and push the changes to the repository, and run `npm run deploy` to publish the document to live server.
7586
76-
### Changing content of the page
87+
### Change a page
7788
7889
Modify an ejs template to change the contents of the existing page. For example, if you want to put an image to the landing page, open the `app/templates/index.ejs` file, and add `img` tag to the `main-container` element.
7990
@@ -86,13 +97,13 @@ Modify an ejs template to change the contents of the existing page. For example,
8697
8798
Then, run `npm run publish page` script to publish the modified landing page.
8899
89-
```bash
100+
```shell script
90101
$ npm run publish page
91102
```
92103
93104
Done! You can change not only the landing page but any pages like this way. (You may need to understand the project structure.)
94105
95-
### Proejct structure
106+
### Project structure
96107
97108
* `_articles` - Markdown files for the blog posts.
98109
* `_works` - Markdown files for the portfolio.
@@ -128,31 +139,31 @@ Starts local development server at http://localhost:1234/.
128139

129140
Converts templates to HTML files.
130141

131-
```bash
142+
```shell script
132143
$ npm run publish article
133144
```
134145

135146
Converts all articles.
136147

137-
```bash
148+
```shell script
138149
$ npm run publish works
139150
```
140151

141152
Converts all works.
142153

143-
```bash
154+
```shell script
144155
$ npm run publish article 5
145156
```
146157

147158
Converts an article which id is 5.
148159

149-
```bash
160+
```shell script
150161
$ npm run publish work 3
151162
```
152163

153164
Converts a work which id is 3.
154165

155-
```bash
166+
```shell script
156167
$ npm run publish page
157168
```
158169

0 commit comments

Comments
 (0)