Module: ProductshotaiSiteKit
- Defined in:
- lib/productshotai_site_kit.rb
Overview
Public URL helpers for ProductShot AI.
Constant Summary collapse
- BASE =
"https://productshotai.app"- BRAND =
"ProductShot AI"- DESCRIPTION =
"AI product photography generator for ecommerce sellers."
Class Method Summary collapse
- .about_url ⇒ Object
- .blog_url ⇒ Object
- .contact_url ⇒ Object
- .home_url ⇒ Object
- .localized_url(locale, path = "/") ⇒ Object
- .metadata ⇒ Object
- .page_url(path = "/") ⇒ Object
- .pricing_url ⇒ Object
- .privacy_url ⇒ Object
- .refund_policy_url ⇒ Object
- .terms_url ⇒ Object
- .workbench_url ⇒ Object
- .zh_home_url ⇒ Object
Class Method Details
.about_url ⇒ Object
41 |
# File 'lib/productshotai_site_kit.rb', line 41 def self.about_url = page_url("/about") |
.blog_url ⇒ Object
40 |
# File 'lib/productshotai_site_kit.rb', line 40 def self.blog_url = page_url("/blog") |
.contact_url ⇒ Object
42 |
# File 'lib/productshotai_site_kit.rb', line 42 def self.contact_url = page_url("/contact") |
.home_url ⇒ Object
37 |
# File 'lib/productshotai_site_kit.rb', line 37 def self.home_url = page_url("/") |
.localized_url(locale, path = "/") ⇒ Object
15 16 17 18 19 20 21 22 23 |
# File 'lib/productshotai_site_kit.rb', line 15 def self.localized_url(locale, path = "/") return page_url(path) if locale == "en" if ["zh", "zh-CN"].include?(locale) value = path.to_s.empty? ? "/" : path.to_s value = "/#{value}" unless value.start_with?("/") return page_url("/zh#{value == '/' ? '' : value}") end raise ArgumentError, "unsupported locale: #{locale}" end |
.metadata ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/productshotai_site_kit.rb', line 25 def self. { name: BRAND, homepage: BASE, description: DESCRIPTION, canonical_pages: { home: home_url, workbench: workbench_url, pricing: pricing_url, blog: blog_url, about: about_url, contact: contact_url, privacy: privacy_url, terms: terms_url, refund_policy: refund_policy_url, zh_home: zh_home_url }, tags: ["productshot", "ai-product-photography", "ecommerce-product-photos", "url-helpers"] } end |
.page_url(path = "/") ⇒ Object
8 9 10 11 12 13 |
# File 'lib/productshotai_site_kit.rb', line 8 def self.page_url(path = "/") value = path.to_s.empty? ? "/" : path.to_s value = "/#{value}" unless value.start_with?("/") clean = value == "/" ? "/" : "#{value.gsub(%r{/+$}, '')}/" "#{BASE}#{clean}" end |
.pricing_url ⇒ Object
39 |
# File 'lib/productshotai_site_kit.rb', line 39 def self.pricing_url = "#{BASE}/#pricing" |
.privacy_url ⇒ Object
43 |
# File 'lib/productshotai_site_kit.rb', line 43 def self.privacy_url = page_url("/privacy") |
.refund_policy_url ⇒ Object
45 |
# File 'lib/productshotai_site_kit.rb', line 45 def self.refund_policy_url = page_url("/refund-policy") |
.terms_url ⇒ Object
44 |
# File 'lib/productshotai_site_kit.rb', line 44 def self.terms_url = page_url("/terms") |
.workbench_url ⇒ Object
38 |
# File 'lib/productshotai_site_kit.rb', line 38 def self.workbench_url = "#{BASE}/#workbench" |
.zh_home_url ⇒ Object
46 |
# File 'lib/productshotai_site_kit.rb', line 46 def self.zh_home_url = localized_url("zh", "/") |