Point the engine Explore action at the git repository
The engine pages' repo metadata (new in the wiki pages API) drives the Explore button and card title links, with the wiki page as fallback. The never-deployed /engines/:slug detail page and its store/api plumbing are gone, and the engines RSS feed links to the repos too.
This commit is contained in:
@@ -20,6 +20,7 @@ class Api::WikiController < ApiController
|
||||
property :locale, String, desc: "Locale code"
|
||||
property :route, String, desc: "URL slug"
|
||||
property :tags, Array, of: String, desc: "Tags"
|
||||
property :repo, String, desc: "Git repository URL (from page metadata, engines)"
|
||||
property :render, String, desc: "Rendered HTML content"
|
||||
property :content, String, desc: "Raw markdown content"
|
||||
end
|
||||
|
||||
@@ -62,9 +62,8 @@ class RssService
|
||||
|
||||
items.each do |page|
|
||||
maker.items.new_item do |item|
|
||||
slug = page["path"].to_s.split("/").last
|
||||
item.title = page["title"]
|
||||
item.link = "#{SITE_URL}/engines/#{slug}"
|
||||
item.link = page["repo"].presence || "#{WIKI_URL}/#{page["path"]}"
|
||||
item.description = page["description"].to_s
|
||||
item.pubDate = Time.parse(page["createdAt"]) rescue Time.current
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user