Those who have push access can add new content directly (I assume you know git push).
Go to https://github.com/The-SCRIPT-Group/Blog
Choose the 'Fork' button on the right, to fork it to your account.
Once that's done:
Go to your account ke repos, you'll find 'Blog'. Go to that.
Click the Clone or Download green button on the right, copy the link to clipboard, go to your terminal and clone it to your PC by:
$ git clone CTRL+SHIFT+V
$ git remote add tsg https://github.com/the-script-group/blog.git
Note that 'your-profile' means your username on github, please don't blindly copy.
We need ruby, gem and ruby-dev packages (On Ubuntu atleast, please search for your system). Also ensure you have git installed. Also download Typora from https://www.typora.io/
To check ruby version, do:
$ ruby -v
To check gem version, do:
$ gem -v
To install Jekyll (first time, if you don't have), do:
$ gem install jekyll bundler
Once done installing, check by:
$ jekyll -v
These steps are for first-time setup only.
If you did the above the first time successfully (DRC dude), continue with these:
In your terminal, do these to fetch latest changes from main repo (mandatory):
git fetch tsg gh-pages
git reset --hard tsg/gh-pages
git clean -fdx
ALWAYS DO THIS BEFORE EDITING, ELSE YOUR CHANGES WILL GET OVERWRITTEN!
Open the Blog folder on your system which you cloned, in VSCode or any other editor with folder and terminal support (makes your job easier, trust me. Always trust the person who makes the documentation).
Once the folder is open, start your terminal inside Blog folder and do:
Blog$ bundle exec jekyll serve
Site should be up and running on http://127.0.0.1:4000/. It'll show up in the terminal prompt as well.
So, we have our blog running on our system. Cool.
- _posts: This is the folder that has all our blog posts. Each of these posts should be a markdown file (with a .markdown extension) and should be included within this folder for it to be listed in your blog.
- _site: This files in this folder are responsible for compiling your blog. You basically have different blog posts, images, pages lying in different folders. The files in _sites folder bring them together and publish it as a website. (Not needed for blogging)
- _config.yml: This file contains your site’s variables such as title, your usernames, urls etc. (Not needed for blogging)
- about.md: This is just a markdown file that contains data to be published in your about section. (Not needed for blogging)
- gemfile: gemfile contains all the dependencies for this site. Meaning you are using jekyll. And within jekyll, you are using it’s default theme called ‘Minima’. The gem file specifies such info.
- index.md: contains info that is visible in the home page of your blog.
Go to _posts, and make a new file in the format:
YYYY-MM-DD-NameOfPost.markdown and open in Typora.
At the top of the file, select Paragraph -> YAML Front Matter and put the following compulsorily:
layout: post
title: "Name this blog post"
date: YYYY-MM-DD HH:MM:SS +0530
categories: ctgry1 subctgry1
Add your text and stuff after this matter. After making changes, run:
$ jekyll serve
after stopping the previous running instance with CTRL+C
Push changes like you'd do in git:
$ git add .
$ git commit -m "Describe the post in short"
$ git push origin gh-pages
This'll make changes to your forked repo, not the main TSG one. To do that, do the following:
-
Go to https://github.com/the-script-group/blog, click 'New Pull Request'
-
Click the 'compare across forks' button on the right
-
On the right section, there's 'head repository' dropdown. Choose your Blog repo from the list. Keep the rest same.
-
Click Create Pull Request, on the next page, add some comment, and click Create Pull Request
-
Wait for your changes to get merged. Else just spam Akhil or Ritom or Aniket
Original source: Jekyll BLog