forked from snxraven/ravenscott-blog
3.2 KiB
3.2 KiB
Here is a README.md
file for your project:
# Raven Scott Blog Website
This repository contains the code for Raven Scott's blog website, where markdown files serve as blog posts, and visitors can browse through posts, learn more about Raven, and contact him directly.
## Project Structure
```bash
raven-scott-website
├── app.js # Main server-side logic using Express.js
├── markdown # Folder containing markdown files for blog posts
│ └── API Caching for Minecraft Servers.md
├── package-lock.json # Auto-generated package lock file
├── package.json # Dependencies and project metadata
├── public # Static files such as CSS, images
│ └── css
│ └── styles.css # Custom styles for the website
└── views # EJS template files for rendering HTML
├── about.ejs # 'About Me' page template
├── blog-post.ejs # Blog post page template
├── contact.ejs # Contact form page template
└── index.ejs # Homepage displaying recent blog posts
Features
- Markdown Blog Posts: Blog posts are written in Markdown, located in the
markdown
folder. The content is rendered with marked and supports code syntax highlighting using highlight.js. - Dynamic Blog Post Display: Each markdown file is dynamically converted into a blog post with a readable URL slug. The homepage shows the latest posts, and each post has its own dedicated page.
- Contact Form: Visitors can use the contact form to send inquiries directly. Messages are handled via
nodemailer
. - Responsive Design: The website uses Bootstrap to ensure a clean and responsive layout across devices.
- Professional Look and Feel: The custom CSS in
styles.css
provides a dark theme with accent colors for a professional, modern look.
Installation
-
Clone the repository:
git clone git@git.ssh.surf:snxraven/ravenscott-blog.git cd raven-scott-website
-
Install the dependencies:
npm install
-
Create a
.env
file to set up environment variables (e.g., for the email service usingnodemailer
):touch .env
Add the following:
PORT=3000
-
Run the project:
npm start
The server will run on http://localhost:3000.
Project Details
- Template Engine: EJS is used to render dynamic HTML views.
- Markdown Parsing: Blog posts are stored in the
markdown
folder, and the app converts them to HTML usingmarked
. - Code Highlighting: Any code snippets in the markdown files are automatically highlighted with
highlight.js
. - Routing:
/
: Displays the homepage with the latest blog posts./about
: About Me page where Raven shares his passions and interests./contact
: Contact page where visitors can submit inquiries./blog/:slug
: Dynamically generated blog post pages based on the markdown file.