Show HN: I built an open-source web hosting platform for static sites
217 points| symkat | 4 years ago |github.com | reply
I’m very excited to show you this project I have been working on, MarkdownSite.com.
For folks who interact with the website, it is a web hosting platform where you can add your repository and have a website built from the `public/` directory. Files in `site/` with an `.md` extension are rendered from markdown to HTML, and the website is then available at a random subdomain.
For folks that set up their own instance, it can also become a framework for customized building. The entire project is open source and I tried my best to document and explain the structure of the machines and how they interact in various mermaid graphs in the readme files under the `devops/` folder.
There is still a lot of work to be done, I hope that you find this useful. It's been super fun to work on!
[+] [-] HeckFeck|4 years ago|reply
I've actually been working on my own static website builder in Perl too - though it is nowhere near as sophisticated as a whole hosting platform. Being able to feed these beasts directories of text files, hitting enter and watching it do all the work (using your work) is a pleasure all on its own.
[+] [-] symkat|4 years ago|reply
[+] [-] blitzar|4 years ago|reply
Does it have a built in Under Construction banner, hit counter, country flags, scrolling text and all the other must have features?
[+] [-] jaza|4 years ago|reply
Funny timing: I just finished converting all my old sites to be statically generated, and deploying them all on Netlify, so that I don't have to pay for, or be the sysadmin of, a personal VPS anymore (after many years of doing just that). It's hard to argue the case for hosting anything much myself these days, when the alternative is free, zero-maintenance, and (thanks to CDNs) able to handle any load lightning-fast.
[+] [-] mro_name|4 years ago|reply
easy: Terms of service and other smallprint. And visitor surveillance.
[+] [-] jph|4 years ago|reply
[+] [-] symkat|4 years ago|reply
I have some examples on markdownsite.com in the middle, I’ll post them here as well, thank you for asking:
https://github.com/symkat/mds-example.markdownsite.net - A static website made from markdown files
https://github.com/symkat/hugo-example.markdownsite.net - A static website made with Hugo
https://github.com/symkat/os-example.markdownsite.net - A hand-rolled website with HTML/CSS
The websites for each can be seen at their respective domains:
https://mds-example.markdownsite.net/
https://hugo-example.markdownsite.net/
https://os-example.markdownsite.net/
I absolutely want to get the docs more cleaned up and make understanding how to get a site running something effectively communicated. Right now I have this https://markdownsite.com/docs explaining some stuff. Thanks again!
[+] [-] MathMonkeyMan|4 years ago|reply
[+] [-] symkat|4 years ago|reply
[+] [-] maxloh|4 years ago|reply
[+] [-] iRomain|4 years ago|reply
[+] [-] isaacimagine|4 years ago|reply
[0]: https://slightknack.dev/blog
[1]: https://github.com/slightknack/slightknack.dev/blob/master/....
[+] [-] jaimex2|4 years ago|reply
https://pages.github.com/
[+] [-] symkat|4 years ago|reply
If you’ve used and like GitHub Pages, and are just going to host a website as quickly as possible, it’s probably going to be the better option for you. GitHub can host the website, and GitHub Pages has better documentation and support than MarkdownSite does. MarkdownSite would likely be the bad choice right now for this. It launched literally last night, and I am hoping to get enough traffic and feedback from people playing with it so I can see where I can improve it.
If you want to run your own version of GitHub Pages, and host the website on virtual machines or bare metal servers in a data center, and to then provide that hosting to others, I don’t believe GitHub Pages has any self hosting option that I could see. If that’s true, MarkdownSite would be the better option in that situation.
On a personal note, it is perhaps an incredibly self-indulgent project in that I’ve always simply liked web hosting technology. I want to share that by creating and running a hosting platform myself, and to have the code and documentation and network diagrams out in the open for it so anyone else can run their own too.
I hope this helps explain some of the rational, thanks for checking it out!
[+] [-] andybak|4 years ago|reply
I can't see anything other than 404's. I tried /resources.html etc
EDIT - I think maybe it's expecting me to put everything in a site subdir. Which is very unclear from the docs. (and means I probably won't try it out as I was hoping I could use my docs repo "as is")
[+] [-] 13hunteo|4 years ago|reply
I haven't tested it, but a workaround could be making another repo, and using git submodules to put your docs repo in the site/ folder on this new repo.
[+] [-] 97-109-107|4 years ago|reply
I'm looking for streamlined alternatives to the following architecture (which works okay, but has too many separate parts):
[+] [-] JonM|4 years ago|reply
You can use it via cURL or github actions (https://github.com/marketplace/actions/gostatic-deploy), and there's a node-based CLI coming soon
e.g. curl https://www.gostaticapp.com/api/deploy/artifact \ -X POST \ -H "Accept: application/json" \ -H "Authorization: Bearer your-api-token" \ -F "[email protected]"
[+] [-] technobabbler|4 years ago|reply
[+] [-] fxtentacle|4 years ago|reply
[+] [-] nwithan8|4 years ago|reply
[+] [-] symkat|4 years ago|reply
I think what happened is you clicked “Build My Site!” without entering a git repository in the text input field.
Right now building sites isn’t private, and there is no authentication, so you could iterate the id numbers, and you could see build logs and from those pages. If a git repository has been used before, instead of building a new website, it brings you to the status panel to rebuild it and it is rebuilt on the same sub domain. That specific one — id 9, looks to be the first time someone clicked the build button without entering any repository, anyone else who does that would be redirected to that page.
[+] [-] adriangrigore|4 years ago|reply
Markdown was made for blog posts not for custom web pages.
P.S. Built my own static site generator https://mkws.sh but don't support Markdown out of the box, just plain HTML.
[+] [-] account42|4 years ago|reply
[+] [-] symkat|4 years ago|reply
For files in site/ that end in .md it does do rendering at the point of serving in some situations. Once it does, it both serves the file and spits out an .html file to serve for the next request. The way I thought about it is that the first request for the file generates it — like a mini hugo build or Jekyll build command running for just one path, and only running after a request has been made to it. This makes the compilation of the HTML just in time and saves processing for files that may never be rendered.
It does have draw backs, and could prove not to be the best path, and perhaps the preprocessing isn’t that big of a deal.
[+] [-] EgeAytin|4 years ago|reply
[+] [-] symkat|4 years ago|reply
The use for plain HTML is documented here: https://docs.markdownsite.com/static-site/
I hope this is helpful, thanks!
[+] [-] henriquez|4 years ago|reply
[+] [-] throwaway4837|4 years ago|reply
[+] [-] andybak|4 years ago|reply
[+] [-] unknown|4 years ago|reply
[deleted]
[+] [-] calltrak|4 years ago|reply
[deleted]