diff --git a/.gitignore b/.gitignore index 576c7de..f14b919 100644 --- a/.gitignore +++ b/.gitignore @@ -40,5 +40,5 @@ /node_modules .byebug_history -public/ +public/uploads .yarn/cache diff --git a/Gemfile b/Gemfile index ef4975e..f8882e9 100644 --- a/Gemfile +++ b/Gemfile @@ -78,6 +78,9 @@ gem "stripe" # Markdown support gem "redcarpet" +# SEO +gem "meta-tags" + group :development, :test do # See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem gem "debug", platforms: %i[ mri mingw x64_mingw ] diff --git a/Gemfile.lock b/Gemfile.lock index 32bff38..e519d65 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -181,6 +181,8 @@ GEM net-smtp marcel (1.0.2) matrix (0.4.2) + meta-tags (2.19.0) + actionpack (>= 3.2.0, < 7.2) method_source (1.0.0) mini_magick (4.11.0) mini_mime (1.1.5) @@ -361,6 +363,7 @@ DEPENDENCIES image_processing (~> 1.8) jbuilder jsbundling-rails + meta-tags pagy (~> 6.0) pg (>= 0.18, < 2.0) pg_search diff --git a/app/views/channels/new.html.erb b/app/views/channels/new.html.erb index 0886bb1..ae5713e 100644 --- a/app/views/channels/new.html.erb +++ b/app/views/channels/new.html.erb @@ -27,3 +27,10 @@ %> <% end %> + +<% + set_meta_tags( + index: false, + follow: false + ) +%> diff --git a/app/views/chats/show.html.erb b/app/views/chats/show.html.erb index 10c6935..1b3dd5c 100644 --- a/app/views/chats/show.html.erb +++ b/app/views/chats/show.html.erb @@ -1,12 +1,13 @@ - <% if content_for? :page_title %> - <%= yield :page_title %> | Nomadstation - <% else %> - Nomadstation - <% end %> - + <% + # Looks like meta-tags gem doesn't play nice with a custom layout + # Just do it manually here + %> + Nomadstation | <%= @channel.present? ? "#{@channel.name} chat channel" : "Chat" %> + + <%= csrf_meta_tags %> <%= csp_meta_tag %> diff --git a/app/views/choose_plans/show.html.erb b/app/views/choose_plans/show.html.erb index acfb610..3e540fa 100644 --- a/app/views/choose_plans/show.html.erb +++ b/app/views/choose_plans/show.html.erb @@ -7,3 +7,11 @@ > + +<% + set_meta_tags( + title: "Choose your Nomadstation plan", + index: true, + follow: false + ) +%> diff --git a/app/views/devise/confirmations/new.html.erb b/app/views/devise/confirmations/new.html.erb index 20d75e1..977fa6a 100644 --- a/app/views/devise/confirmations/new.html.erb +++ b/app/views/devise/confirmations/new.html.erb @@ -31,3 +31,12 @@
+ +<% + set_meta_tags( + title: "Resend confirmation instructions", + description: "Lost your confirmation email? Fill out this form and we'll send you another.", + index: true, + follow: true + ) +%> diff --git a/app/views/devise/passwords/edit.html.erb b/app/views/devise/passwords/edit.html.erb index 0cc4885..c95bb23 100644 --- a/app/views/devise/passwords/edit.html.erb +++ b/app/views/devise/passwords/edit.html.erb @@ -40,3 +40,10 @@
+ +<% + set_meta_tags( + index: false, + follow: false + ) +%> diff --git a/app/views/devise/passwords/new.html.erb b/app/views/devise/passwords/new.html.erb index 4619344..90463ca 100644 --- a/app/views/devise/passwords/new.html.erb +++ b/app/views/devise/passwords/new.html.erb @@ -29,3 +29,12 @@
+ +<% + set_meta_tags( + title: "Forgot your password?", + description: "Forgot your password? Fill out this form and we'll send you an email to reset it.", + index: true, + follow: true + ) +%> diff --git a/app/views/devise/registrations/new.html.erb b/app/views/devise/registrations/new.html.erb index e407359..c0c2220 100644 --- a/app/views/devise/registrations/new.html.erb +++ b/app/views/devise/registrations/new.html.erb @@ -86,13 +86,22 @@
-
-
Your digital nomad community
+
+

Your digital nomad toolkit + community

- <%= render partial: "shared/joining_reasons" %> + <%= render partial: "devise/shared/joining_reasons" %>

+ +<% + set_meta_tags( + title: "Sign up for your Digital Nomad toolkit and community", + description: "An all-in-one toolkit and community for researching destinations, finding up-to-date tailored visa information and meeting other like minded individuals.", + index: true, + follow: true + ) +%> diff --git a/app/views/devise/sessions/new.html.erb b/app/views/devise/sessions/new.html.erb index b5d8611..fc00835 100644 --- a/app/views/devise/sessions/new.html.erb +++ b/app/views/devise/sessions/new.html.erb @@ -75,13 +75,13 @@
-
+
Haven't got an account?

That's okay! It takes a few quick minutes to sign up and join Nomadstation.

- <%= render partial: "shared/joining_reasons" %> + <%= render partial: "devise/shared/joining_reasons" %>

<%= link_to( "Join now!", @@ -93,3 +93,12 @@
+ +<% + set_meta_tags( + title: "Welcome back!", + description: "Sign back in to Nomadstation for your personalised Digital Nomad toolkit and community.", + index: true, + follow: true + ) +%> diff --git a/app/views/shared/_joining_reasons.html.erb b/app/views/devise/shared/_joining_reasons.html.erb similarity index 55% rename from app/views/shared/_joining_reasons.html.erb rename to app/views/devise/shared/_joining_reasons.html.erb index 02e79ce..a6fe370 100644 --- a/app/views/shared/_joining_reasons.html.erb +++ b/app/views/devise/shared/_joining_reasons.html.erb @@ -1,9 +1,9 @@ For just $8 a month, you'll get access to: We're a small but growing community. -Our aim is to build the Digital Nomad community in the world! +Our aim is to build the best Digital Nomad toolkit and community in the world. diff --git a/app/views/home/index.html.erb b/app/views/home/index.html.erb index 8071f1c..cf60890 100644 --- a/app/views/home/index.html.erb +++ b/app/views/home/index.html.erb @@ -20,3 +20,12 @@ } %>
+ +<% + set_meta_tags( + title: "A digital nomad toolkit and community", + description: "Whether you're researching your next Digital Nomad destination, wanting to make online or in person connections or figuring out which visas you're eligible for, Nomadstation provides everything you need as a modern traveller.", + index: true, + follow: true + ) +%> diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 5aaf565..524cd77 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -1,18 +1,18 @@ - <% if content_for? :page_title %> - <%= yield :page_title %> | Nomadstation - <% else %> - Nomadstation - <% end %> - + + + + <%= csrf_meta_tags %> <%= csp_meta_tag %> <%= stylesheet_link_tag "application", "data-turbo-track": "reload" %> <%= javascript_include_tag "application", "data-turbo-track": "reload", defer: true %> + + <%= display_meta_tags site: "Nomadstation" %> diff --git a/app/views/locations/edit.html.erb b/app/views/locations/edit.html.erb index 78db2b5..152565f 100644 --- a/app/views/locations/edit.html.erb +++ b/app/views/locations/edit.html.erb @@ -40,3 +40,10 @@ <% end %> <% end %> + +<% + set_meta_tags( + index: false, + follow: false + ) +%> diff --git a/app/views/locations/show.html.erb b/app/views/locations/show.html.erb index 22febb1..82bce75 100644 --- a/app/views/locations/show.html.erb +++ b/app/views/locations/show.html.erb @@ -1,7 +1,3 @@ -<% content_for :page_title do %> - <%= @location.name %>, <%= @location.country.name %> -<% end %> - <%= render partial: "locations/header", locals: { location: @location, @@ -141,3 +137,12 @@ + +<% + set_meta_tags( + title: "#{@location.name_utf8}, #{@location.country.name}", + description: helper_location_short_description(location: @location), + index: true, + follow: true + ) +%> diff --git a/app/views/profiles/show.html.erb b/app/views/profiles/show.html.erb index c17bf31..3a78c14 100644 --- a/app/views/profiles/show.html.erb +++ b/app/views/profiles/show.html.erb @@ -132,3 +132,12 @@ + +<% + set_meta_tags( + title: "Update your profile", + description: "Customise your Digital Nomad profile to get a tailored experience, made just for you.", + index: true, + follow: false + ) +%> diff --git a/app/views/reviews/edit.html.erb b/app/views/reviews/edit.html.erb index d9a68c5..56b8155 100644 --- a/app/views/reviews/edit.html.erb +++ b/app/views/reviews/edit.html.erb @@ -16,3 +16,12 @@ } %> + +<% + set_meta_tags( + title: "Update your review for #{@location.name_utf8}, #{@location.country.name}", + description: "Help others with their Digital Nomad adventures by reviewing #{@location.name_utf8}, #{@location.country.name}.", + index: true, + follow: true + ) +%> diff --git a/app/views/reviews/index.html.erb b/app/views/reviews/index.html.erb index 34c1242..e07587d 100644 --- a/app/views/reviews/index.html.erb +++ b/app/views/reviews/index.html.erb @@ -1,7 +1,3 @@ -<% content_for :page_title do %> - Reviews for <%= @location.name %>, <%= @location.country.name %> -<% end %> - <%= render partial: "locations/header", locals: { location: @location, @@ -40,3 +36,12 @@ <% end %> + +<% + set_meta_tags( + title: "Reviews for #{@location.name_utf8}, #{@location.country.name}", + description: "Still unsure about #{@location.name_utf8} as your next Digital Nomad experience? Find out what other experienced travellers think!", + index: true, + follow: true + ) +%> diff --git a/app/views/reviews/new.html.erb b/app/views/reviews/new.html.erb index d9a68c5..a5297ae 100644 --- a/app/views/reviews/new.html.erb +++ b/app/views/reviews/new.html.erb @@ -6,7 +6,7 @@ %>

- Review for <%= @location.name_utf8 %>, <%= @location.country.name %> + Reviewing <%= @location.name_utf8 %>, <%= @location.country.name %>

<%= render partial: "reviews/shared/form", @@ -16,3 +16,12 @@ } %> + +<% + set_meta_tags( + title: "Reviewing #{@location.name_utf8}, #{@location.country.name}", + description: "Help others with their Digital Nomad adventures by reviewing #{@location.name_utf8}, #{@location.country.name}.", + index: true, + follow: true + ) +%> diff --git a/app/views/reviews/show.html.erb b/app/views/reviews/show.html.erb index 3aedeff..f12cd46 100644 --- a/app/views/reviews/show.html.erb +++ b/app/views/reviews/show.html.erb @@ -1,7 +1,3 @@ -<% content_for :page_title do %> - Review for <%= @location.name %>, <%= @location.country.name %> - by <%= @review.user.display_name %> -<% end %> <%= render partial: "locations/header", locals: { @@ -59,3 +55,12 @@ <% end %> + +<% + set_meta_tags( + title: "Review for #{@location.name_utf8}, #{@location.country.name} by #{@review.user.display_name}", + description: "Unsure about #{@location.name_utf8} as your next Digital Nomad experience? Find out what #{@review.user.display_name} thinks about #{@location.name}", + index: true, + follow: true + ) +%> diff --git a/app/views/visa_information/edit.html.erb b/app/views/visa_information/edit.html.erb index f3d85bd..c703dd5 100644 --- a/app/views/visa_information/edit.html.erb +++ b/app/views/visa_information/edit.html.erb @@ -26,3 +26,10 @@ %> <% end %> + +<% + set_meta_tags( + index: false, + follow: false + ) +%> diff --git a/app/views/visa_information/show.html.erb b/app/views/visa_information/show.html.erb index ed770a9..1575002 100644 --- a/app/views/visa_information/show.html.erb +++ b/app/views/visa_information/show.html.erb @@ -1,7 +1,3 @@ -<% content_for :page_title do %> - <%= @location.name %>, <%= @location.country.name %> -<% end %> - <%= render partial: "locations/header", locals: { location: @location, @@ -104,3 +100,12 @@

<% end %> + +<% + set_meta_tags( + title: "Visa info for #{@location.name_utf8}, #{@location.country.name}", + description: "Up to date visa information for #{@location.name}, #{@location.country.name}, specially tailored for you!", + index: true, + follow: true + ) +%> diff --git a/app/views/visas/edit.html.erb b/app/views/visas/edit.html.erb index 962728a..8458571 100644 --- a/app/views/visas/edit.html.erb +++ b/app/views/visas/edit.html.erb @@ -90,3 +90,10 @@ %> + +<% + set_meta_tags( + index: false, + follow: false + ) +%> diff --git a/app/views/visas/new.html.erb b/app/views/visas/new.html.erb index 0157c1a..6705c03 100644 --- a/app/views/visas/new.html.erb +++ b/app/views/visas/new.html.erb @@ -28,3 +28,10 @@ <%= f.submit "Add visa", class: "btn btn-success" %> <% end %> + +<% + set_meta_tags( + index: false, + follow: false + ) +%> diff --git a/public/apple-touch-icon.png b/public/apple-touch-icon.png index e69de29..bb74339 100644 Binary files a/public/apple-touch-icon.png and b/public/apple-touch-icon.png differ diff --git a/public/favicon.ico b/public/favicon.ico index e69de29..14aa04c 100644 Binary files a/public/favicon.ico and b/public/favicon.ico differ diff --git a/public/favicon.svg b/public/favicon.svg new file mode 100644 index 0000000..1d2ce14 --- /dev/null +++ b/public/favicon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/spec/features/adding_a_location_review_spec.rb b/spec/features/adding_a_location_review_spec.rb index 0182984..e54fbd6 100644 --- a/spec/features/adding_a_location_review_spec.rb +++ b/spec/features/adding_a_location_review_spec.rb @@ -35,7 +35,7 @@ it "shows the 'Add review' form" do expect(page).to have_content( - "Review for #{location.name_utf8}, #{location.country.name}" + "Reviewing #{location.name_utf8}, #{location.country.name}" ) expect(page).to have_button("Finish") @@ -59,7 +59,7 @@ it "saves the review to the location" do # Redirected successfully expect(page).not_to have_content( - "Review for #{location.name_utf8}, #{location.country.name}" + "Reviewing #{location.name_utf8}, #{location.country.name}" ) expect(page).to have_content("Saved review") diff --git a/spec/features/auto_generating_a_location_review_spec.rb b/spec/features/auto_generating_a_location_review_spec.rb index 4c79b7b..1dddc14 100644 --- a/spec/features/auto_generating_a_location_review_spec.rb +++ b/spec/features/auto_generating_a_location_review_spec.rb @@ -38,7 +38,7 @@ it "shows the 'Add review' form with an 'Auto-generate review' button" do expect(page).to have_content( - "Review for #{location.name_utf8}, #{location.country.name}" + "Reviewing #{location.name_utf8}, #{location.country.name}" ) expect(page).to have_content("Auto-generate review")