Blog Template

April 19, 2020

5 min read

Blog template

A template for markdown blogs with GitHub pages

Image using default html:

1|![Markdown logo](/content/assets/blog-template/first_image.jpg)

Markdown logo


Image using next/image, optimize image with builtin next (must have size of image)

1|<CustomImage src="/content/assets/blog-template/first_image.jpg" alt="first_image" width={700} height={460} />
first_image

Image using next-optimized-images

1|<CustomImage2 src="/content/assets/blog-template/first_image.jpg" alt="first_image" />
first_image

Note: All path of image must inside public folder

Instructions for deploying this blog template

If you plan on using this on your website, just click "Use this template" or fork this repo. I highly recommend dillinger markdown editor for editing markdown files. repl.it is also good. This repo has gh-pages as it's default branch. This will automatically put your README.MD file (this file) on yourusername.github.io/blog.

Markdown syntax and examples

Contents

* Headings

* Text styling

* Block Quotes

* Superscript and Subscript

* Code blocks

* Tables

* Lists

Heading 1

Heading 2

Heading 3

Heading 4

Heading 5
Heading 6

Text styling

*ignore markdown characters* Italic Bold Bold and italic

Block quotes

Intelligence is the ability to avoid doing work, yet getting the work done. -Linus Torvalds

Superscript and subscript

Superscript demonstrated by Einstein famous Mass–energy equivalence

E=MC2

Subscript demonstrated by the equation for finding the Nth Fibonacci number recursively

Fn=Fn-1+Fn-2

Code blocks

Wow, code block

1|Multi-line code block
2|In markdown, makes a haiku
3|Japanese poem

With JS syntax highlighting

1|function fib(n) {
2| if (n < 2) return n;
3| return fib(n - 1) + fib(n - 2);
4|}

with Live

1|class Example extends React.Component {
2| render() {
3| return <strong>Hello World!</strong>;
4| }
5|}

Tables

Note: Tables sometimes render incorrectly when bieng viewed in a browser. If you are having this issue, view this file here
ColumnDifferent column
Table thing onetheir called arguments
RowNo, their called parameters
CellActually, their called cells.

Lists

  • Top list -Other thing
  • Top list 2
    1. Foo
    2. Bar
    3. Ack
  1. List item
  2. List item
  3. List item

(c) Kaz Malhotra 2019

Math

Must below code in markdown file

1|<link
2| rel="stylesheet"
3| href="https://cdn.jsdelivr.net/npm/katex@0.11.0/dist/katex.min.css"
4| integrity="sha384-BdGj8xC2eZkQaxoQ8nSLefg4AV4/AwB3Fj+8SUSo7pnKP6Eoy18liIKTPn9oBYNG"
5| crossOrigin="anonymous"
6|/>

One line math

$L = \frac{1}{2} \rho v^2 S C_L$

Lift(LL) can be determined by Lift Coefficient (CLC_L) like the following equation: L=12ρv2SCLL = \frac{1}{2} \rho v^2 S C_L

Multiple line math

1|$$
2|L = \frac{1}{2} \rho v^2 S C_L
3|$$

Lift(LL) can be determined by Lift Coefficient (CLC_L) like the following equation:

L=12ρv2SCLL = \frac{1}{2} \rho v^2 S C_L