For updating the website (assuming you have the repo locally):
yarn depoly
- Go to GitHub repo Settings.
- Look for "GitHub Pages" from bottom.
- Update "Custom domain" accordingly.
# Run the following commands
git clone https://github.com/cognitive137/sana137.in
cd path/to/cloned/repo
yarn # to install dependencies
- Create a folder in
blogs
, saynewBlogPost
. - In the folder
newBlogPost
, create a markdown fileindex.md
. - Put the content of the blog in the
index.md
file.
Adding cover to tags is handled via an array of objects. That array is located at ./src/tagData/index.js
.
That file contains an array tagData
. Each element of tagData
, must be an object, with two keys, tag
and cover
.
Each object should match:
{
tag: 'unique tag here',
cover: 'www.example.com/path/to/cover'
}
Make sure you don't repeat tags in array in ./src/tagData/index.js
, else none will be chosen.
In every blog post, it is necessary to start the blog post with the following content:
---
cover: 'www.example.com/path/to/cover/img'
date: 'yyyy-mm-dd'
excerpt: 'Add excerpt here'
page: 'true/false'
path: '/uri-to-blog-post'
tags: ['some', 'tags', 'in', 'lowercase']
title: 'Blog Post’s Title'
---
-
All except the excerpt are necessary fields. Make sure you would not be able to escape the single or double quotes in excerpt, so make use of enclosing alternatives.
-
In case if you do not wish to have any tags, keep that parameter to
['']
. -
Use the
yyyy-mm-dd
date format. -
Make sure path starts with
/
, and is unique.
Run the following commands to test if the site works fine locally.
yarn clean
yarn start
# Look in the terminal on which port the site is live.
# navigate to localhost:port/path-to-new-blog
Run the following commands to update the website:
yarn clean
yarn build
yarn deploy
Run the following commands to push the local changes to remote:
git add .
git commit -m "Added new blog (or) made some changes"
git push
Only the Footer functional component (src/components/footer.js
) imports layout.css
.