From c4d9c4aed95b052771973b0baf722aeadc99a3fe Mon Sep 17 00:00:00 2001
From: Vaidehi Joshi
Date: Mon, 22 Jun 2020 13:44:58 -0700
Subject: [PATCH] Remove trailing slashes from URLs to improve SEO (#8836)
[deploy]
---
app/controllers/page_views_controller.rb | 2 +-
.../__stories__/guidelines.stories.jsx | 17 ++++++++---------
.../__tests__/ListingDashboard.test.jsx | 6 +++---
.../listings/dashboard/listingRow.jsx | 2 +-
app/labor/markdown_parser.rb | 2 +-
app/models/site_config.rb | 2 +-
app/views/articles/index.html.erb | 4 ++--
app/views/articles/manage.html.erb | 2 +-
app/views/articles/tag_index.html.erb | 2 +-
app/views/internal/pages/_form.html.erb | 2 +-
app/views/pages/_coc_text.html.erb | 2 +-
.../pages/_editor_frontmatter_help.html.erb | 2 +-
app/views/pages/_editor_guide_text.html.erb | 4 ++--
app/views/pages/_editor_liquid_help.html.erb | 4 ++--
.../pages/_v1_editor_guide_preamble.html.erb | 2 +-
app/views/pages/generator.html.erb | 2 +-
app/views/pages/markdown_basics.html.erb | 2 +-
app/views/pages/privacy.html.erb | 2 +-
app/views/pages/rlyweb.html.erb | 2 +-
app/views/stories/_narrow_nav_menu.html.erb | 2 +-
app/views/users/_account.html.erb | 2 +-
app/views/users/_publishing_from_rss.html.erb | 2 +-
config/initializers/s3_direct_upload.rb | 2 +-
public/404.html | 2 +-
spec/factories/users.rb | 2 +-
spec/requests/page_views_spec.rb | 4 ++--
26 files changed, 39 insertions(+), 40 deletions(-)
diff --git a/app/controllers/page_views_controller.rb b/app/controllers/page_views_controller.rb
index 9f9185f35..abf04d97b 100644
--- a/app/controllers/page_views_controller.rb
+++ b/app/controllers/page_views_controller.rb
@@ -46,7 +46,7 @@ class PageViewsController < ApplicationMetalController
def update_organic_page_views
return if Rails.env.production? && rand(100) != 1 # We need to do this operation only once in a while.
- page_views_from_google_com = @article.page_views.where(referrer: "https://www.google.com/")
+ page_views_from_google_com = @article.page_views.where(referrer: "https://www.google.com")
organic_count = page_views_from_google_com.sum(:counts_for_number_of_views)
@article.update_column(:organic_page_views_count, organic_count) if organic_count > @article.organic_page_views_count
diff --git a/app/javascript/crayons/guidelines/__stories__/guidelines.stories.jsx b/app/javascript/crayons/guidelines/__stories__/guidelines.stories.jsx
index 46231d443..095e1d4f5 100644
--- a/app/javascript/crayons/guidelines/__stories__/guidelines.stories.jsx
+++ b/app/javascript/crayons/guidelines/__stories__/guidelines.stories.jsx
@@ -149,7 +149,7 @@ export const Components = () => (
templates (*.html.erb files). We also build out parts of or sometimes
complete views using
{' '}
- Preact
+ Preact
, typically for
the logged on user experience. For example, the main page feed.
@@ -161,7 +161,7 @@ export const Components = () => (
The entire design system uses the
{' '}
- BEM
+ BEM
{' '}
methodology for naming CSS
classes. Even Preact components under the hood use it.
@@ -179,15 +179,14 @@ export const Components = () => (
and what
IS NOT
{' '}
- a
- Crayons component. It's also practical because Crayons was
- implemented when we already had tons of other frontend classes in the
- codebase. It prevents overwriting styles by other CSS and it's very
- unlikely someone has ever created a
+ a Crayons component. It's also practical
+ because Crayons was implemented when we already had tons of other frontend
+ classes in the codebase. It prevents overwriting styles by other CSS and
+ it's very unlikely someone has ever created a
.crayons-btn
{' '}
- style BUT
- it's very likely someone has created
+ style BUT it's very likely someone has
+ created
.btn
{' '}
style...
diff --git a/app/javascript/listings/__tests__/ListingDashboard.test.jsx b/app/javascript/listings/__tests__/ListingDashboard.test.jsx
index a8bc80d32..d6c8e4f67 100644
--- a/app/javascript/listings/__tests__/ListingDashboard.test.jsx
+++ b/app/javascript/listings/__tests__/ListingDashboard.test.jsx
@@ -232,7 +232,7 @@ describe(' ', () => {
// listing category
const listing1CfpCategory = getByText('cfp', listing1GetByTextOptions);
- expect(listing1CfpCategory.getAttribute('href')).toEqual('/listings/cfp/');
+ expect(listing1CfpCategory.getAttribute('href')).toEqual('/listings/cfp');
// tags
const listing1ComputerScienceTag = getByText(
@@ -274,7 +274,7 @@ describe(' ', () => {
);
expect(listing2EventsCategory.getAttribute('href')).toEqual(
- '/listings/events/',
+ '/listings/events',
);
// tags
@@ -323,7 +323,7 @@ describe(' ', () => {
// listing category
const listing3CfpCategory = getByText('cfp', listing3GetByTextOptions);
- expect(listing3CfpCategory.getAttribute('href')).toEqual('/listings/cfp/');
+ expect(listing3CfpCategory.getAttribute('href')).toEqual('/listings/cfp');
// has no tags
diff --git a/app/javascript/listings/dashboard/listingRow.jsx b/app/javascript/listings/dashboard/listingRow.jsx
index cfb4330d4..852153325 100644
--- a/app/javascript/listings/dashboard/listingRow.jsx
+++ b/app/javascript/listings/dashboard/listingRow.jsx
@@ -45,7 +45,7 @@ export const ListingRow = ({ listing }) => {
{listingExpiry}
{listing.location && }
- {listing.category}
+ {listing.category}
Posts
- ">Feed
+ ">Feed
">Week
">Month
@@ -58,7 +58,7 @@
- selected<% end %>>Feed
+ selected<% end %>>Feed
selected<% end %>>Week
selected<% end %>>Month
selected<% end %>>Year
diff --git a/app/views/articles/manage.html.erb b/app/views/articles/manage.html.erb
index 3b411b6e8..8aa02f0c3 100644
--- a/app/views/articles/manage.html.erb
+++ b/app/views/articles/manage.html.erb
@@ -19,7 +19,7 @@
Make your own tweet about the post, describing personally why you wrote it or why people might find it useful. ">@<%= SiteConfig.social_media_handles["twitter"] %> may retweet you.
- Share to link aggregators such as Reddit . Try to choose the most topic-specific subreddits, such as /r/javascript instead of /r/programming . Warning: jerks and trolls may be lurking.
+ Share to link aggregators such as Reddit . Try to choose the most topic-specific subreddits, such as /r/javascript instead of /r/programming . Warning: jerks and trolls may be lurking.
Share with your co-workers or local communities. Ask people to leave questions for you in the comments. It's a great way to spark additional discussion.
diff --git a/app/views/articles/tag_index.html.erb b/app/views/articles/tag_index.html.erb
index 741603808..936877147 100644
--- a/app/views/articles/tag_index.html.erb
+++ b/app/views/articles/tag_index.html.erb
@@ -59,7 +59,7 @@
-
" href="<%= list_path %>/">
+ " href="<%= list_path %>">
FEED
diff --git a/app/views/internal/pages/_form.html.erb b/app/views/internal/pages/_form.html.erb
index e1223045d..897909f01 100644
--- a/app/views/internal/pages/_form.html.erb
+++ b/app/views/internal/pages/_form.html.erb
@@ -54,7 +54,7 @@
<%= link_to "Modify flag here", "/internal/feature_flags/features/#{@page.feature_flag_name}" %>
<% else %>
Everyone has access. Optionally guard access to this page by creating feature
<%= @page.feature_flag_name %>
- <%= link_to "here", "/internal/feature_flags/features/" %>
+ <%= link_to "here", "/internal/feature_flags/features" %>
<% end %>
diff --git a/app/views/pages/_coc_text.html.erb b/app/views/pages/_coc_text.html.erb
index 506ee66b9..77935c403 100644
--- a/app/views/pages/_coc_text.html.erb
+++ b/app/views/pages/_coc_text.html.erb
@@ -39,5 +39,5 @@
diff --git a/app/views/pages/_editor_frontmatter_help.html.erb b/app/views/pages/_editor_frontmatter_help.html.erb
index 2b4653b61..dd078cb79 100644
--- a/app/views/pages/_editor_frontmatter_help.html.erb
+++ b/app/views/pages/_editor_frontmatter_help.html.erb
@@ -6,7 +6,7 @@
- This editor is a markdown editor that uses Jekyll front matter .
+ This editor is a markdown editor that uses Jekyll front matter .
Most of the time, you can write inline HTML directly into your posts.
We support native Liquid tags and created some fun custom ones, too! Trying embedding a Tweet or GitHub issue in your post.
Links to unpublished posts are shareable for feedback/review.
diff --git a/app/views/pages/_editor_guide_text.html.erb b/app/views/pages/_editor_guide_text.html.erb
index bfe9d201e..537cc7f76 100644
--- a/app/views/pages/_editor_guide_text.html.erb
+++ b/app/views/pages/_editor_guide_text.html.erb
@@ -51,7 +51,7 @@
<!-- This won't show up in the content! -->
We support native
- Liquid tags in our editor, but have created our own custom tags listed below:
+ Liquid tags in our editor, but have created our own custom tags listed below:
<%= community_name %> Article/Post Embed
All you need is the full link of the article:
@@ -90,7 +90,7 @@
All you need is the Glitch project slug
{% glitch earthy-course %}
There are several
- optional attributes you can use in your tag, just add them after the id, separated by spaces.
+ optional attributes you can use in your tag, just add them after the id, separated by spaces.
app
diff --git a/app/views/pages/_editor_liquid_help.html.erb b/app/views/pages/_editor_liquid_help.html.erb
index 35f311bbd..fa45c6d47 100644
--- a/app/views/pages/_editor_liquid_help.html.erb
+++ b/app/views/pages/_editor_liquid_help.html.erb
@@ -1,7 +1,7 @@
-
We support native Liquid tags in our editor, but have created our own custom tags listed below:
+
We support native Liquid tags in our editor, but have created our own custom tags listed below:
<%= community_name %> Article/Post Embed
All you need is the full link of the article:
{% link https://dev.to/kazz/boost-your-productivity-using-markdown-1be %}
@@ -39,7 +39,7 @@
All you need is the Glitch project slug
{% glitch earthy-course %}
There are several
- optional attributes you can use in your tag, just add them after the id, separated by spaces.
+ optional attributes you can use in your tag, just add them after the id, separated by spaces.
app – Shows the app preview without the code.
diff --git a/app/views/pages/_v1_editor_guide_preamble.html.erb b/app/views/pages/_v1_editor_guide_preamble.html.erb
index 833f4dc38..2063cc500 100644
--- a/app/views/pages/_v1_editor_guide_preamble.html.erb
+++ b/app/views/pages/_v1_editor_guide_preamble.html.erb
@@ -1,7 +1,7 @@
Things to Know
- We use a markdown editor that uses Jekyll front matter .
+ We use a markdown editor that uses Jekyll front matter .
Most of the time, you can write inline HTML directly into your posts.
We support native Liquid tags and created some fun custom ones, too! Trying embedding a Tweet or GitHub issue in your post.
Links to unpublished posts are shareable for feedback/review.
diff --git a/app/views/pages/generator.html.erb b/app/views/pages/generator.html.erb
index b5f7e6398..805188301 100644
--- a/app/views/pages/generator.html.erb
+++ b/app/views/pages/generator.html.erb
@@ -49,7 +49,7 @@
Animal Codes
The animal images are from the
- USF ClipArt ETC project. They are used in this O RLY Cover Generator for the purposes of parody.
+ USF ClipArt ETC project. They are used in this O RLY Cover Generator for the purposes of parody.
<%= image_tag("1.png", alt: "grizzly bear") %>1
<%= image_tag("2.png", alt: "cat") %>2
diff --git a/app/views/pages/markdown_basics.html.erb b/app/views/pages/markdown_basics.html.erb
index 684a42919..0e051e8d1 100644
--- a/app/views/pages/markdown_basics.html.erb
+++ b/app/views/pages/markdown_basics.html.erb
@@ -41,7 +41,7 @@
Liquid Tags
We support native
- Liquid tags in our editor, but have created our own custom tags listed below:
+ Liquid tags in our editor, but have created our own custom tags listed below:
Twitter Embed
diff --git a/app/views/pages/privacy.html.erb b/app/views/pages/privacy.html.erb
index 2adee803a..136f88154 100644
--- a/app/views/pages/privacy.html.erb
+++ b/app/views/pages/privacy.html.erb
@@ -125,7 +125,7 @@
This allows user behavior to be tracked after they have been redirected to our website by clicking on a Facebook ad. This enables us to measure the effectiveness of Facebook ads. The data collected in this way is anonymous to us, i.e. we do not see the personal data of individual users. However, this data is stored and processed by Facebook, which is why we are informing you, based on our knowledge of the situation. Facebook may link this information to your Facebook account and also use it for its own promotional purposes, in accordance with
- Facebook’s Data Usage Policy . You can object to the collection of your data by Facebook pixel, or to the use of your data for the purpose of displaying Facebook ads by contacting the following address: https://www.facebook.com/settings?tab=ads.
+ Facebook’s Data Usage Policy . You can object to the collection of your data by Facebook pixel, or to the use of your data for the purpose of displaying Facebook ads by contacting the following address: https://www.facebook.com/settings?tab=ads.
Tracking & Cookies
diff --git a/app/views/pages/rlyweb.html.erb b/app/views/pages/rlyweb.html.erb
index 32f8fa95d..10286eb4e 100644
--- a/app/views/pages/rlyweb.html.erb
+++ b/app/views/pages/rlyweb.html.erb
@@ -61,7 +61,7 @@
Animal Codes
The animal images are from the
- USF ClipArt ETC project. They are used in this O RLY Cover Generator for the purposes of parody.
+ USF ClipArt ETC project. They are used in this O RLY Cover Generator for the purposes of parody.
<%= image_tag("1.png", alt: "grizzly bear") %>1
<%= image_tag("2.png", alt: "cat") %>2
diff --git a/app/views/stories/_narrow_nav_menu.html.erb b/app/views/stories/_narrow_nav_menu.html.erb
index 1e942a9f3..33a77028c 100644
--- a/app/views/stories/_narrow_nav_menu.html.erb
+++ b/app/views/stories/_narrow_nav_menu.html.erb
@@ -1,5 +1,5 @@