Blog Setup Document / README
“Borderless” Documents (ENG)
- Install
- Basic Settings
- Writing posts
- Deploy
“Borderless”, Gatsby Blog Starter (Theme)
Static websites created with Gatsby, Borderless Blog Theme.
This document is based on the distribution to Github Pages.
- Simple design with minimal color without border
- Create Markdown Posts (Markdown + emoji, ktex)
- Search Engine Optimization (SEO)
- Support Reader Mode in posts such as Safari browser
- Google Analytics support
- Google Adsense support
- Disqus comment function
Install
There are two ways to get started with this blog.
- Use after Forking the Repository
- Use after Cloning the Repository
! Important
Don’t work on the master branch.
If you go through the steps above, the branch you’re working on is develop.
Start working on this develop branch. You can modify the develop branch or create a branch separately from the develop branch.
The master branch is used for deployment, and the built files are located there.
You can work on the develop branch and deploy it using the deploy command.
The deploy command automatically deploys to the master branch, which does not have direct access.
1. Use after Forking the Repository
- After Forking the Repository:
Setting > Option - Repository nameRename the Repository to “username.github.io”Setting > Branches - Default branchChange the default branch. Select develop and press the Update button to proceed.- Clone your Repository.
$ npm iinstall packages$ npm startStart local development environment. Check URL “localhost:8000”
2. Use after Cloning the Repository
$ git clone -b develop --single-branch https://github.com/junhobaik/junhobaik.github.io.git [SITE_DIRECTORY]
$ npm installThis procedure clones the repository based on the develop branch.
Then install the required packages.
$ npm startStart local development environment. Check URL “localhost:8000”
Basic Settings
Modify the default settings for yourself.
Modify ./config.js
config.js example:
module.exports = {
/** Site MetaData (Required all)*/
title: `Dev.White`,
description: `Junho Baik's Development Blog`,
author: `Junho Baik`,
siteUrl: 'https://junhobaik.github.io',
/** Header */
profileImageFileName: 'profile.png',
/** Home > Bio information*/
comment: 'Jr. Web Front-end Developer. / javascript, react ...',
name: 'Junho Baik',
company: '',
location: 'Korea',
email: 'junhobaik@gmail.com',
website: 'https://junhobaik.github.io',
linkedin: '',
facebook: '',
instagram: 'https://www.instagram.com/junhobaik',
github: 'https://github.com/junhobaik',
/** Post */
enablePostOfContents: true,
disqusShortname: 'junhobaik',
enableSocialShare: true,
/** Optional */
googleAnalytics: 'UA-123123123-0',
googleAdsenseClient: 'ca-pub-5001380215831339',
googleAdsenseSlot: '5214956675',
};| Settings | Type | Explanation |
|---|---|---|
| title | (required) String | Title of the site. Title text in the header. Enter the title of each webpage. |
| description | (required) String | Description of the site |
| author | (required) String | Author of the site |
| siteUrl | (required) String | Enter the address of your website. If the address is not present at deployment time, many errors can occur. |
| profileImageFileName | String | Locate your profile picture in the path ./src/images and enter the filename of the image. It enters the image next to the title of the header. If there is no input, it shows a random image. |
| comment, name, company, location, email, website | String | This is the personal information shown on the left side of the Home (index) page. If not entered, the item is not output and all values are entered as strings. |
| linkedin, facebook, instagram, github | String | These are the social icon links that will appear under Personal Information on the left side of the Home (index) page. Clicking on the icon will take you to that link. Please enter full link, not ID. |
| enablePostOfContents | (required) Boolean (true, false) | Set whether the table of contents appears in the post. |
| disqusShortname | String | You can activate the comment function. After creating a site in Disqus, enter the shortname of the site here. Emptying the value disables the comment feature. |
| enableSocialShare | (required) Boolean (true, false) | Set whether to display post social sharing icons at the bottom of the post. |
| googleAnalytics | String | You can activate Google Analytics. Enter your TrackingID. |
| googleSearchConsole | String | Content value in HTML tag of Google Search Console ownership verification, ex. ‘w-K42k14_I4ApiQKuVPbCRVV-GxlrqWxYoqO04KDbKo’ |
| googleAdsenseClient | String | Client input of Google AdSense when activating Google AdSense. In addition, change the number corresponding to Client in ./static/ads.txt to the number of your client. |
| googleAdsenseSlot | String | Enter Google AdSense Slot when activating Google AdSense. |
String values are not required to be empty ''.
Disqus Comments, Google Analytics, and Google Adsense features are disabled during local development. After deployment, you can use these features.
Writing Posts
Posts are written in Markdown.
- Markdown
- Emoji support
- KaTeX support
Your post will be located in the ./_posts folder.
Your draft post will be located in the ./_drafts folder. (Draft posts are visible during local development, but not on the distributed web).
The _posts folder and the _drafts folder must exist. Do not delete both folders.
The title of the file becomes the address of the post. If a date is entered, such as in Jekyll’s post file title format, the date is excluded from the address.
ex 1. ./_posts/first-post.md
address: https://junhobaik.github.io/first-post
./_posts/2019-12-31-first-post.mdaddress:https://junhobaik.github.io/first-post
Create post with image
When embedding an image inside the markdown, the structure is as follows:
Example of creating a post that will have an address of /first-post. After creating ./_posts/first-post folder:
Markdown files have the title index.md,
Place image files in that folder.
_posts/
first-post/
index.md
image-file-1.png
image-file-2.jpg
...Series Posts
When you write several posts on one subject as below, you can use the series function to indicate that the post is included in the series. With the series feature, you’ll see a list of series posts at the top of the post.
- Create a blog, install
- Create a blog, setting up
- Create a blog, Distribution
If you write a post like this, write the file name as below.
development-blog_1.mddevelopment-blog_2.mddevelopment-blog_3.md
The number after the underscore (_) is the number of the series.
The file name before the underscore (_) must be the same.
There must be only one underscore (_) in the file name.
Do not mix numbers and letters after the underscore (_).
Markdown YAML Front Matter
At the top of a Markdown post, enter the information for that post. Enter the information in two --- s as shown below.
---
title: title here...
date: 2018-01-01
tags:
- javascript
- ES6
keywords:
- keyword1
- keyword2
---
contents here...| Variable | Description |
|---|---|
title |
(required) Enter the title of the post. If special characters are included, enclose them in " ". |
date |
(required) Enter the creation date of this post |
tags |
(optional) Enter tag for post |
keywords |
(optional) SEO meta keywords |
+ All values are not enclosed in '', "".
Data Examples
# date Examples
## Case 1
date: 2018-09-01
## Case 2
date: 2018-09-01 22:00:00
## 'Time zone' Not Support
## There is no error but ignores the time zone
date: 2018-09-01 20:00:00 +0900Tags & Keywords Examples
# tags & keywords Examples
## Case 1
tags: onlyOneTag
## Case 2
tags: [tag1, tag2]
## Case 3
tags:
- tag1
- tag2Deploy
Checklist before deploying:
- Make sure your Github repository is named
username.github.io. - Make sure you have written
siteUrlcorrectly in./config.js. - Make sure the branch you are working with is not the
masterbranch. (Please refer to the Install section for the relevant instructions).
$ npm run deployThe deployment starts with the above command. The commit is automatically made to the master branch. It takes several tens of seconds, sometimes up to a few minutes, to be reflected.
You can now enter and verify your address.