Blog Site Template
Blog Site
Welcome to the Blog Site! This project is built using SvelteKit and aims to provide a platform for sharing blogs on various topics. Below you will find information on how to use the site, as well as guidelines for contributing to the project.
Table of Contents
Usage
Prerequisites
Before you begin, ensure you have the following installed:
Installation
Clone the repository:
git clone https://github.com/Mic-360/blog-site.git cd blog-site
Install the dependencies:
npm install
Running the Development Server
To start the development server, run:
npm run dev
This will start the server at http://localhost:5173
. You can now open your browser and navigate to this URL to see the blog site in action.
Building for Production
To build the project for production, run:
npm run build
This will create an optimized build of the project in the build
directory.
Previewing the Production Build
To preview the production build, run:
npm run preview
This will start a local server to serve the production build at http://localhost:5174
.
Development
Project Structure
src/routes
: Contains the Svelte components for the different routes of the site.src/lib
: Contains utility functions and reusable components.static
: Contains static assets like images and icons.mdsvex.config.js
: Configuration for the mdsvex preprocessor.svelte.config.js
: Configuration for SvelteKit.vite.config.ts
: Configuration for Vite.
Adding a New Blog Post
Create a new Markdown file in the
src/articles
directory.Add the necessary frontmatter at the top of the file:
--- title: 'Your Blog Title' description: 'A brief description of your blog post.' date: 'YYYY-MM-DD' tags: ['tag1', 'tag2'] published: true thumbnail: '/path/to/thumbnail.jpg' ---
Write your blog content below the frontmatter.
Save the file and navigate to the development server to see your new blog post.
Contribution Guidelines
We welcome contributions from the community! To contribute, please follow these guidelines:
Reporting Issues
If you encounter any issues or bugs, please report them by creating a new issue in the GitHub Issues section.
Submitting Pull Requests
Fork the repository.
Create a new branch for your feature or bugfix:
git checkout -b feature/your-feature-name
Make your changes and commit them with a clear and concise message:
git commit -m "Add feature: your feature description"
Push your changes to your forked repository:
git push origin feature/your-feature-name
Open a pull request in the main repository, describing your changes and referencing any related issues.
Code Style
Please follow the existing code style and conventions used in the project. Ensure your code is well-documented and includes comments where necessary.
Testing
Before submitting a pull request, make sure to test your changes thoroughly. If applicable, add new tests to cover your changes.
Thank you for contributing to the Blog Site! If you have any questions or need further assistance, feel free to reach out. Happy coding!