This project is a personal blog website built using Node.js. The website features a homepage displaying a list of blog posts, individual blog post pages, an About page, and a Contact page. The blog posts and styles are dynamically loaded.
- Dynamic homepage displaying a list of blog posts.
- Individual blog post pages.
- Static About and Contact pages.
- Separate CSS files for styling the homepage and individual blog posts.
-
Clone the repository:
git clone https://github.com/theNewtonCode/Personal-Blog-Website.git cd personal-blog-website
-
Install the required dependencies:
npm install
-
Create the necessary directories and files if they do not exist:
mkdir -p Backend static touch Backend/blogs.txt static/index_css.txt static/post_css.txt static/about.html static/contact.html
-
Populate
Backend/blogs.txt
with your blog posts in JSON format:{ "post1": { "title": "My First Blog Post", "time": "2024-07-28", "content": "This is the content of my first blog post." } }
-
Add your CSS styles to
static/index_css.txt
andstatic/post_css.txt
. -
Add content to
static/about.html
andstatic/contact.html
.
-
Start the server:
node server.js
-
Open your browser and navigate to
http://127.0.0.1:3000
.
Backend/
blogs.txt
: JSON file containing blog posts.
static/
index_css.txt
: CSS styles for the homepage.post_css.txt
: CSS styles for individual blog posts.about.html
: HTML content for the About page.contact.html
: HTML content for the Contact page.
server.js
: Main server file.
This project is licensed under the MIT License.