Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,4 @@ REVISION
# Brainstorming specs and implementation plans — working artifacts auto-generated
# per planning session. Curated documentation lives in docs/*.md instead.
/docs/superpowers/
/public/og-image.png
9 changes: 0 additions & 9 deletions app/controllers/og_images_controller.rb

This file was deleted.

2 changes: 1 addition & 1 deletion app/services/og_image_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def cached_path
private

def cache_file
Rails.root.join("tmp", "cache", "og", "og-image.png")
Rails.root.join("public", "og-image.png")
end

def valid_cache?
Expand Down
4 changes: 2 additions & 2 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<meta property="og:url" content="https://rectorspace.com<%= request.path %>">
<meta property="og:title" content="<%= content_for(:title) ? "#{content_for(:title)} • RECTOR" : "RECTOR • Building for Eternity" %>">
<meta property="og:description" content="<%= content_for(:meta_description) || "Full-stack builder. Hackathon hunter. #{achievements_summary}. Building for eternity." %>">
<meta property="og:image" content="<%= content_for(:og_image) || "https://rectorspace.com/og-image" %>">
<meta property="og:image" content="<%= content_for(:og_image) || "https://rectorspace.com/og-image.png" %>">
<meta property="og:site_name" content="RECTOR">

<%# Twitter Card meta tags %>
Expand All @@ -27,7 +27,7 @@
<meta name="twitter:creator" content="@RZ1989sol">
<meta name="twitter:title" content="<%= content_for(:title) ? "#{content_for(:title)} • RECTOR" : "RECTOR • Building for Eternity" %>">
<meta name="twitter:description" content="<%= content_for(:meta_description) || "Full-stack builder. Hackathon hunter. #{achievements_summary}. Building for eternity." %>">
<meta name="twitter:image" content="<%= content_for(:og_image) || "https://rectorspace.com/og-image" %>">
<meta name="twitter:image" content="<%= content_for(:og_image) || "https://rectorspace.com/og-image.png" %>">

<%= yield :head %>

Expand Down
10 changes: 10 additions & 0 deletions config/initializers/og_image_warmup.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# frozen_string_literal: true

# Regenerate public/og-image.png on app boot so social previews always
# reflect the latest achievements.yml. Wrapped in rescue so a missing
# ImageMagick install (e.g. on a fresh dev machine) doesn't crash boot.
Rails.application.config.after_initialize do
OgImageGenerator.cached_path
rescue => e
Rails.logger.warn "OG image warmup failed: #{e.class}: #{e.message}"
end
3 changes: 0 additions & 3 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
get "apply/arbital/modern", to: "apply#arbital_modern", as: :apply_arbital_modern
get "apply/superteam", to: "apply#superteam", as: :apply_superteam

# Dynamic OG image (auto-updates from achievements.yml)
get "og-image", to: "og_images#show", as: :og_image

# Health check
get "up" => "rails/health#show", as: :rails_health_check

Expand Down