Browse Source

add scripts, tag img, update readme, rmv twtr, tag to topic and move blogs

master
Agastya Chandrakant 1 year ago
parent
commit
153166106d
9 changed files with 65 additions and 19 deletions
  1. +35
    -6
      README.md
  2. +1
    -1
      blogs/zealots-against-zomato/index.md
  3. +5
    -5
      gatsby-config.js
  4. +1
    -1
      gatsby-node.js
  5. +7
    -2
      package.json
  6. +1
    -1
      src/components/complexHeader.js
  7. +1
    -1
      src/components/tinyHeader.js
  8. +13
    -1
      src/tagData/index.js
  9. +1
    -1
      src/templates/allTagsIndex.js

+ 35
- 6
README.md View File

@ -1,18 +1,29 @@
## First things first
For updating the website:
For updating the website (assuming you have the repo locally):
```zsh
yarn depoly
```
1. Go to [Settings](https://github.com/cognitive137/sana137.in/settings).
1. Go to GitHub repo [Settings](https://github.com/cognitive137/sana137.in/settings).
2. Look for "GitHub Pages" from bottom.
3. Update "Custom domain" accordingly.
# Usage note
## Getting the repo
```bash
# Run the following commands
git clone https://github.com/cognitive137/sana137.in
cd path/to/cloned/repo
yarn # to install dependencies
```
## Adding new blogs
1. Create a folder in `src/blogs`, say _`newBlogPost`_.
1. Create a folder in `blogs`, say _`newBlogPost`_.
2. In the folder _`newBlogPost`_, create a markdown file **`index.md`**.
3. Put the content of the blog in the **`index.md`** file.
@ -31,7 +42,7 @@ Each object should match:
}
```
Make sure you don't repeat tags, else none will be chosen.
Make sure you don't repeat tags in array in `./src/tagData/index.js`, else none will be chosen.
## Frontmatter
@ -60,13 +71,31 @@ title: 'Blog Post’s Title'
4. Make sure path starts with **`/`**, and is unique.
## Testing your addition renders perfectly
Run the following commands to test if the site works fine locally.
```bash
yarn clean
yarn start
# Look in the terminal on which port the site is live.
# navigate to localhost:port/path-to-new-blog
```
## Updating the website
Run the following commands to update the website:
```bash
gatsby build
cd public
yarn clean
yarn build
yarn deploy
```
Run the following commands to push the local changes to remote:
```bash
git add .
git commit -m "Added new blog (or) made some changes"
git push
```


src/blogs/zealots-against-zomato/index.md → blogs/zealots-against-zomato/index.md View File

@ -3,7 +3,7 @@ path: '/zealots-against-zomato'
date: '2019-08-08'
title: 'Zealots against Zomato'
tags: ['religion', 'food', 'discrimination', 'zomato', 'faith']
cover: 'https://images.unsplash.com/photo-1526367790999-0150786686a2'
cover: 'https://images.unsplash.com/photo-1526367790999-0150786686a2?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=2102&q=80'
excerpt: "I can't justify someone's request to not have a particular person as the SPL because she is of a particular religion. Judging here on the..."
---

+ 5
- 5
gatsby-config.js View File

@ -1,12 +1,12 @@
module.exports = {
siteMetadata: {
author: `Sana`,
description: `Welcome to my website!`,
headerImg: `https://images.unsplash.com/photo-1536633125620-8a3245c11ffa`,
description: `Hi, I am Sana!`,
headerImg: `https://images.unsplash.com/photo-1536633125620-8a3245c11ffa?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=2822&q=80`,
name: `Sana`,
photo: `https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRQMmVLtfjxqwhKZ7MR9I8SIn9s3LsN7l9z7vuIfjzYt97fN3B7&s`,
photo: `https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRQMmVLtfjxqwhKZ7MR9I8SIn9s3LsN7l9z7vuIfjzYt97fN3B7&`,
siteUrl: `https://sana137.in`,
title: `Sana's stories`,
title: `Welcome to my website!`,
homeName: `サナ`,
},
plugins: [
@ -40,7 +40,7 @@ module.exports = {
resolve: `gatsby-source-filesystem`,
options: {
name: `pages`,
path: `${__dirname}/src/blogs`,
path: `${__dirname}/blogs`,
},
},
`gatsby-plugin-react-helmet`,


+ 1
- 1
gatsby-node.js View File

@ -61,7 +61,7 @@ exports.createPages = ({ graphql, actions }) => {
}
}
allMarkdownRemark(
sort: { order: ASC, fields: [frontmatter___date] }
sort: { order: DESC, fields: [frontmatter___date] }
) {
edges {
node {


+ 7
- 2
package.json View File

@ -1,5 +1,9 @@
{
"author": "Agastya <me@hanabi.in>",
"author": {
"email": "me@hanabi.in",
"name": "Agastya",
"url": "https://hanabi.in"
},
"bugs": {
"url": "https://github.com/cognitive137/sana137.in/issues"
},
@ -42,6 +46,7 @@
},
"scripts": {
"build": "gatsby build",
"clean": "rm -rf .cache public",
"dev": "gatsby develop",
"develop": "gatsby develop",
"deploy": "gatsby build && gh-pages -d public",
@ -51,4 +56,4 @@
"test": "echo \"Write tests! -> https://gatsby.dev/unit-testing \""
},
"version": "0.1.0"
}
}

+ 1
- 1
src/components/complexHeader.js View File

@ -59,7 +59,7 @@ const TinyHeader = ({ homeName, siteUrl }) => {
<ul className="nav" role="menu">
<li className="nav-weblog" role="menuitem">
<Link to={'/tags'} style={{ textTransform: `upper` }}>
#tags
Topics
</Link>
</li>
</ul>


+ 1
- 1
src/components/tinyHeader.js View File

@ -24,7 +24,7 @@ const TinyHeader = () => {
<ul className="nav" role="menu">
<li className="nav-weblog" role="menuitem">
<Link to={'/tags'} style={{ textTransform: `upper` }}>
#tags
Topics
</Link>
</li>
</ul>


+ 13
- 1
src/tagData/index.js View File

@ -1,7 +1,19 @@
tagData = [
{
tag: 'discrimination',
cover: 'https://images.unsplash.com/photo-1590719550920-7543bd5657a3?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=2100&q=80'
},
{
tag: 'faith',
cover: 'https://images.unsplash.com/photo-1575751639353-e292e76daca3?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=2100&q=80',
},
{
tag: 'food',
cover: '',
cover: 'https://images.unsplash.com/photo-1496412705862-e0088f16f791?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1950&q=80',
},
{
tag: 'religion',
cover: 'https://images.unsplash.com/photo-1501043658504-36d366f4b08a?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=2094&q=80'
}
];
module.exports = tagData;

+ 1
- 1
src/templates/allTagsIndex.js View File

@ -13,7 +13,7 @@ const AllTagsTemplate = ({ data, pageContext }) => {
<div className={'inner'}>
<article className={'post-full post page no-image'}>
<header className={'post-full-header'}>
<h1 className={'post-full-title'}>#Tags</h1>
<h1 className={'post-full-title'}>Topics</h1>
</header>
<section className={'post-full-content'}>
<div className={'post-content'}>


Loading…
Cancel
Save