Serverless Blog
This is apart of the autochat project!
This work is done by Yavko and open sourced under the GPL-3 licence!
This is a challenge submission but will be worked on even after and improved, this is like a early beta that I finished in 6 days
This is different because it uses the __notfound__
endpoint to handle everything allowing for an easier way to handle data and stuff. (no www/)
DISCLAIMER: This isn't for beginners, this is completly different than using pure html, nor does it run normal serverside code, this runs the code as a serverless function!
Built on
- Nunjucks for templating by far probably best templating language (makes it easy to make the blog your own!)
- Markdown-it for markdown rendering! (probably best one out there idk)
__NOTFOUND__
endpoint
- Yavko's unreadable code
How to use!
- add blog pages as json files in the blog directory
- add the name to the blog index in the data directory
- customize!
Making a blog page
I'll write a json scheme someday but not today I'm a busy man but here is how to write a blog! (gui WIP)
- make a file in the blogs directory and name it whatever you wan't
once you are in the editor for the file copy this example code inside
{
"author": "someone",
"title": "EXAMPLE",
"content": "EXAMPLE BLOG CONTENT"
}
Write your blog! Remember this supports markdown without html go all out! (no html support because im too lazy to implement xss protection)
Read extra info, there is important info there!
- No HTML I already said it and I'll say it again NO HTML if you wan't to enable it you are risking LOTS of security flaws but if you want to, read the Markdown-it docs!
- Code blocks work they are rendered with highlightjs but there isn't any syntax highlighting since you need to implement that yourself! (hint: hljs theme)
- Blogs go to https://
instance
-projectname
.username
.autocode.gg/blogname
! (newer versions will use /blogs/blogname
not done yet)
- Go edit the error and home page they are in the templates directory!
- Json is inline use
\n
for new lines!
lib/blogReturn.js
and lib/subSite.js
aren't used feel free to remove them, but they will be apart of the next url handling system!