summaryrefslogtreecommitdiff
path: root/new/splash
diff options
context:
space:
mode:
authormms <git@sapka.me>2025-01-09 22:53:46 +0100
committermms <git@sapka.me>2025-01-09 22:53:46 +0100
commit27a14097e6705f6665e8fe5a7a4ca078799f3647 (patch)
treee6e7063071d8b369b829cb2461e9aa1ef84204e4 /new/splash
parentedb8b8b15c2c7963daa453b0fa1753aad37ee1f4 (diff)
feat: batch-yamlHEADmaster
Diffstat (limited to 'new/splash')
-rw-r--r--new/splash/assets/images/rss.gifbin0 -> 1032 bytes
-rwxr-xr-xnew/splash/bin/build.rb9
-rwxr-xr-xnew/splash/bin/server.rb2
-rw-r--r--new/splash/db/pages.yaml14
-rw-r--r--new/splash/lib/splash.rb2
-rw-r--r--new/splash/lib/splash/builder.rb4
-rw-r--r--new/splash/lib/splash/pages_db_manager.rb11
-rw-r--r--new/splash/lib/splash/server.rb8
-rw-r--r--new/splash/output/index.xml44
-rw-r--r--new/splash/output/rss.gifbin0 -> 1032 bytes
-rw-r--r--new/splash/pages/index.html.erb6
-rw-r--r--new/splash/pages/index.xml.rb1
12 files changed, 64 insertions, 37 deletions
diff --git a/new/splash/assets/images/rss.gif b/new/splash/assets/images/rss.gif
new file mode 100644
index 00000000..c5d3e159
--- /dev/null
+++ b/new/splash/assets/images/rss.gif
Binary files differ
diff --git a/new/splash/bin/build.rb b/new/splash/bin/build.rb
index 38b87f55..e5e27ab8 100755
--- a/new/splash/bin/build.rb
+++ b/new/splash/bin/build.rb
@@ -6,14 +6,15 @@ require_relative '../../bin/builder'
output_dir = "#{File.dirname(File.dirname(__FILE__))}/output"
image_dir = "#{File.dirname(File.dirname(File.expand_path(__FILE__)))}/assets/images"
-pages_db = Crys::Splash::PagesDbManager
+
+pages_db_path = "#{File.dirname(File.dirname(__FILE__))}/db/pages.yaml"
+pages_db_manager = Crys::PagesDbManager.new(db_path: pages_db_path)
file_path = @options[:filepath]
batch = file_path == :all
-builder = Crys::Splash::Builder.new(file_path: file_path, output_dir: output_dir, image_dir: image_dir)
-batch_builder = Crys::BatchBuilder.new(pages_db: pages_db, output_dir: output_dir, image_dir: image_dir,
- builder_class: Crys::Splash::Builder)
+builder = Crys::Splash::Builder.new(file_path: file_path, output_dir: output_dir, image_dir: image_dir, pages_db_manager: pages_db_manager)
+batch_builder = Crys::BatchBuilder.new(pages_db_manager: pages_db_manager, output_dir: output_dir, image_dir: image_dir, builder_class: Crys::Splash::Builder)
Crys::BuilderRunner.new(
builder: builder,
diff --git a/new/splash/bin/server.rb b/new/splash/bin/server.rb
index 15b34329..57e17a55 100755
--- a/new/splash/bin/server.rb
+++ b/new/splash/bin/server.rb
@@ -4,7 +4,7 @@
require_relative '../lib/splash'
require_relative '../../bin/server'
-server_class = Crys::Splash::Server
+server_class = Crys::Server
root = "#{File.dirname(File.dirname(__FILE__))}/output"
Crys::ServerRunner.new(root: root, server_class: server_class, section: 'Splash Page').serve
diff --git a/new/splash/db/pages.yaml b/new/splash/db/pages.yaml
index 16e15945..f3ba1acf 100644
--- a/new/splash/db/pages.yaml
+++ b/new/splash/db/pages.yaml
@@ -2,11 +2,15 @@
:pages:
d5d3594a0e43df11c58fad58073dc288:
:filename: index.html
- :file_path: "/home/mms/ghq/michal.sapka.me/mms/site/new/splash/pages/index.html.erb"
- :last_update: 2025-01-08 22:18:17.593730099 +01:00
+ :source: "/home/mms/ghq/michal.sapka.me/mms/site/new/splash/pages/index.html.erb"
+ :last_updated_at: 2025-01-09 22:24:10.142213213 +01:00
+ :created_at: 2025-01-09 21:18:46.957762756 +01:00
:in_rss: false
+ :in_all: false
b6bd1d5c7d2d3ea1d0db3032235af0bf:
:filename: index.xml
- :file_path: "/home/mms/ghq/michal.sapka.me/mms/site/new/splash/pages/index.xml.rb"
- :last_update: 2025-01-08 22:20:25.358750131 +01:00
- :in_rss: false
+ :source: "/home/mms/ghq/michal.sapka.me/mms/site/new/splash/pages/index.xml.rb"
+ :last_updated_at: 2025-01-09 22:21:29.688680427 +01:00
+ :created_at: 2025-01-09 21:22:45.333783298 +01:00
+ :in_rss: true
+ :in_all: true
diff --git a/new/splash/lib/splash.rb b/new/splash/lib/splash.rb
index cf354740..722bc305 100644
--- a/new/splash/lib/splash.rb
+++ b/new/splash/lib/splash.rb
@@ -2,9 +2,7 @@
require_relative '../../lib/crys'
-require_relative 'splash/server'
require_relative 'splash/builder'
-require_relative 'splash/pages_db_manager'
module Crys
module Splash
diff --git a/new/splash/lib/splash/builder.rb b/new/splash/lib/splash/builder.rb
index f886a0ec..68f8e83e 100644
--- a/new/splash/lib/splash/builder.rb
+++ b/new/splash/lib/splash/builder.rb
@@ -8,10 +8,6 @@ module Crys
def html_processor
Crys::Splash::SplashProcessor
end
-
- def pages_db_manager
- Crys::Splash::PagesDbManager.new
- end
end
end
end
diff --git a/new/splash/lib/splash/pages_db_manager.rb b/new/splash/lib/splash/pages_db_manager.rb
deleted file mode 100644
index 17658ea1..00000000
--- a/new/splash/lib/splash/pages_db_manager.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-# frozen_string_literal: true
-
-module Crys
- module Splash
- class PagesDbManager < Crys::PagesDbManager
- def db_path
- "#{File.dirname(File.dirname(File.dirname(__FILE__)))}/db/pages.yaml"
- end
- end
- end
-end
diff --git a/new/splash/lib/splash/server.rb b/new/splash/lib/splash/server.rb
deleted file mode 100644
index 688d7013..00000000
--- a/new/splash/lib/splash/server.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-# frozen_string_literal: true
-
-module Crys
- module Splash
- class Server < Crys::Server
- end
- end
-end
diff --git a/new/splash/output/index.xml b/new/splash/output/index.xml
index 8649916b..ea98567d 100644
--- a/new/splash/output/index.xml
+++ b/new/splash/output/index.xml
@@ -143,6 +143,28 @@ Moore created the great remake of &lt;em&gt;Battlestar Galactica&lt;/em&gt; and
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
&lt;li&gt;
2024-12-23
-
@@ -1233,6 +1255,28 @@ Somehow, after all those years, it is still &lt;em&gt;good enough&lt;/em&gt; for
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
&lt;li&gt;
2024-11-28
-
diff --git a/new/splash/output/rss.gif b/new/splash/output/rss.gif
new file mode 100644
index 00000000..c5d3e159
--- /dev/null
+++ b/new/splash/output/rss.gif
Binary files differ
diff --git a/new/splash/pages/index.html.erb b/new/splash/pages/index.html.erb
index 5614cb73..e35e151b 100644
--- a/new/splash/pages/index.html.erb
+++ b/new/splash/pages/index.html.erb
@@ -1,6 +1,5 @@
<!DOCTYPE html>
<html lang="en">
- TEST
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset="utf-8">
@@ -13,8 +12,10 @@
<meta property="og:description" content="Michal's personal website">
<meta name="fediverse:creator" content="@mms@bsd.cafe">
<link rel="me" href="https://mastodon.bsd.cafe/@mms" title="@mms on bsd.cafe">
+ <link rel="alternate" type="application/rss+xml" title="Feed with all updates" href="/index.xml">
<style>
body {
+
margin-top: 20px;
margin-bottom: 20px;
text-align: center;
@@ -49,7 +50,7 @@
<p>
Hi!
- I'm Michal and this is my personal website.
+ I'm MichaƂ and this is my personal website.
</p>
<p>
@@ -140,6 +141,7 @@
</ol>
</nav>
+ <a href="https://crys.site/index.xml"><img alt="RSS feed" width="36" height="14" src="<%= process_image(file: "rss.gif").relative_path %>"></a>
<hr>
<p>
diff --git a/new/splash/pages/index.xml.rb b/new/splash/pages/index.xml.rb
index 01edf785..73606d0b 100644
--- a/new/splash/pages/index.xml.rb
+++ b/new/splash/pages/index.xml.rb
@@ -27,3 +27,4 @@ module Crys
end
@rss = Crys::Splash::Page::IndexRss.new(processor: self)
+