Footer layout from internet.ee (Voog CMS), with lazy Rails.cache and YAML fallback in host apps.
| File | Role |
|---|---|
configuration.rb |
Site URL, API key, enabled flag, cache, locales |
fetcher.rb |
HTTP: Voog languages API + footer HTML per locale |
structure_parser.rb |
HTML → { highlight, columns, extras }; keys from each locale’s URL paths |
store.rb |
Cache key voog_footer; always loads all configured or API locales together |
structures = VoogFooter.structure
# => { "en" => { "highlight" => ..., "columns" => ..., "extras" => ... }, "et" => ... }
structure = structures[I18n.locale.to_s]
VoogFooter.snapshot(refresh: true)Column link entries include url, text, and key. Each locale gets its own keys from that locale’s URLs (path tail, mailto/tel, or social icon). Duplicate keys within one parse get a numeric suffix (faq_2). Map app footer slots to Voog keys in the host app (e.g. faq vs kkk for ET).
VoogFooter.structure["en"]["columns"].flat_map { |c| c["links"] }.map { |l| l["key"] }
VoogFooter.structure["et"]["columns"].flat_map { |c| c["links"] }.map { |l| l["key"] }VoogFooter.structure always returns a hash for every language code in scope:
config.localeswhen set (e.g.%w[en et]) — recommended for sites where only some locales have published pages.Fetcher#remote_languageswhenconfig.localesis unset — all codes from the Voog languages API (requiresapi_key).
VoogFooter.language_codes # same set the store usesvoog_site_url: "https://www.internet.ee"
voog_api_key: ""
voog_site_fetching_enabled: "false"
voog_footer_cache_ttl: "3600"VoogFooter.configure do |config|
config.enabled = true
config.cache_store = Rails.cache
config.locales = %w[en et]
endVoogFooter::Store.new.clear_cache! # all locales
VoogFooter::Store.new.clear_cache!("en") # drop one locale from blobbundle exec rspecdocker build -t voog_footer-gem .
docker run --rm voog_footer-gemMIT