Skip to content

Commit

Permalink
🎉 Init 1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
abcdan committed Sep 14, 2024
1 parent bc28081 commit 99df121
Show file tree
Hide file tree
Showing 14 changed files with 725 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.DS_Store
11 changes: 11 additions & 0 deletions .htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
RewriteEngine On

RewriteCond %{REQUEST_URI} ^/(assets|content)/ [NC]
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f
RewriteRule ^ - [L]

RewriteRule ^sitemap\.xml$ /generate_sitemap.php [L]

RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d
RewriteRule ^ /index.php [L]
95 changes: 93 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,93 @@
# md
Really simple themable blogging software for shared hosting
# md ✌️
Really simple, database-less themable blogging software for shared hosting

## What's this?
md is some _really_ simple blogging software that I wrote for my own use. It's designed to be as simple as possible, and to be able to run on shared hosting. It's written in PHP, and doesn't require a database.

Sounds great, right? Because it is! 😄

## Now, what does it do?
- It reads markdown files from a directory
- It parses the metadata at the top of the file
- It renders the markdown content
- It serves you the sweet, sweet blog post

And, it also:
- Makes it with some proper meta data, kinda SEO friendly
- Builds a sitemap.xml on the fly so you can submit it to search engines

## How do I use it?
- Clone this repository, or download the zip or use the template (which is the preferred way)
- Edit the `config.php` file to your liking
- Add your markdown files to the `articles` directory (you can make subdirectories, too!)
- Upload the whole thing to your shared hosting
- If you really want to be fancy, upate update the `/assets/css/theme.css` file to your liking so it looks like you want it to. Out of the box, it's _really_ basic, the goal is to make it truly yours.

That's it! You're ready to go! 🚀

## Supported Markdown
The following Markdown elements are supported and will be rendered to HTML:

### Headings
Use `#`, `##`, `###`, etc., for headings. For example:
```markdown
# This is an H1
## This is an H2
### This is an H3
```

### Bold and Italics
Wrap text in `**` or `__` for bold, and `*` or `_` for italics:
```markdown
**This is bold**
*This is italic*
```

### Links
To create a hyperlink, use `[text](url)` syntax:
```markdown
[Go to Google](https://www.google.com)
```

### Images
To embed images, use `![alt text](url)`:
```markdown
![Logo](https://example.com/logo.png)
```

### Lists
Both unordered and ordered lists are supported:
```markdown
- Item 1
- Item 2

1. First
2. Second
```

### Code Blocks
For inline code, wrap text in backticks:
```markdown
`inline code`
```
For code blocks, use triple backticks:
```markdown
```
Code block
```
```

### Blockquotes
Use `>` to create blockquotes:
```markdown
> This is a blockquote.
```

## What license you got?
MIT. Do whatever you want with it. Just don't blame me if it breaks. 😅

## Can I see it in action?
Sure thing, this is my personal blog: [https://abcdan.fyi](https://abcdan.fyi)

## What's the current version?
The current version is 1.0.0. It's the first version, so it's pretty basic. But at least it works! 🎉
19 changes: 19 additions & 0 deletions articles/hello-world.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
title: My First Blog Post
date: 2023-10-01
description: An introduction to my blog.
thumbnail: logo.png
tags: introduction, welcome
---

## Welcome to My Blog

This is the **content** of my first blog post.

![Logo](logo.png)


### Where do you start?
1. Just start writing.
2. Please retheme this site :P

It runs on [md](https://github.com/abcdan/md)
212 changes: 212 additions & 0 deletions assets/css/theme.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,212 @@
/* Import Fonts */
@import url("https://fonts.bunny.net/css2?family=Inter:wght@400;600;700&display=swap");

/**
*
* Welcome to the based theme called EST'24.
*
* Yes, it is very ugly. But the goal is: make it your own.
*
*/

/* General Reset */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}

/* Body and Container */
body {
font-family:
"Inter",
-apple-system,
BlinkMacSystemFont,
"Segoe UI",
Roboto,
Helvetica,
Arial,
sans-serif;
color: #333;
background-color: #f7f7f7;
line-height: 1.6;
font-size: 18px;
margin: 0;
padding: 0;
}

.container {
max-width: 900px;
margin: 40px auto; /* Center the blog */
padding: 0 20px;
background-color: #fff;
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1); /* Add subtle shadow */
border-radius: 8px;
padding: 40px;
}

/* Header */
.header {
text-align: center;
margin-bottom: 40px;
}

.site-title {
font-size: 48px;
font-weight: 700;
color: #222;
margin-bottom: 10px;
}

.site-description {
font-size: 20px;
color: #666;
margin-bottom: 20px;
}

/* Navigation (if needed) */
.nav {
text-align: center;
margin-bottom: 40px;
}

.nav a {
color: #1a73e8;
margin: 0 10px;
font-size: 16px;
text-decoration: none;
}

.nav a:hover {
text-decoration: underline;
}

/* Blog Article List */
.article-list {
list-style: none;
padding: 0;
}

.article-item {
margin-bottom: 40px;
padding-bottom: 20px;
border-bottom: 1px solid #e0e0e0;
}

.article-title {
font-size: 32px;
font-weight: 600;
margin-bottom: 10px;
color: #222;
}

.article-title a {
color: inherit;
text-decoration: none;
}

.article-title a:hover {
color: #1a73e8;
}

.article-description {
font-size: 18px;
color: #666;
margin-bottom: 10px;
}

.article-date {
font-size: 14px;
color: #999;
}

.article-thumbnail {
max-width: 100%;
height: auto;
margin-top: 20px;
border-radius: 8px;
}

/* Individual Article Page */
.article-content {
margin-bottom: 40px;
}

.article-heading {
font-size: 42px;
font-weight: 700;
margin-bottom: 20px;
color: #111;
}

.article-content p {
font-size: 20px;
margin-bottom: 20px;
color: #444;
}

.article-content h2,
.article-content h3,
.article-content h4 {
margin-top: 40px;
margin-bottom: 20px;
font-weight: 600;
color: #222;
}

.article-content ul,
.article-content ol {
margin-left: 20px;
margin-bottom: 20px;
}

.article-content blockquote {
margin: 40px 0;
padding: 20px;
background-color: #f1f1f1;
border-left: 4px solid #1a73e8;
font-style: italic;
color: #555;
}

.article-content pre {
background-color: #f4f4f4;
padding: 20px;
overflow-x: auto;
border-radius: 8px;
}

.article-content code {
background-color: #f4f4f4;
padding: 2px 4px;
border-radius: 4px;
}

/* Footer */
.footer {
text-align: center;
padding: 20px 0;
border-top: 1px solid #e0e0e0;
color: #999;
font-size: 14px;
margin-top: 40px;
}

/* Responsive Design */
@media (max-width: 768px) {
.container {
padding: 20px;
}

.site-title {
font-size: 36px;
}

.article-title {
font-size: 28px;
}

.article-heading {
font-size: 36px;
}
}
5 changes: 5 additions & 0 deletions assets/js/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
document.addEventListener("DOMContentLoaded", function () {
console.log("Hey! Welcome to my MD blog!");
console.log("Want to setup your own?");
console.log("https://github.com/abcdan/md");
});
16 changes: 16 additions & 0 deletions config.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php
$site_name = "My MD Blog";
$domain = "https://md.langezaal.io";
$description = "Welcome to my awesome blog!";

// Debug flag (true for development, false for production)
$debug = true;

if ($debug) {
error_reporting(E_ALL);
ini_set("display_errors", 1);
} else {
error_reporting(0);
ini_set("display_errors", 0);
}
?>
Binary file added content/favicon.ico
Binary file not shown.
Binary file added content/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 99df121

Please sign in to comment.