mirror of
https://github.com/indentlabs/notebook.git
synced 2025-10-26 11:19:22 +00:00
35 lines
1.1 KiB
Ruby
35 lines
1.1 KiB
Ruby
class ForumsLinkbuilderService < Service
|
|
def self.worldbuilding_url(page_type)
|
|
self.content_to_url_map.fetch(page_type.name.to_sym, nil)
|
|
end
|
|
|
|
def self.content_to_url_map
|
|
{
|
|
'Character': '/forum/characters-board',
|
|
'Condition': '/forum/conditions',
|
|
'Creature': '/forum/characters', # uh, wtf did I do here
|
|
'Flora': '/forum/flora',
|
|
'Government': '/forum/governments',
|
|
'Item': '/forum/items',
|
|
'Job': '/forum/jobs',
|
|
'Landmark': '/forum/landmarks',
|
|
'Language': '/forum/languages',
|
|
'Location': '/forum/locations',
|
|
'Lore': '/forum/lores',
|
|
'Magic': '/forum/magic',
|
|
'Planet': '/forum/planets',
|
|
'Race': '/forum/races',
|
|
'Religion': '/forum/religions',
|
|
'Technology': '/forum/technology',
|
|
'Tradition': '/forum/traditions',
|
|
'School': '/forum/schools',
|
|
'Sport': '/forum/sports',
|
|
'Food': '/forum/food'
|
|
}
|
|
end
|
|
|
|
def self.is_discussions_page?(url)
|
|
return url.start_with?('/forum/')
|
|
end
|
|
end
|