5 ms·
Some time ago I asked myself the same question. Ideally I wanted not so much a generator but rather something that is completely self-contained. Essentially add
by axegon_ 6y ago
Some time ago I asked myself the same question. Ideally I wanted not so much a generator but rather something that is completely self-contained. Essentially add a markdown or html file, commit and move on. Surprisingly enough I couldn't find anything that does that so I ended up building one myself. Doesn't support syntax highlighting at the moment but I've considered looking into it. Perhaps I should open source it and see if someone wants to give a hand, who knows...
- deleted 6y ago[deleted]
- d13 6y agohttps://github.com/kittykatattack/thepoetrybook https://github.com/kittykatattack/thepoetrybook Did something like that years and years ago as a learning project. Works great! Drop in some markdown and you’re done. The source is only a few hundred lines; no build or package manager.
- cxr 6y ago> Ideally I wanted not so much a generator but rather something that is completely self-contained. Essentially add a markdown or html file, commit and move on. Could you explain what you mean here?
- axegon_ 6y agoAs I said, make it fully self-contained without relying on "builds" or any other mumbo-jumbo, the way you would with sphinx or hugo or whatever. Essentially add a new html or markdown file, put whatever you want in it, let's call it "something.md". Then add a link from your index page to "#/something.md" and not deal with builds or styling or whatever, simply commit and move on and have it take care of all the html. And in the case of markdown, parse it and render it as html on the client.
- retor 6y agoI searched for something similar. Considered Caddy and Nginx/Apache with markdown plugins, but wanted to be able to create and edit pages/files and made a small script with Flask instead.
- darrenf 6y agoDoes Algernon fit the bill? https://github.com/xyproto/algernon https://github.com/xyproto/algernon Quoting their README: Web server with built-in support for QUIC, HTTP/2, Lua, Markdown, Pongo2, HyperApp, Amber, Sass(SCSS), GCSS, JSX, BoltDB (built-in, stores the database in a file, like SQLite), Redis, PostgreSQL, MariaDB/MySQL, rate limiting, graceful shutdown, plugins, users and permissions. All in one small self-contained executable.
- deleted 6y ago[deleted]
- abdullahkhalids 6y agoPelican [1] works this way, and I love it for my blog/website. I write a post in markdown, commit and run a pelican-provided script that uploads the generated site to the hosting server. The script-running could be done with a hook. [1] https://blog.getpelican.com/ https://blog.getpelican.com/
- axegon_ 6y agoUm... No, it doesn't. > I write a post in markdown, commit and run a pelican-provided script that uploads the generated site to the hosting server. The script-running could be done with a hook. This is exactly what I don't want to deal with. Sure, I could use a ci service but this is a typical case of over-engineering a simple problem.
- rhn_mk1 6y agoSomething must turn the .md into HTML, and something must also publish it. You end up with 2 choices: the above one, or sth like GitLab pages, where you need to provide a CI script but then can just commit & push.
- axegon_ 6y agoYep, you're right, something must turn the markdown into an html. In my case, I let the browser do that and by doing so, I avoid the hassle around builds, cis which is what I didn't want to deal with. For something so brutally simple anyway.
- iamacyborg 6y agoI use Pelican with hosting on Netlify. On my end I write a new markdown post and push it to Github. At that point Netlify takes over to rebuild and redeploy my site including the new post. It's pretty trivial to do. https://github.com/jacquescorbytuech/Blog https://github.com/jacquescorbytuech/Blog https://www.jacquescorbytuech.com/ https://www.jacquescorbytuech.com/
- 6y ago
- cozzyd 6y agoSo you're talking about a static site generator implemented in javascript in the browser? I don't see why it wouldn't work as long as the webserver supported directory listings, but it would obviously completely break for clients not using javascript. The simplest solution I've used is to just have a Makefile that indexes and stitches together pages using cat/sed/ls. Sure, you have to run make (and possibly make upload if you're not doing it live), but it's not so bad.
- axegon_ 6y agoEssentially yes, this is what my personal site is currently running(though it is empty as it stands, largely due to time constraints). Except I wrote it in Dart because I abhor javascript with a passion, even if the final output is still javascript.
- cozzyd 6y agoYeah, I also am guilty of liking to write static site generators more than liking to actually write something!
- Terretta 6y agoPosted this deeper in thread, also noting up here: Just serve your markdown git repo using Caddy. https://caddyserver.com/docs/markdown https://caddyserver.com/docs/markdown ”Caddy is both a flexible, efficient static file server and a powerful, scalable reverse proxy. Use it to serve your static site with compression, template evaluation, Markdown rendering, and more.” https://caddyserver.com/ https://caddyserver.com/ Here’s a blog on doing this with the older version of Caddy: https://blog.thomaspuppe.de/static-sites-from-markdown-with-caddy-server https://blog.thomaspuppe.de/static-sites-from-markdown-with-... You get a lot of other “just works” goodness too.
- mholt 6y agoFYI our v1 site went away this week (we've had redirects for about 7 months now). Here's the link to the v2 docs for markdown rendering with templates: https://caddyserver.com/docs/modules/http.handlers.templates#markdown https://caddyserver.com/docs/modules/http.handlers.templates...
- Terretta 6y agoRedirects may have been wrong form? This was top link in Google and DDG for ‘caddy markdown’... but to your point, it didn’t respond. So I figured right page based off of the snippet and visited status. Right form of redirect should update the index, no longer show the old page.