diff --git a/app/assets/images/phone.jpg b/app/assets/images/phone.jpg index 1f5174a..cc036b6 100644 Binary files a/app/assets/images/phone.jpg and b/app/assets/images/phone.jpg differ diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 28c2bff..ffc6404 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -6,4 +6,8 @@ class ApplicationController < ActionController::Base def after_sign_in_path_for(resource) contacts_path end + + def default_url_options + { host: ENV["HOST"] || "localhost:3000" } + end end diff --git a/app/helpers/meta_tags_helper.rb b/app/helpers/meta_tags_helper.rb new file mode 100644 index 0000000..5353d9b --- /dev/null +++ b/app/helpers/meta_tags_helper.rb @@ -0,0 +1,15 @@ +module MetaTagsHelper + def meta_title + content_for?(:meta_title) ? content_for(:meta_title) : DEFAULT_META["meta_title"] + end + + def meta_description + content_for?(:meta_description) ? content_for(:meta_description) : DEFAULT_META["meta_description"] + end + + def meta_image + meta_image = (content_for?(:meta_image) ? content_for(:meta_image) : DEFAULT_META["meta_image"]) + # little twist to make it work equally with an asset or a url + meta_image.starts_with?("http") ? meta_image : image_url(meta_image) + end +end diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 99d6833..4a5ea09 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -3,12 +3,18 @@ - <%= favicon_link_tag 'favicon.ico' %> - Polyglot + <%= favicon_link_tag 'favicon.ico' %> + Polyglot - Live Translation <%= csrf_meta_tags %> <%= action_cable_meta_tag %> <%= stylesheet_link_tag 'application', media: 'all' %> <%#= stylesheet_pack_tag 'application', media: 'all' %> + + + + + + <%= render 'shared/navbar' unless params["action"] == "home" || params["action"] == "new" || params["action"] == "call" %> diff --git a/config/environments/production.rb b/config/environments/production.rb index 8043aab..9131614 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -30,7 +30,7 @@ Rails.application.configure do # config.assets.css_compressor = :sass # Do not fallback to assets pipeline if a precompiled asset is missed. - config.assets.compile = false + config.assets.compile = true # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb diff --git a/config/initializers/default_meta.rb b/config/initializers/default_meta.rb new file mode 100644 index 0000000..356f385 --- /dev/null +++ b/config/initializers/default_meta.rb @@ -0,0 +1 @@ +DEFAULT_META = YAML.load_file(Rails.root.join("config/meta.yml")) diff --git a/config/meta.yml b/config/meta.yml new file mode 100644 index 0000000..c781715 --- /dev/null +++ b/config/meta.yml @@ -0,0 +1,5 @@ +meta_product_name: "Product Name" +meta_title: "Polyglot - Live translation" +meta_description: "Translate your call live" +meta_image: "phone.jpg" # should exist in `app/assets/images/` +twitter_account: "@EthanFraenkel" # required for Twitter Cards diff --git a/public/404.html b/public/404.html index 2be3af2..0252968 100644 --- a/public/404.html +++ b/public/404.html @@ -1,67 +1,2 @@ - - - - The page you were looking for doesn't exist (404) - - - - - - -
-
-

The page you were looking for doesn't exist.

-

You may have mistyped the address or the page may have moved.

-
-

If you are the application owner check the logs for more information.

-
- - +

Error

+

Ethan, fix this

diff --git a/public/422.html b/public/422.html index c08eac0..0252968 100644 --- a/public/422.html +++ b/public/422.html @@ -1,67 +1,2 @@ - - - - The change you wanted was rejected (422) - - - - - - -
-
-

The change you wanted was rejected.

-

Maybe you tried to change something you didn't have access to.

-
-

If you are the application owner check the logs for more information.

-
- - +

Error

+

Ethan, fix this

diff --git a/public/500.html b/public/500.html index 78a030a..0252968 100644 --- a/public/500.html +++ b/public/500.html @@ -1,66 +1,2 @@ - - - - We're sorry, but something went wrong (500) - - - - - - -
-
-

We're sorry, but something went wrong.

-
-

If you are the application owner check the logs for more information.

-
- - +

Error

+

Ethan, fix this