wytch 0.1.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +17 -0
- data/README.md +23 -1
- data/exe/wytch +6 -0
- data/lib/wytch/builder.rb +75 -0
- data/lib/wytch/cli.rb +127 -0
- data/lib/wytch/content_loader.rb +54 -0
- data/lib/wytch/once.rb +40 -0
- data/lib/wytch/page.rb +136 -0
- data/lib/wytch/reload_coordinator.rb +68 -0
- data/lib/wytch/server.rb +93 -0
- data/lib/wytch/site.rb +97 -0
- data/lib/wytch/site_code_loader_middleware.rb +37 -0
- data/lib/wytch/templates/Gemfile.tt +12 -0
- data/lib/wytch/templates/config.rb.tt +6 -0
- data/lib/wytch/templates/content/feed.rb.tt +4 -0
- data/lib/wytch/templates/content/index.rb.tt +6 -0
- data/lib/wytch/templates/content/posts/hello-world.rb.tt +12 -0
- data/lib/wytch/templates/content/sitemap.rb.tt +4 -0
- data/lib/wytch/templates/frontend/Main.res.tt +2 -0
- data/lib/wytch/templates/frontend/main.css.tt +1 -0
- data/lib/wytch/templates/gitignore.tt +4 -0
- data/lib/wytch/templates/package.json.tt +19 -0
- data/lib/wytch/templates/public/robots.txt.tt +2 -0
- data/lib/wytch/templates/rescript.json.tt +18 -0
- data/lib/wytch/templates/src/site/feed_helper.rb.tt +17 -0
- data/lib/wytch/templates/src/site/feed_view.rb.tt +42 -0
- data/lib/wytch/templates/src/site/home_view.rb.tt +29 -0
- data/lib/wytch/templates/src/site/layout.rb.tt +34 -0
- data/lib/wytch/templates/src/site/page.rb.tt +9 -0
- data/lib/wytch/templates/src/site/post_helpers.rb.tt +18 -0
- data/lib/wytch/templates/src/site/post_view.rb.tt +21 -0
- data/lib/wytch/templates/src/site/sitemap_helper.rb.tt +17 -0
- data/lib/wytch/templates/src/site/sitemap_view.rb.tt +27 -0
- data/lib/wytch/templates/vite.config.js.tt +26 -0
- data/lib/wytch/version.rb +2 -1
- data/lib/wytch.rb +52 -2
- data/website/.gitignore +4 -0
- data/website/Gemfile +8 -0
- data/website/Gemfile.lock +63 -0
- data/website/assets/Main.res +2 -0
- data/website/assets/main.css +1 -0
- data/website/bin/generate_api_docs +44 -0
- data/website/config.rb +6 -0
- data/website/content/api/wytch/builder.rb +6 -0
- data/website/content/api/wytch/cli.rb +6 -0
- data/website/content/api/wytch/contentloader.rb +6 -0
- data/website/content/api/wytch/error.rb +6 -0
- data/website/content/api/wytch/once.rb +6 -0
- data/website/content/api/wytch/page.rb +6 -0
- data/website/content/api/wytch/reloadcoordinator.rb +6 -0
- data/website/content/api/wytch/server.rb +6 -0
- data/website/content/api/wytch/site.rb +6 -0
- data/website/content/api/wytch/sitecodeloadermiddleware.rb +6 -0
- data/website/content/index.rb +6 -0
- data/website/content/sitemap.rb +4 -0
- data/website/package.json +19 -0
- data/website/public/robots.txt +2 -0
- data/website/rescript.json +18 -0
- data/website/src/wytch_site/api_class_view.rb +90 -0
- data/website/src/wytch_site/home_view.rb +33 -0
- data/website/src/wytch_site/layout.rb +34 -0
- data/website/src/wytch_site/page.rb +18 -0
- data/website/src/wytch_site/sitemap_helper.rb +17 -0
- data/website/src/wytch_site/sitemap_view.rb +27 -0
- data/website/vite.config.js +26 -0
- metadata +164 -4
data/lib/wytch/site.rb
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Wytch
|
|
4
|
+
# Holds the configuration and state for a Wytch site.
|
|
5
|
+
#
|
|
6
|
+
# The Site class is the central configuration point for Wytch. It manages
|
|
7
|
+
# the content directory, site code loading, page class, and the collection
|
|
8
|
+
# of all pages.
|
|
9
|
+
#
|
|
10
|
+
# @example Configuring a site in config.rb
|
|
11
|
+
# Wytch.configure do |site|
|
|
12
|
+
# site.page_class = "MySite::Page"
|
|
13
|
+
# site.base_url = "https://example.com"
|
|
14
|
+
# site.content_dir = "pages" # default is "content"
|
|
15
|
+
# end
|
|
16
|
+
#
|
|
17
|
+
# @see Wytch.configure
|
|
18
|
+
class Site
|
|
19
|
+
# Loads the site configuration from config.rb in the current directory.
|
|
20
|
+
#
|
|
21
|
+
# @return [void]
|
|
22
|
+
def self.load!
|
|
23
|
+
if File.exist?(config_file = File.join(Dir.pwd, "config.rb"))
|
|
24
|
+
load config_file
|
|
25
|
+
else
|
|
26
|
+
puts "Warning: config.rb not found in current directory"
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# Creates a new Site with default configuration.
|
|
31
|
+
def initialize
|
|
32
|
+
@inflections = {}
|
|
33
|
+
@content_dir = "content"
|
|
34
|
+
@site_code_path = "src"
|
|
35
|
+
@page_class = "Wytch::Page"
|
|
36
|
+
@pages = {}
|
|
37
|
+
@base_url = nil
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# @return [Hash] custom inflections for Zeitwerk autoloading
|
|
41
|
+
attr_reader :inflections
|
|
42
|
+
|
|
43
|
+
# @!attribute content_dir
|
|
44
|
+
# @return [String] directory containing content files (default: "content")
|
|
45
|
+
# @!attribute site_code_path
|
|
46
|
+
# @return [String] directory containing site Ruby code (default: "src")
|
|
47
|
+
# @!attribute page_class
|
|
48
|
+
# @return [String] fully qualified class name for pages (default: "Wytch::Page")
|
|
49
|
+
# @!attribute pages
|
|
50
|
+
# @return [Hash{String => Page}] all loaded pages, keyed by path
|
|
51
|
+
# @!attribute base_url
|
|
52
|
+
# @return [String, nil] base URL for the site (used in sitemaps, feeds, etc.)
|
|
53
|
+
attr_accessor :content_dir, :site_code_path, :page_class, :pages, :base_url
|
|
54
|
+
|
|
55
|
+
# Adds custom inflections for Zeitwerk autoloading.
|
|
56
|
+
#
|
|
57
|
+
# @param inflections_hash [Hash{String => String}] mapping of file names to class names
|
|
58
|
+
# @return [void]
|
|
59
|
+
#
|
|
60
|
+
# @example
|
|
61
|
+
# site.inflect("api" => "API", "html_parser" => "HTMLParser")
|
|
62
|
+
def inflect(inflections_hash)
|
|
63
|
+
@inflections.merge!(inflections_hash)
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
# Returns the Zeitwerk loader for site code.
|
|
67
|
+
#
|
|
68
|
+
# The loader is configured to watch the site_code_path directory and
|
|
69
|
+
# supports hot reloading during development.
|
|
70
|
+
#
|
|
71
|
+
# @return [Zeitwerk::Loader] the configured loader
|
|
72
|
+
def site_code_loader
|
|
73
|
+
@site_code_loader ||= begin
|
|
74
|
+
loader = Zeitwerk::Loader.new
|
|
75
|
+
loader.push_dir @site_code_path if Dir.exist?(@site_code_path)
|
|
76
|
+
loader.enable_reloading
|
|
77
|
+
loader.inflector.inflect(@inflections) if @inflections.any?
|
|
78
|
+
loader.setup
|
|
79
|
+
loader
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
# Returns the content loader instance.
|
|
84
|
+
#
|
|
85
|
+
# @return [ContentLoader] the loader for content files
|
|
86
|
+
def content_loader
|
|
87
|
+
@content_loader ||= ContentLoader.new
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# Loads all content files and populates the pages hash.
|
|
91
|
+
#
|
|
92
|
+
# @return [Hash{String => Page}] all loaded pages
|
|
93
|
+
def load_content
|
|
94
|
+
@pages = content_loader.load_content
|
|
95
|
+
end
|
|
96
|
+
end
|
|
97
|
+
end
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Wytch
|
|
4
|
+
# Rack middleware that triggers hot reloading before each request.
|
|
5
|
+
#
|
|
6
|
+
# This middleware wraps the base application and coordinates with the
|
|
7
|
+
# ReloadCoordinator to ensure site code and content are reloaded when
|
|
8
|
+
# files change. It acquires a read lock during request processing to
|
|
9
|
+
# prevent reloads from interfering with rendering.
|
|
10
|
+
#
|
|
11
|
+
# @see Wytch::ReloadCoordinator
|
|
12
|
+
class SiteCodeLoaderMiddleware
|
|
13
|
+
# Creates a new middleware instance.
|
|
14
|
+
#
|
|
15
|
+
# @param app [#call] the Rack application to wrap
|
|
16
|
+
# @param coordinator [ReloadCoordinator] the reload coordinator
|
|
17
|
+
def initialize(app, coordinator)
|
|
18
|
+
@app = app
|
|
19
|
+
@coordinator = coordinator
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
# Handles a Rack request.
|
|
23
|
+
#
|
|
24
|
+
# Triggers a reload check, then processes the request while holding
|
|
25
|
+
# a read lock to prevent concurrent reloads.
|
|
26
|
+
#
|
|
27
|
+
# @param env [Hash] the Rack environment
|
|
28
|
+
# @return [Array] the Rack response tuple
|
|
29
|
+
def call(env)
|
|
30
|
+
@coordinator.reload!
|
|
31
|
+
|
|
32
|
+
@coordinator.reload_lock.with_read_lock {
|
|
33
|
+
@app.call(env)
|
|
34
|
+
}
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
source "https://rubygems.org"
|
|
4
|
+
|
|
5
|
+
<% if @local_wytch_path -%>
|
|
6
|
+
gem "wytch", path: "<%= @local_wytch_path %>"
|
|
7
|
+
<% else -%>
|
|
8
|
+
gem "wytch", "~> <%= Gem::Version.new(Wytch::VERSION).segments[0..1].join('.') %>"
|
|
9
|
+
<% end -%>
|
|
10
|
+
|
|
11
|
+
gem "builder", "~> 3.3"
|
|
12
|
+
gem "commonmarker", "~> 2.0"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import "tailwindcss";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "<%= @site_name %>",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"dev": "vite",
|
|
8
|
+
"build": "vite build"
|
|
9
|
+
},
|
|
10
|
+
"devDependencies": {
|
|
11
|
+
"@jihchi/vite-plugin-rescript": "^7.1.0",
|
|
12
|
+
"rescript": "^11.1.4",
|
|
13
|
+
"tailwindcss": "^4.1.0",
|
|
14
|
+
"vite": "^7.2.2"
|
|
15
|
+
},
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"@rescript/core": "^1.6.1"
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "<%= @site_name %>",
|
|
3
|
+
"sources": [
|
|
4
|
+
{
|
|
5
|
+
"dir": "assets",
|
|
6
|
+
"subdirs": true
|
|
7
|
+
}
|
|
8
|
+
],
|
|
9
|
+
"package-specs": [
|
|
10
|
+
{
|
|
11
|
+
"module": "esmodule",
|
|
12
|
+
"in-source": false
|
|
13
|
+
}
|
|
14
|
+
],
|
|
15
|
+
"suffix": ".res.js",
|
|
16
|
+
"bs-dependencies": ["@rescript/core"],
|
|
17
|
+
"bsc-flags": ["-open RescriptCore"]
|
|
18
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module <%= @site_module %>
|
|
4
|
+
class FeedView
|
|
5
|
+
def initialize(page)
|
|
6
|
+
@page = page
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
def call
|
|
10
|
+
require "builder"
|
|
11
|
+
|
|
12
|
+
xml = Builder::XmlMarkup.new(indent: 2)
|
|
13
|
+
xml.instruct! :xml, version: "1.0", encoding: "UTF-8"
|
|
14
|
+
xml.feed xmlns: "http://www.w3.org/2005/Atom" do
|
|
15
|
+
xml.title "Blog"
|
|
16
|
+
xml.link href: "#{Wytch.site.base_url}/feed.xml", rel: "self"
|
|
17
|
+
xml.link href: Wytch.site.base_url
|
|
18
|
+
xml.updated posts.first&.last_modified || Time.now.iso8601
|
|
19
|
+
xml.id Wytch.site.base_url
|
|
20
|
+
|
|
21
|
+
posts.each do |post|
|
|
22
|
+
xml.entry do
|
|
23
|
+
xml.title post.metadata[:title]
|
|
24
|
+
xml.link href: "#{Wytch.site.base_url}#{post.path}"
|
|
25
|
+
xml.id "#{Wytch.site.base_url}#{post.path}"
|
|
26
|
+
xml.updated post.last_modified || Time.now.iso8601
|
|
27
|
+
xml.content post.content_html, type: "html" if post.respond_to?(:content_html)
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
private
|
|
34
|
+
|
|
35
|
+
def posts
|
|
36
|
+
Wytch.site.pages.values
|
|
37
|
+
.select(&:blog_post?)
|
|
38
|
+
.sort_by { |p| p.last_modified || "" }
|
|
39
|
+
.reverse
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module <%= @site_module %>
|
|
4
|
+
class HomeView < Phlex::HTML
|
|
5
|
+
def initialize(page)
|
|
6
|
+
@page = page
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
def view_template
|
|
10
|
+
render Layout.new(@page) do
|
|
11
|
+
h1 { @page.metadata[:title] }
|
|
12
|
+
|
|
13
|
+
h2 { "Posts" }
|
|
14
|
+
|
|
15
|
+
ul do
|
|
16
|
+
posts.each do |post|
|
|
17
|
+
li { a(href: post.path) { post.metadata[:title] } }
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
private
|
|
24
|
+
|
|
25
|
+
def posts
|
|
26
|
+
Wytch.site.pages.values.select { |p| p.path.start_with?("/posts/") }
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module <%= @site_module %>
|
|
4
|
+
class Layout < Phlex::HTML
|
|
5
|
+
def initialize(page)
|
|
6
|
+
@page = page
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
def view_template(&block)
|
|
10
|
+
doctype
|
|
11
|
+
|
|
12
|
+
html do
|
|
13
|
+
head do
|
|
14
|
+
meta charset: "utf-8"
|
|
15
|
+
title { @page.metadata[:title] }
|
|
16
|
+
meta name: "description", content: @page.metadata[:description] if @page.metadata[:description]
|
|
17
|
+
meta name: "viewport", content: "width=device-width, initial-scale=1.0"
|
|
18
|
+
|
|
19
|
+
# Vite assets
|
|
20
|
+
if ENV["RACK_ENV"] == "development"
|
|
21
|
+
script src: "http://localhost:6970/@vite/client", type: "module"
|
|
22
|
+
link rel: "stylesheet", href: "http://localhost:6970/assets/main.css"
|
|
23
|
+
script src: "http://localhost:6970/assets/Main.res", type: "module"
|
|
24
|
+
else
|
|
25
|
+
link rel: "stylesheet", href: "/assets/main.css"
|
|
26
|
+
script src: "/assets/app.js", type: "module"
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
body(&block)
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module <%= @site_module %>
|
|
4
|
+
module PostHelpers
|
|
5
|
+
def blog_post?
|
|
6
|
+
true
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
def content_markdown(markdown)
|
|
10
|
+
@content_markdown = markdown
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def content_html
|
|
14
|
+
require "commonmarker"
|
|
15
|
+
Commonmarker.to_html(@content_markdown || "")
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module <%= @site_module %>
|
|
4
|
+
class PostView < Phlex::HTML
|
|
5
|
+
def initialize(page)
|
|
6
|
+
@page = page
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
def view_template
|
|
10
|
+
render Layout.new(@page) do
|
|
11
|
+
article do
|
|
12
|
+
h1 { @page.metadata[:title] }
|
|
13
|
+
|
|
14
|
+
unsafe_raw @page.content_html
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
a(href: "/") { "Back to home" }
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module <%= @site_module %>
|
|
4
|
+
class SitemapView
|
|
5
|
+
def initialize(page)
|
|
6
|
+
@page = page
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
def call
|
|
10
|
+
require "builder"
|
|
11
|
+
|
|
12
|
+
xml = Builder::XmlMarkup.new(indent: 2)
|
|
13
|
+
xml.instruct! :xml, version: "1.0", encoding: "UTF-8"
|
|
14
|
+
xml.urlset xmlns: "http://www.sitemaps.org/schemas/sitemap/0.9" do
|
|
15
|
+
Wytch.site.pages.values.each do |page|
|
|
16
|
+
next unless page.include_in_sitemap?
|
|
17
|
+
xml.url do
|
|
18
|
+
xml.loc "#{Wytch.site.base_url}#{page.path}"
|
|
19
|
+
xml.lastmod page.last_modified if page.last_modified
|
|
20
|
+
xml.changefreq page.change_frequency if page.change_frequency
|
|
21
|
+
xml.priority page.priority if page.priority
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { defineConfig } from "vite";
|
|
2
|
+
import createReScriptPlugin from "@jihchi/vite-plugin-rescript";
|
|
3
|
+
|
|
4
|
+
export default defineConfig({
|
|
5
|
+
plugins: [
|
|
6
|
+
createReScriptPlugin({
|
|
7
|
+
loader: {
|
|
8
|
+
suffix: ".res.js",
|
|
9
|
+
},
|
|
10
|
+
}),
|
|
11
|
+
],
|
|
12
|
+
build: {
|
|
13
|
+
outDir: "build/assets",
|
|
14
|
+
manifest: true,
|
|
15
|
+
rollupOptions: {
|
|
16
|
+
input: {
|
|
17
|
+
main: "./assets/main.css",
|
|
18
|
+
app: "./assets/Main.res",
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
server: {
|
|
23
|
+
port: 6970,
|
|
24
|
+
strictPort: false,
|
|
25
|
+
},
|
|
26
|
+
});
|
data/lib/wytch/version.rb
CHANGED
data/lib/wytch.rb
CHANGED
|
@@ -1,8 +1,58 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
require "zeitwerk"
|
|
4
|
+
require "phlex"
|
|
4
5
|
|
|
6
|
+
loader = Zeitwerk::Loader.for_gem
|
|
7
|
+
loader.inflector.inflect("cli" => "CLI")
|
|
8
|
+
loader.setup
|
|
9
|
+
|
|
10
|
+
# Wytch is a minimal static site generator that uses Ruby for content
|
|
11
|
+
# and Phlex for views.
|
|
12
|
+
#
|
|
13
|
+
# @example Basic configuration in config.rb
|
|
14
|
+
# Wytch.configure do |site|
|
|
15
|
+
# site.page_class = "MySite::Page"
|
|
16
|
+
# site.base_url = "https://example.com"
|
|
17
|
+
# end
|
|
18
|
+
#
|
|
19
|
+
# @see Wytch::Site
|
|
20
|
+
# @see Wytch::Page
|
|
5
21
|
module Wytch
|
|
22
|
+
# Base error class for all Wytch errors.
|
|
6
23
|
class Error < StandardError; end
|
|
7
|
-
|
|
24
|
+
|
|
25
|
+
class << self
|
|
26
|
+
# Returns the global site instance.
|
|
27
|
+
#
|
|
28
|
+
# @return [Wytch::Site] the current site configuration
|
|
29
|
+
def site
|
|
30
|
+
@site ||= Site.new
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Configures the global site instance.
|
|
34
|
+
#
|
|
35
|
+
# @yield [site] Configuration block
|
|
36
|
+
# @yieldparam site [Wytch::Site] the site instance to configure
|
|
37
|
+
# @return [Wytch::Site] the configured site
|
|
38
|
+
#
|
|
39
|
+
# @example
|
|
40
|
+
# Wytch.configure do |site|
|
|
41
|
+
# site.page_class = "MySite::Page"
|
|
42
|
+
# site.content_dir = "pages"
|
|
43
|
+
# end
|
|
44
|
+
def configure
|
|
45
|
+
yield(site) if block_given?
|
|
46
|
+
site
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# Resets the global site instance. Primarily used for testing.
|
|
50
|
+
#
|
|
51
|
+
# @return [void]
|
|
52
|
+
def reset_site!
|
|
53
|
+
@site = nil
|
|
54
|
+
end
|
|
55
|
+
end
|
|
8
56
|
end
|
|
57
|
+
|
|
58
|
+
loader.eager_load
|
data/website/.gitignore
ADDED
data/website/Gemfile
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
PATH
|
|
2
|
+
remote: ..
|
|
3
|
+
specs:
|
|
4
|
+
wytch (0.2.0)
|
|
5
|
+
concurrent-ruby (~> 1.3)
|
|
6
|
+
listen (~> 3.9)
|
|
7
|
+
phlex (~> 1.11)
|
|
8
|
+
puma (~> 6.4)
|
|
9
|
+
rack (~> 3.1)
|
|
10
|
+
thor (~> 1.4)
|
|
11
|
+
zeitwerk (~> 2.6)
|
|
12
|
+
|
|
13
|
+
GEM
|
|
14
|
+
remote: https://rubygems.org/
|
|
15
|
+
specs:
|
|
16
|
+
builder (3.3.0)
|
|
17
|
+
concurrent-ruby (1.3.5)
|
|
18
|
+
ffi (1.17.2)
|
|
19
|
+
ffi (1.17.2-aarch64-linux-gnu)
|
|
20
|
+
ffi (1.17.2-aarch64-linux-musl)
|
|
21
|
+
ffi (1.17.2-arm-linux-gnu)
|
|
22
|
+
ffi (1.17.2-arm-linux-musl)
|
|
23
|
+
ffi (1.17.2-arm64-darwin)
|
|
24
|
+
ffi (1.17.2-x86-linux-gnu)
|
|
25
|
+
ffi (1.17.2-x86-linux-musl)
|
|
26
|
+
ffi (1.17.2-x86_64-darwin)
|
|
27
|
+
ffi (1.17.2-x86_64-linux-gnu)
|
|
28
|
+
ffi (1.17.2-x86_64-linux-musl)
|
|
29
|
+
listen (3.9.0)
|
|
30
|
+
rb-fsevent (~> 0.10, >= 0.10.3)
|
|
31
|
+
rb-inotify (~> 0.9, >= 0.9.10)
|
|
32
|
+
nio4r (2.7.5)
|
|
33
|
+
phlex (1.11.0)
|
|
34
|
+
puma (6.6.1)
|
|
35
|
+
nio4r (~> 2.0)
|
|
36
|
+
rack (3.2.4)
|
|
37
|
+
rb-fsevent (0.11.2)
|
|
38
|
+
rb-inotify (0.11.1)
|
|
39
|
+
ffi (~> 1.0)
|
|
40
|
+
thor (1.4.0)
|
|
41
|
+
yard (0.9.38)
|
|
42
|
+
zeitwerk (2.7.3)
|
|
43
|
+
|
|
44
|
+
PLATFORMS
|
|
45
|
+
aarch64-linux-gnu
|
|
46
|
+
aarch64-linux-musl
|
|
47
|
+
arm-linux-gnu
|
|
48
|
+
arm-linux-musl
|
|
49
|
+
arm64-darwin
|
|
50
|
+
ruby
|
|
51
|
+
x86-linux-gnu
|
|
52
|
+
x86-linux-musl
|
|
53
|
+
x86_64-darwin
|
|
54
|
+
x86_64-linux-gnu
|
|
55
|
+
x86_64-linux-musl
|
|
56
|
+
|
|
57
|
+
DEPENDENCIES
|
|
58
|
+
builder (~> 3.3)
|
|
59
|
+
wytch!
|
|
60
|
+
yard (~> 0.9)
|
|
61
|
+
|
|
62
|
+
BUNDLED WITH
|
|
63
|
+
2.6.9
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import "tailwindcss";
|