forked from snxraven/ravenscott-blog
79 lines
3.1 KiB
Markdown
79 lines
3.1 KiB
Markdown
|
```markdown
|
||
|
# 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](https://www.npmjs.com/package/marked) and supports code syntax highlighting using [highlight.js](https://highlightjs.org/).
|
||
|
- **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](https://getbootstrap.com/) 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
|
||
|
|
||
|
1. Clone the repository:
|
||
|
|
||
|
```bash
|
||
|
git clone git@git.ssh.surf:snxraven/ravenscott-blog.git
|
||
|
cd raven-scott-website
|
||
|
```
|
||
|
|
||
|
2. Install the dependencies:
|
||
|
|
||
|
```bash
|
||
|
npm install
|
||
|
```
|
||
|
|
||
|
3. Create a `.env` file to set up environment variables (e.g., for the email service using `nodemailer`):
|
||
|
|
||
|
```bash
|
||
|
touch .env
|
||
|
```
|
||
|
|
||
|
Add the following:
|
||
|
|
||
|
```
|
||
|
PORT=3000
|
||
|
```
|
||
|
|
||
|
4. Run the project:
|
||
|
|
||
|
```bash
|
||
|
npm start
|
||
|
```
|
||
|
|
||
|
The server will run on [http://localhost:3000](http://localhost:3000).
|
||
|
|
||
|
## Project Details
|
||
|
|
||
|
- **Template Engine**: [EJS](https://ejs.co/) is used to render dynamic HTML views.
|
||
|
- **Markdown Parsing**: Blog posts are stored in the `markdown` folder, and the app converts them to HTML using `marked`.
|
||
|
- **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.
|
||
|
|