--- /dev/null
+# Gemfile
+source "https://rubygems.org"
+
+ruby "3.3.8"
+
+gem "kramdown"
+gem "rss"
--- /dev/null
+GEM
+ remote: https://rubygems.org/
+ specs:
+ kramdown (2.5.1)
+ rexml (>= 3.3.9)
+ rexml (3.4.4)
+ rss (0.3.1)
+ rexml
+
+PLATFORMS
+ ruby
+ x86_64-linux
+
+DEPENDENCIES
+ kramdown
+ rss
+
+RUBY VERSION
+ ruby 3.3.8p144
+
+BUNDLED WITH
+ 2.7.2
--- /dev/null
+MIT License
+
+Copyright (c) 2024 Bradley Taunt
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
--- /dev/null
+build:
+ rm -rf build && mkdir build
+ ruby wruby.rb
+
+clean:
+ rm -rf build/*
+
+.PHONY: build clean
--- /dev/null
+# wruby
+
+* Minimal blog and static site generator built with Ruby
+* Licensed under [MIT](https://choosealicense.com/licenses/mit/)
+* The "w" is silent...
+
+## Setup
+
+1. `gem install bundler`
+2. `bundle install`
+
+## Getting Started
+
+Make your changes in the main configuration file `_config.yml` file (site URL, your name,
+etc.).
+
+* Blog posts go under the `posts` directory as markdown files
+* Posts need to be structured with an `h1` on the first line, a space on the second, and the date on the third line (ie. 2024-07-20)
+* Pages go under the `pages` directory as markdown files
+* Media (images, videos etc) go in the root `public` directory
+* Main styling is found in `public/style.css` (feel free to get creative!)
+
+## Defaults
+
+* The homepage only displays the first `5` posts. You can configure this in `_config.yml` under `post_count`.
+* The full blog post index will be generated at `yoursite.com/posts`
+* This means you need to have a `posts.md` file in your `pages` directory (or change `posts_index` the core `_config.yml`)
+* Your generated files can be compressed by default by setting the `compress_site` to `true`
+
+## Running
+
+1. `wruby` is based off of Ruby 3.3.0 (use `rbenv` or `rvm` to avoid privilege conflicts)
+2. Install bundler: `gem install bundler`
+3. Install gems: `bundle install`
+4. Run `make build` in the root directory
+5. Upload `build` folder to your server
+6. Share your blog or site!
\ No newline at end of file
--- /dev/null
+# Core site settings
+site_url: 'https://davidlandia.com'
+site_name: 'Davidlandia'
+author_name: 'David Jacquin'
+
+# Main directories
+directories:
+ posts: 'posts'
+ pages: 'pages'
+ public: 'public'
+ output: 'build'
+ posts_output: 'build/posts'
+ pages_output: 'build/'
+
+# File, index, RSS naming
+files:
+ header: '_includes/header.html'
+ footer: '_includes/footer.html'
+ root_index: 'index.md'
+ posts_index: 'pages/posts.md'
+ rss: 'build/index.rss'
+
+# Extras
+misc:
+ post_count: 5
+ compress_site: false
--- /dev/null
+</main>
+
+<footer role="contentinfo">
+ <ul id="menu">
+ <li><a href="/">Home</a></li>
+ <li><a href="/posts">Posts</a></li>
+ <li><a href="/about">About</a></li>
+ <li><a href="/index.rss">RSS</a></li>
+ <li><a href="#top">↑ Top of the page</a></li>
+ </ul>
+ <small>
+ Built with <a href="https://wruby.site">wruby</a>. <br>
+ Maintained with ♥ for the web. <br>
+ The content for this site is <a
+ href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>.<br>
+ </small>
+</footer>
--- /dev/null
+<!doctype html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+ <meta name="color-scheme" content="dark light">
+ <link rel="icon" href="data:,">
+ <title>{{TITLE}}</title>
+ <link href="/index.rss" type="application/rss+xml" rel="alternate" title="RSS feed for blog posts" />
+ <link rel="stylesheet" href="/public/style.css">
+</head>
+
+<body id="top">
+ <header>
+ <nav>
+ <ul>
+ <li><a href="/">home</a></li><li><a href="/about">about</a></li>
+ </ul>
+ </nav>
+ </header>
+ <main>
+
--- /dev/null
+# Davidlandia
+
+This is my website built with [Wruby](https://wruby.btxx.org/) (the ‘W’ is silent).
+
+## Features of 'Wruby'
+
+* Fast, OS-agnostic site generator
+* Auto-generated, valid [RSS feed](/index.rss)
+* Custom `header.html` and `footer.html` templates
+* Not much else (this is a *good* thing!)
+
+## Latest Posts
+
+[comment]: # (Your latest posts will be added here on build)
--- /dev/null
+# About
+
+Hello! My name is David and this is ***MY*** blog! I've never had a blog before, which is both exiting and provides many problems. Chief among them is what to do with it. Should it have cool features? If so what? What sort of stuff should I write about? How truthful should I be? It will likely be a while before I answer any of these questions, if I answer them at all. I'm usually a private person so I might never end up posting anything at all. But I would be remiss not to mention that I quite like the idea of writing a blog and of figuring out the infrastructure to sustain it.
--- /dev/null
+# All Posts
--- /dev/null
+# Baby's First Post
+
+2026-01-09
+
+This is the first post on this blog! What will be here in the future I cannot say but I hope it will be more good than bad.
--- /dev/null
+@import url("syntax.css");
+
+*{box-sizing:border-box;}
+
+body {
+ background: #f2f2f2;
+ font-family: Verdana, sans-serif;
+ line-height: 1.33;
+ margin: 0 auto;
+ max-width: 680px;
+ padding: 0 10px;
+ width: 100%;
+}
+
+header nav ul {
+ list-style: none;
+ margin: 10px 0 0 0;
+ padding: 0;
+}
+header nav ul li {
+ display: inline-block;
+ margin: 0 10px 10px 0;
+}
+header nav a {
+ background: white;
+ border: 1px solid black;
+ cursor: pointer;
+ display: block;
+ padding: 6px;
+}
+
+main {
+ background: white;
+ border: 1px solid;
+ margin: 0;
+ padding: 0 15px;
+}
+main p {
+ text-align: justify;
+}
+
+h1 {
+ border-bottom: 1px solid;
+ line-height: 1.25;
+ margin: 15px 0 0 0;
+}
+
+ul.posts {
+ list-style: none;
+ padding-left: 0;
+}
+ul.posts li a {
+ display: block;
+ margin-bottom: 15px;
+}
+
+h2{
+ border-bottom: 1px solid lightgrey;
+ font-size: 18px;
+ margin: 2rem 0 0;
+}
+
+h3 {
+ font-size: 16px;
+}
+
+dd {
+ margin-bottom: 10px;
+}
+dt:not(:has(a)) {
+ font-weight: 600;
+}
+
+img{height:auto;max-width:100%;}
+
+blockquote {
+ color: brown;
+ font-style: italic;
+}
+
+figure { margin: 2.5rem auto; }
+figure img { display: block; margin: 0 auto 10px; }
+figcaption { opacity: 0.7; text-align: center; }
+
+pre, p code, li code { font-size: 14px; }
+
+pre {
+ background: #f2f2f2;
+ padding: 6px;
+ overflow: auto;
+}
+pre:has(code.language-diagram) {
+ background: none;
+}
+
+table {
+ border-collapse: collapse;
+ margin: 2rem 0;
+ text-align: left;
+ width: 100%;
+}
+table caption {
+ background: #f2f2f2;
+ padding: 4px;
+}
+table tr {
+ border-bottom: 1px solid;
+}
+table td, table th {
+ padding: 4px;
+}
+
+footer {
+ padding: 0 10px;
+ margin: 1rem 0 2rem;
+}
+
+.footnotes {
+ font-size: 90%;
+ margin-top: 2rem;
+}
+
+.footer-nav h3 {
+ margin-bottom: 0;
+}
+.footer-nav ul {
+ list-style: none;
+ margin-top: 0;
+ padding: 0;
+}
+.footer-nav ul li {
+ display: inline-block;
+ margin-right: 8px;
+}
+
+.w-100 {
+ max-width: 100px;
+}
+
+@media(max-width: 620px) {
+ body {
+ padding: 10px;
+ }
+ header nav ul {
+ margin: 0;
+ }
+ .footer-nav {
+ display: block;
+ }
+}
+
+@media(prefers-color-scheme: dark) {
+ body {
+ background-color: black;
+ }
+ header nav a {
+ background: black;
+ border-color: white;
+ }
+ main {
+ background: #1d1d1d;
+ }
+ pre {
+ background: black;
+ }
+ blockquote {
+ color: lightgoldenrodyellow;
+ }
+ table caption {
+ background: black;
+ }
+}
--- /dev/null
+.highlight table td { padding: 5px; }
+.highlight table pre { margin: 0; }
+.highlight {
+ color: #FFFFFF;
+ background-color: #231529;
+}
+.highlight .c, .highlight .ch, .highlight .cd, .highlight .cm, .highlight .cpf, .highlight .c1, .highlight .cs {
+ color: #6D6E70;
+ font-style: italic;
+}
+.highlight .cp {
+ color: #41ff5b;
+ font-weight: bold;
+}
+.highlight .err {
+ color: #FFFFFF;
+ background-color: #CC0000;
+}
+.highlight .gr {
+ color: #FFFFFF;
+ background-color: #CC0000;
+}
+.highlight .k, .highlight .kd, .highlight .kv {
+ color: #FFF02A;
+ font-weight: bold;
+}
+.highlight .o, .highlight .ow {
+ color: #41ff5b;
+}
+.highlight .p, .highlight .pi {
+ color: #41ff5b;
+}
+.highlight .gd {
+ color: #CC0000;
+}
+.highlight .gi {
+ color: #3FB34F;
+}
+.highlight .ge {
+ font-style: italic;
+}
+.highlight .gs {
+ font-weight: bold;
+}
+.highlight .gt {
+ color: #FFFFFF;
+ background-color: #766DAF;
+}
+.highlight .gl {
+ color: #FFFFFF;
+ background-color: #766DAF;
+}
+.highlight .kc {
+ color: #9f93e6;
+ font-weight: bold;
+}
+.highlight .kn {
+ color: #FFFFFF;
+ font-weight: bold;
+}
+.highlight .kp {
+ color: #FFFFFF;
+ font-weight: bold;
+}
+.highlight .kr {
+ color: #FFFFFF;
+ font-weight: bold;
+}
+.highlight .gh {
+ color: #FFFFFF;
+ font-weight: bold;
+}
+.highlight .gu {
+ color: #FFFFFF;
+ font-weight: bold;
+}
+.highlight .kt {
+ color: #FAAF4C;
+ font-weight: bold;
+}
+.highlight .no {
+ color: #FAAF4C;
+ font-weight: bold;
+}
+.highlight .nc {
+ color: #FAAF4C;
+ font-weight: bold;
+}
+.highlight .nd {
+ color: #FAAF4C;
+ font-weight: bold;
+}
+.highlight .nn {
+ color: #FAAF4C;
+ font-weight: bold;
+}
+.highlight .bp {
+ color: #FAAF4C;
+ font-weight: bold;
+}
+.highlight .ne {
+ color: #FAAF4C;
+ font-weight: bold;
+}
+.highlight .nl {
+ color: #9f93e6;
+ font-weight: bold;
+}
+.highlight .nt {
+ color: #9f93e6;
+ font-weight: bold;
+}
+.highlight .m, .highlight .mb, .highlight .mf, .highlight .mh, .highlight .mi, .highlight .il, .highlight .mo, .highlight .mx {
+ color: #9f93e6;
+ font-weight: bold;
+}
+.highlight .ld {
+ color: #9f93e6;
+ font-weight: bold;
+}
+.highlight .ss {
+ color: #9f93e6;
+ font-weight: bold;
+}
+.highlight .s, .highlight .sa, .highlight .sb, .highlight .dl, .highlight .sd, .highlight .s2, .highlight .sh, .highlight .sx, .highlight .sr, .highlight .s1 {
+ color: #fff0a6;
+ font-weight: bold;
+}
+.highlight .se {
+ color: #FAAF4C;
+ font-weight: bold;
+}
+.highlight .sc {
+ color: #FAAF4C;
+ font-weight: bold;
+}
+.highlight .si {
+ color: #FAAF4C;
+ font-weight: bold;
+}
+.highlight .nb {
+ font-weight: bold;
+}
+.highlight .ni {
+ color: #999999;
+ font-weight: bold;
+}
+.highlight .w {
+ color: #BBBBBB;
+}
+.highlight .nf, .highlight .fm {
+ color: #41ff5b;
+}
+.highlight .py {
+ color: #41ff5b;
+}
+.highlight .na {
+ color: #41ff5b;
+}
+.highlight .nv, .highlight .vc, .highlight .vg, .highlight .vi, .highlight .vm {
+ color: #41ff5b;
+ font-weight: bold;
+}
--- /dev/null
+# Test
+
+2026-01-08
+
+CONTENT THUS IS CONTENT
--- /dev/null
+require 'kramdown'
+require 'fileutils'
+require 'date'
+require 'rss'
+require 'find'
+require 'yaml'
+
+# Load configuration
+config = YAML.load_file('_config.yml')
+
+site_url = config['site_url']
+site_name = config['site_name']
+author_name = config['author_name']
+
+posts_dir = config['directories']['posts']
+pages_dir = config['directories']['pages']
+public_dir = config['directories']['public']
+output_dir = config['directories']['output']
+posts_output_dir = config['directories']['posts_output']
+pages_output_dir = config['directories']['pages_output']
+
+header_file = config['files']['header']
+footer_file = config['files']['footer']
+root_index_file = config['files']['root_index']
+posts_index_file = config['files']['posts_index']
+rss_file = config['files']['rss']
+
+post_count = config['misc']['post_count']
+compress_site = config['misc']['compress_site']
+
+# Make sure output directories exist
+[output_dir, posts_output_dir, pages_output_dir].each { |dir| FileUtils.mkdir_p(dir) }
+
+# Read the footer content
+footer_content = File.read(footer_file)
+
+# Replace the title meta tag in the header.html
+def replace_title_placeholder(header_content, title)
+ header_content.gsub('<title>{{TITLE}}</title>', "<title>#{title}</title>")
+end
+
+# Grab the title from each markdown file
+def extract_title_from_md(lines)
+ first_line = lines.first
+ first_line&.start_with?('# ') ? first_line[2..-1].strip : 'Blog Index'
+end
+
+# Convert markdown files
+def process_markdown_files(input_directory, output_directory, header_content, footer_content)
+ items = Dir.glob("#{input_directory}/**/*.md").map do |path|
+ md_content = File.read(path)
+ lines = md_content.lines
+
+ title = extract_title_from_md(lines)
+ date = Date.parse(lines[2]&.strip || '') rescue Date.today
+ html_content = Kramdown::Document.new(md_content).to_html
+
+ relative_path = path.sub("#{input_directory}/", '').sub('.md', '')
+ item_dir = File.join(output_directory, relative_path)
+ output_file = File.join(item_dir, 'index.html')
+ FileUtils.mkdir_p(item_dir)
+
+ header = replace_title_placeholder(header_content, title)
+ File.write(output_file, header + html_content + footer_content)
+
+ { title: title, date: date, link: "#{relative_path}/", content: html_content }
+ end
+end
+
+# Create the root index file
+def generate_index(posts, header_content, footer_content, root_index_file, post_count, output_dir, posts_dir)
+ root_index_content = File.read(root_index_file)
+ root_title = extract_title_from_md(root_index_content.lines)
+ root_html = Kramdown::Document.new(root_index_content).to_html
+
+ header = replace_title_placeholder(header_content, root_title)
+
+ index_content = header + root_html + "<ul class=\"posts\">\n"
+ posts.first(post_count).each { |post| index_content << "<li><span>#{post[:date]}</span><a href='/#{posts_dir}/#{post[:link]}'>#{post[:title]}</a></li>\n" }
+ index_content << "</ul>\n" + footer_content
+
+ File.write("#{output_dir}/index.html", index_content)
+end
+
+# Create the full posts list page
+def generate_full_posts_list(posts, header_content, footer_content, posts_index_file, output_dir, posts_dir)
+ posts_index_content = File.read(posts_index_file)
+ posts_title = extract_title_from_md(posts_index_content.lines)
+ posts_html = Kramdown::Document.new(posts_index_content).to_html
+
+ header = replace_title_placeholder(header_content, posts_title)
+
+ list_content = header + posts_html + "<ul class=\"posts\">\n"
+ posts.each { |post| list_content << "<li><span>#{post[:date]}</span><a href='/#{posts_dir}/#{post[:link]}'>#{post[:title]}</a></li>\n" }
+ list_content << "</ul>\n" + footer_content
+
+ File.write("#{output_dir}/posts/index.html", list_content)
+end
+
+# Generate the RSS 2.0 feed
+def generate_rss(posts, rss_file, author_name, site_name, site_url, posts_dir)
+ rss = RSS::Maker.make("2.0") do |maker|
+ maker.channel.author = author_name
+ maker.channel.updated = Time.now.to_s
+ maker.channel.title = "#{site_name} RSS Feed"
+ maker.channel.description = "The official RSS Feed for #{site_url}"
+ maker.channel.link = site_url
+
+ posts.each do |post|
+ date = Date.parse(post[:date].to_s).to_time + 12*60*60 # Force time to midday
+ item_link = "#{site_url}/#{posts_dir}/#{post[:link]}"
+ item_title = post[:title]
+ item_content = post[:content]
+
+ maker.items.new_item do |item|
+ item.link = item_link
+ item.title = item_title
+ item.updated = date.to_s
+ item.pubDate = date.rfc822
+ item.description = item_content
+ end
+ end
+ end
+
+ File.write(rss_file, rss)
+end
+
+# Process header, posts, pages, etc.
+header_content = File.read(header_file)
+
+posts = process_markdown_files(posts_dir, posts_output_dir, header_content, footer_content).sort_by { |post| -post[:date].to_time.to_i }
+pages = process_markdown_files(pages_dir, pages_output_dir, header_content, footer_content)
+
+generate_index(posts, header_content, footer_content, root_index_file, post_count, output_dir, posts_dir)
+generate_full_posts_list(posts, header_content, footer_content, posts_index_file, output_dir, posts_dir)
+FileUtils.cp_r(public_dir, output_dir)
+generate_rss(posts, rss_file, author_name, site_name, site_url, posts_dir)
+system("find #{output_dir} -type f \\( -name '*.html' -o -name '*.css' \\) -exec gzip -k -f {} \\;") if compress_site == true
+
+puts "Blog built successfully in '#{output_dir}' folder. Have a great day!"