Skip to content

Commit

Permalink
Merge pull request #8 from jahseng-lee/feature/basic-seo
Browse files Browse the repository at this point in the history
Feature/basic seo
  • Loading branch information
jahseng-lee authored Nov 29, 2023
2 parents a02e4c1 + 5c0854f commit 880c151
Show file tree
Hide file tree
Showing 30 changed files with 191 additions and 41 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,5 @@
/node_modules
.byebug_history

public/
public/uploads
.yarn/cache
3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 ]
Expand Down
3 changes: 3 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -361,6 +363,7 @@ DEPENDENCIES
image_processing (~> 1.8)
jbuilder
jsbundling-rails
meta-tags
pagy (~> 6.0)
pg (>= 0.18, < 2.0)
pg_search
Expand Down
7 changes: 7 additions & 0 deletions app/views/channels/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,10 @@
%>
<% end %>
</div>

<%
set_meta_tags(
index: false,
follow: false
)
%>
13 changes: 7 additions & 6 deletions app/views/chats/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<!DOCTYPE html>
<html>
<head>
<% if content_for? :page_title %>
<title><%= yield :page_title %> | Nomadstation</title>
<% else %>
<title>Nomadstation</title>
<% end %>

<%
# Looks like meta-tags gem doesn't play nice with a custom layout
# Just do it manually here
%>
<title>Nomadstation | <%= @channel.present? ? "#{@channel.name} chat channel" : "Chat" %></title>
<meta name="description" content='<%= @channel.present? ? "#{@channel.name} chat channel for our Digital Nomad community. Join in!" : "Meet others online and in your area in our well moderated community chat channels." %>'>
<meta name="robots" content="index, follow">
<meta name="viewport" content="width=device-width,initial-scale=1">
<%= csrf_meta_tags %>
<%= csp_meta_tag %>
Expand Down
8 changes: 8 additions & 0 deletions app/views/choose_plans/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,11 @@
>
</stripe-pricing-table>
</div>

<%
set_meta_tags(
title: "Choose your Nomadstation plan",
index: true,
follow: false
)
%>
9 changes: 9 additions & 0 deletions app/views/devise/confirmations/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,12 @@
<div class="col"></div>
</div>
</div>

<%
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
)
%>
7 changes: 7 additions & 0 deletions app/views/devise/passwords/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,10 @@
<div class="col"></div>
</div>
</div>

<%
set_meta_tags(
index: false,
follow: false
)
%>
9 changes: 9 additions & 0 deletions app/views/devise/passwords/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,12 @@
<div class="col"></div>
</div>
</div>

<%
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
)
%>
15 changes: 12 additions & 3 deletions app/views/devise/registrations/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,22 @@

<div class="col d-none d-md-block">
<div class="card">
<div class="card-body">
<h5 class="card-title">Your digital nomad community</h5>
<div class="card-body fs-5">
<h4 class="card-title">Your digital nomad toolkit + community</h4>
<p class="card-text">
<%= render partial: "shared/joining_reasons" %>
<%= render partial: "devise/shared/joining_reasons" %>
</p>
</div>
</div>
</div>
</div>
</div>

<%
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
)
%>
13 changes: 11 additions & 2 deletions app/views/devise/sessions/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,13 @@

<div class="col d-none d-md-block">
<div class="card">
<div class="card-body">
<div class="card-body fs-5">
<h5 class="card-title">Haven't got an account?</h5>
<p class="card-text">
That's okay! It takes a few quick minutes to sign up and join Nomadstation.
<br />
<br />
<%= render partial: "shared/joining_reasons" %>
<%= render partial: "devise/shared/joining_reasons" %>
</p>
<%= link_to(
"Join now!",
Expand All @@ -93,3 +93,12 @@
</div>
</div>
</div>

<%
set_meta_tags(
title: "Welcome back!",
description: "Sign back in to Nomadstation for your personalised Digital Nomad toolkit and community.",
index: true,
follow: true
)
%>
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
For just $8 a month, you'll get access to:
<ul>
<li>A fully moderated user chat</li>
<li>Visa information, travel information and more for the best nomad locations</li>
<li>Personalised visa information, travel recommendations and more for the best nomad locations</li>
<li>Guides, articles and blogs aimed at both seasoned and aspiring Digital Nomads</li>
<li>A fully moderated user chat</li>
<li>... and more!</li>
</ul>
We're a small but growing community.
Our aim is to build the <strong>Digital Nomad community in the world!</strong>
Our aim is to build the <strong>best Digital Nomad toolkit and community in the world.</strong>
9 changes: 9 additions & 0 deletions app/views/home/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,12 @@
}
%>
</div>

<%
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
)
%>
12 changes: 6 additions & 6 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<!DOCTYPE html>
<html>
<head>
<% if content_for? :page_title %>
<title><%= yield :page_title %> | Nomadstation</title>
<% else %>
<title>Nomadstation</title>
<% end %>

<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="icon" href="/favicon.ico" sizes="32x32">
<link rel="icon" href="/favicon.svg" type="image/svg+xml">
<link rel="apple-touch-icon" href="/apple-touch-icon.png">

<%= 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" %>
</head>

<body>
Expand Down
7 changes: 7 additions & 0 deletions app/views/locations/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,10 @@
<% end %>
<% end %>
</div>

<%
set_meta_tags(
index: false,
follow: false
)
%>
13 changes: 9 additions & 4 deletions app/views/locations/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
<% content_for :page_title do %>
<%= @location.name %>, <%= @location.country.name %>
<% end %>

<%= render partial: "locations/header",
locals: {
location: @location,
Expand Down Expand Up @@ -141,3 +137,12 @@
</div>
</div>
</div>

<%
set_meta_tags(
title: "#{@location.name_utf8}, #{@location.country.name}",
description: helper_location_short_description(location: @location),
index: true,
follow: true
)
%>
9 changes: 9 additions & 0 deletions app/views/profiles/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -132,3 +132,12 @@
</div>
</div>
</div>

<%
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
)
%>
9 changes: 9 additions & 0 deletions app/views/reviews/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,12 @@
}
%>
</div>

<%
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
)
%>
13 changes: 9 additions & 4 deletions app/views/reviews/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
<% content_for :page_title do %>
Reviews for <%= @location.name %>, <%= @location.country.name %>
<% end %>

<%= render partial: "locations/header",
locals: {
location: @location,
Expand Down Expand Up @@ -40,3 +36,12 @@
<% end %>
</div>
</div>

<%
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
)
%>
11 changes: 10 additions & 1 deletion app/views/reviews/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
%>

<h2>
Review for <%= @location.name_utf8 %>, <%= @location.country.name %>
Reviewing <%= @location.name_utf8 %>, <%= @location.country.name %>
</h2>

<%= render partial: "reviews/shared/form",
Expand All @@ -16,3 +16,12 @@
}
%>
</div>

<%
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
)
%>
13 changes: 9 additions & 4 deletions app/views/reviews/show.html.erb
Original file line number Diff line number Diff line change
@@ -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: {
Expand Down Expand Up @@ -59,3 +55,12 @@
<% end %>
</div>
</div>

<%
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
)
%>
7 changes: 7 additions & 0 deletions app/views/visa_information/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,10 @@
%>
<% end %>
</div>

<%
set_meta_tags(
index: false,
follow: false
)
%>
13 changes: 9 additions & 4 deletions app/views/visa_information/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
<% content_for :page_title do %>
<%= @location.name %>, <%= @location.country.name %>
<% end %>

<%= render partial: "locations/header",
locals: {
location: @location,
Expand Down Expand Up @@ -104,3 +100,12 @@
</p>
<% end %>
</div>

<%
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
)
%>
7 changes: 7 additions & 0 deletions app/views/visas/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,10 @@
%>
</div>
</div>

<%
set_meta_tags(
index: false,
follow: false
)
%>
7 changes: 7 additions & 0 deletions app/views/visas/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,10 @@
<%= f.submit "Add visa", class: "btn btn-success" %>
<% end %>
</div>

<%
set_meta_tags(
index: false,
follow: false
)
%>
Binary file modified public/apple-touch-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/favicon.ico
Binary file not shown.
1 change: 1 addition & 0 deletions public/favicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 880c151

Please sign in to comment.