a markdown-based webserver built with rust and estrogen
Find a file
Penelope Gwen fdc2023cfe readme
2026-03-10 21:51:29 -07:00
debian initial release and packaging 2026-03-10 21:43:14 -07:00
src update main.rs 2026-03-10 21:43:58 -07:00
.gitignore first commit 2026-02-12 01:01:22 -08:00
Cargo.lock update cargo files 2026-03-10 21:43:37 -07:00
Cargo.toml update cargo files 2026-03-10 21:43:37 -07:00
config.toml initial release and packaging 2026-03-10 21:43:14 -07:00
LICENSE.md initial release and packaging 2026-03-10 21:43:14 -07:00
readme.md readme 2026-03-10 21:51:29 -07:00

Markdown Webserver

The name is... pending

This is a webserver written in rust that provides several neat features:

  • a meager level of dynamic content without any javascript
  • a formatted curl output
  • structured predominantly with markdown

visit my website to see it in action

Usage

For a basic overview- basic server settings are configured in a config.toml file, which is searched for in two places: ~/.config/mdws/config.toml, then in /etc/mdws/config.toml. If it can't be found in either location, it uses the defaults below:

server_root = "/srv/mdws/root"
listen_port = 3030
bind_address = [127, 0, 0, 1]
server_domain = "127.0.0.1:3030"
  • every directory under server_root with the exception of /assets can be browsed, and will render any markdown files within it as 'markdown modules'.
    • content under /assets will be served as-is, making it a suitable place to store styling, images, templates, etc.
  • any browsable directory containing markdown files will be displayed in the sitemap in the sidebar, unless it contains a .secret file, in which case it will be hidden from the sidebar but can be manually linked or navigated to.
  • the sidebar is generated from .md files located in /assets/sidebar.
    • The dynamic image modules are semi-hard-coded (firm-coded?) at the moment, and I have plans to make that more malleable.
    • The sitemap is intentionally hard-coded, but will not be displayed unless there is a sitemap.md sidebar module that contains ${sitemap} somewhere in it.
      • note that the basename of server_root will be revealed in the sitemap- it uses the actual name of the directory on-disk
  • you should place a page.html at /assets/templates
    • this file is the skeleton of every page- it needs the following placeholders to determine where site content will be injected:
      • ${header}: a single <div> with a class and id of header in which the contents of header.md will be rendered
      • ${sidebar}: a collection <div>s, each with a class of markdown-module and an id of the markdown file's stem (basename without extension).
        • these markdown modules come from <server_root>/assets/sidebar
      • ${content}: a collection <div>s, each with a class of markdown-module and an id of the markdown file's stem (basename without extension).
        • these markdown modules come from <server_root> with the request path appended to the end
  • i totally forgot to implement a footer, woops
  • if a request leads to an invalid or nonexistent location, it is redirect to the server's root page

todo:

  • rss feeds

  • implement all client-side js modules from https://pogmom.me (i'm draining brendan of his life force so i can save the world from him)

  • generate sitemap in sidebar

  • detect if markdown module has associated directory (by file basename, maybe specified in frontmatter?)

  • so much more