Skip to content

Rajeev-SG/blog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

My Blog - A Modern Markdown-Powered Blog Platform

This is a modern, minimalist personal blog platform that turns simple Markdown files into beautiful blog posts. Perfect for developers, writers, or anyone who wants to maintain a clean, professional blog without the complexity of a traditional CMS.

🚀 Quick Start

  1. Clone this repository to your computer
  2. Open your terminal and navigate to the project directory
  3. Install the required packages by running: npm install
  4. Start the blog by running: npm start
  5. Open your web browser and visit: http://localhost:3000

💡 What Makes This Blog Special?

This blog platform is built with modern technologies that make it both powerful and easy to use:

Core Technologies Explained

1. Node.js & Express

  • What is it? Node.js is a platform that lets you run JavaScript on your computer (not just in browsers). Express is a framework that makes it easy to create web applications with Node.js.
  • How we use it: Our blog uses Express to:
    • Handle web requests (when someone visits your blog)
    • Serve your blog posts
    • Manage routing (directing visitors to the right pages)

Example of how Express works in our code:

const express = require('express');
const app = express();

// When someone visits the homepage
app.get('/', (req, res) => {
    res.render('home');
});

2. Markdown

  • What is it? A simple way to write formatted text using plain text. Instead of buttons like in Microsoft Word, you use simple symbols:
    • # Title creates a heading
    • **bold** makes text bold
    • - item creates bullet points
  • How we use it: Write your blog posts in Markdown files (.md), and they automatically get converted to beautiful web pages.

Example of Markdown:

# My Blog Post Title

This is a **bold statement** about my blog.

## Key Points:
- First important point
- Second crucial idea

3. EJS (Embedded JavaScript)

  • What is it? A template system that lets us create dynamic HTML pages.
  • How we use it: We use EJS to:
    • Create consistent layouts across your blog
    • Show your blog posts in a beautiful format
    • Add dynamic content like dates and post lists

Example of EJS in action:

<h1><%= post.title %></h1>
<div class="content">
    <%- post.content %>
</div>

4. Highlight.js

  • What is it? A tool that makes code in your blog posts look pretty with syntax highlighting.
  • How we use it: When you include code in your blog posts, it automatically gets colored and formatted to be easily readable.

Example of code that will be highlighted:

def greet(name):
    return f"Hello, {name}!"

📁 Project Structure

Here's how the project is organized:

my-blog/
├── app.js          # The main application file
├── posts/          # Where your blog posts live (Markdown files)
├── public/         # Static files (CSS, images, etc.)
├── views/          # EJS templates for rendering pages
└── package.json    # Project configuration and dependencies

✍️ Writing Blog Posts

  1. Create a new .md file in the posts directory
  2. Add your content using Markdown
  3. The blog will automatically update with your new post

Example blog post (posts/hello-world.md):

# My First Blog Post

Welcome to my blog! This is my first post written in Markdown.

## What I'll Write About

- Tech tutorials
- Personal projects
- Interesting discoveries

🛠️ Advanced Features

  1. Syntax Highlighting: Code blocks in your posts are automatically highlighted
  2. Responsive Design: Your blog looks great on all devices
  3. Fast Loading: Built for performance
  4. Easy Customization: Simple to modify and make your own

🤔 Need Help?

  • Check if Node.js is installed: Run node --version in your terminal
  • Make sure all dependencies are installed: Run npm install
  • Check if the server is running: Look for the message "Server running on port 3000"
  • Make sure your Markdown files are in the posts directory

📝 License

This project is licensed under the ISC License - feel free to use it for your own blog!

About

source code for my blog

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors