wytch 0.4.0 → 0.5.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 +4 -0
- data/lib/wytch/builder.rb +1 -21
- data/lib/wytch/cli.rb +0 -4
- data/lib/wytch/content_loader.rb +0 -10
- data/lib/wytch/server.rb +0 -3
- data/lib/wytch/version.rb +1 -1
- data/website/content/api/wytch/sitemapview.rb +6 -0
- data/website/package-lock.json +1442 -0
- metadata +3 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3adc6455846cef32252a24576fd40aafe237d26a688e131ee73a9c222827d0c6
|
|
4
|
+
data.tar.gz: 1409ff6165c88b35941cef1679c7fcd8f77d7e07950d7ec9601a504c89309a91
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: bfe7e1897b05b7017624a03b8659919383dde9f0aabc86f4e8afe86ea4835a092bc0c719be29a0f1b641de133702229aa9a07fa1b766f99bda2e091b5f20d699
|
|
7
|
+
data.tar.gz: 3c04f324a254bf565d47ac2039141ee596c3dc1f98f39c3c7001fa51bdbf90f968520a3e9ed9ee4a2274301ffcc9a07d732e44c1593f0eccf2af36aee082890c
|
data/CHANGELOG.md
CHANGED
data/lib/wytch/builder.rb
CHANGED
|
@@ -3,28 +3,15 @@
|
|
|
3
3
|
require "fileutils"
|
|
4
4
|
|
|
5
5
|
module Wytch
|
|
6
|
-
# Builds the static site
|
|
7
|
-
#
|
|
8
|
-
# The Builder is responsible for the production build process:
|
|
9
|
-
# 1. Loading site configuration and content
|
|
10
|
-
# 2. Rendering each page to HTML
|
|
11
|
-
# 3. Copying static files from public/
|
|
12
|
-
# 4. Integrating Vite-built assets
|
|
6
|
+
# Builds the static site.
|
|
13
7
|
#
|
|
14
8
|
# @example Building via CLI
|
|
15
9
|
# $ wytch build
|
|
16
|
-
#
|
|
17
|
-
# @example Building programmatically
|
|
18
|
-
# Wytch::Builder.new.build
|
|
19
10
|
class Builder
|
|
20
|
-
# @return [String] the output directory for built files
|
|
21
11
|
OUTPUT_DIR = "build"
|
|
22
12
|
|
|
23
13
|
# Builds the entire site.
|
|
24
14
|
#
|
|
25
|
-
# Sets RACK_ENV to "production", loads the site configuration,
|
|
26
|
-
# renders all pages to HTML files, and copies static assets.
|
|
27
|
-
#
|
|
28
15
|
# @return [void]
|
|
29
16
|
def build
|
|
30
17
|
ENV["RACK_ENV"] = "production"
|
|
@@ -51,19 +38,12 @@ module Wytch
|
|
|
51
38
|
|
|
52
39
|
private
|
|
53
40
|
|
|
54
|
-
# Copies files from public/ to the output directory.
|
|
55
|
-
#
|
|
56
|
-
# @return [void]
|
|
57
41
|
def copy_public_files
|
|
58
42
|
return unless Dir.exist?("public")
|
|
59
43
|
|
|
60
44
|
FileUtils.cp_r "public/.", OUTPUT_DIR, verbose: true
|
|
61
45
|
end
|
|
62
46
|
|
|
63
|
-
# Reports on Vite assets in the output directory.
|
|
64
|
-
# Vite builds directly to build/assets, so no copying is needed.
|
|
65
|
-
#
|
|
66
|
-
# @return [void]
|
|
67
47
|
def copy_vite_assets
|
|
68
48
|
vite_output = File.join(OUTPUT_DIR, "assets")
|
|
69
49
|
return unless Dir.exist?(vite_output)
|
data/lib/wytch/cli.rb
CHANGED
|
@@ -114,10 +114,6 @@ module Wytch
|
|
|
114
114
|
|
|
115
115
|
private
|
|
116
116
|
|
|
117
|
-
# Converts a snake_case name to PascalCase.
|
|
118
|
-
#
|
|
119
|
-
# @param name [String] the name to classify
|
|
120
|
-
# @return [String] the PascalCase version
|
|
121
117
|
def classify(name)
|
|
122
118
|
name.split("_").map(&:capitalize).join
|
|
123
119
|
end
|
data/lib/wytch/content_loader.rb
CHANGED
|
@@ -29,24 +29,14 @@ module Wytch
|
|
|
29
29
|
|
|
30
30
|
private
|
|
31
31
|
|
|
32
|
-
# Creates a Page instance from a content file.
|
|
33
|
-
#
|
|
34
|
-
# @param file_path [String] path to the content file, relative to content_dir
|
|
35
|
-
# @return [Page] the loaded page
|
|
36
32
|
def load_page(file_path)
|
|
37
33
|
page_class.new(file_path:)
|
|
38
34
|
end
|
|
39
35
|
|
|
40
|
-
# Returns the configured page class.
|
|
41
|
-
#
|
|
42
|
-
# @return [Class] the page class to instantiate
|
|
43
36
|
def page_class
|
|
44
37
|
Object.const_get(Wytch.site.page_class)
|
|
45
38
|
end
|
|
46
39
|
|
|
47
|
-
# Returns the content directory path.
|
|
48
|
-
#
|
|
49
|
-
# @return [String] the content directory
|
|
50
40
|
def content_dir
|
|
51
41
|
Wytch.site.content_dir
|
|
52
42
|
end
|
data/lib/wytch/server.rb
CHANGED
data/lib/wytch/version.rb
CHANGED