Rename site to pages, inline the task
Assisted-by: Claude Opus 4.6 via pi
change xmlysmwwtnuulvvpoqsptowxnrsolppl
commit 2c40198d7ff2a412c50582643f66a0231cbe9e15
author Alpha Chen <alpha@kejadlen.dev>
date
parent kpuxtvvo
diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml
index fe32523..5b2e264 100644
--- a/.github/workflows/pages.yml
+++ b/.github/workflows/pages.yml
@@ -26,13 +26,13 @@ jobs:
         with:
           bundler-cache: true
 
-      - name: Generate site
-        run: bundle exec rake site
+      - name: Generate pages
+        run: bundle exec rake pages
 
       - name: Upload artifact
         uses: actions/upload-pages-artifact@v3
         with:
-          path: site
+          path: pages
 
   deploy:
     needs: build
diff --git a/Rakefile b/Rakefile
index 70aa70c..0dfac96 100644
--- a/Rakefile
+++ b/Rakefile
@@ -123,4 +123,28 @@ task :retranscribe, [:number] do |_t, args|
   Rake::Task[et.text_path].invoke
 end
 
-load File.expand_path("lib/tasks/site.rake", __dir__)
+PAGES_DIR = Pathname("pages")
+
+desc "Generate an HTML page of transcripts"
+task :pages do
+  require "cgi"
+  require "erb"
+
+  transcripts = EPISODE_TASKS
+    .select { |et| Pathname(et.text_path).exist? }
+    .map do |et|
+      {
+        number: et.number,
+        title: et.episode.title,
+        slug: et.slug,
+        text: File.read(et.text_path)
+      }
+    end
+
+  template = File.read(File.expand_path("lib/pages.html.erb", __dir__))
+  html = ERB.new(template).result(binding)
+
+  PAGES_DIR.mkpath
+  (PAGES_DIR / "index.html").write(html)
+  puts "Generated pages/index.html with #{transcripts.length} episodes."
+end
diff --git a/lib/site.html.erb b/lib/pages.html.erb
similarity index 100%
rename from lib/site.html.erb
rename to lib/pages.html.erb
diff --git a/lib/tasks/site.rake b/lib/tasks/site.rake
deleted file mode 100644
index c31a381..0000000
--- a/lib/tasks/site.rake
+++ /dev/null
@@ -1,25 +0,0 @@
-require "cgi"
-require "erb"
-
-SITE_DIR = Pathname("site")
-
-desc "Generate an HTML page of transcripts"
-task :site do
-  transcripts = EPISODE_TASKS
-    .select { |et| Pathname(et.text_path).exist? }
-    .map do |et|
-      {
-        number: et.number,
-        title: et.episode.title,
-        slug: et.slug,
-        text: File.read(et.text_path)
-      }
-    end
-
-  template = File.read(File.expand_path("../../site.html.erb", __FILE__))
-  html = ERB.new(template).result(binding)
-
-  SITE_DIR.mkpath
-  (SITE_DIR / "index.html").write(html)
-  puts "Generated site/index.html with #{transcripts.length} episodes."
-end