Search Engine Optimization

Easily setup your app to rank high on google with search engine optimisation (SEO)

Basic Setup

LightningRails comes with a default SEO setup loaded in the initializers. To rank on your ideal keywords, visit the meta.yml file and modify the values:

# meta.yml
meta_product_name: "LightningRails"
meta_title: "LightningRails - The fastest way to kickstart your Rails app"
meta_description: "LightningRails is a Rails template that helps you kickstart your Rails app in minutes. It comes with a set of pre-configured tools and best practices to help you build your app faster."
meta_image: "cover.png" # should be in `app/assets/images/`
twitter_account: "@product_twitter_account"

These values will appear on every page by default, this is a great start but not ideal. We recommend leaving the default values on your homepage and overriding the variable manually on all the other pages with the following lines:

# Modify content to adapt to each page, for example with pricing.html.erb
<% content_for :meta_title, "No trick pricing on #{DEFAULT_META["meta_product_name"]}" %>
<% content_for :meta_description, "Get more for less, access our pro membership to build rails apps in seconds" %>
<% content_for :meta_image, "cover.png" %>

<h1>Pricing</h1>
[...]

Pro Tip: For show pages, add instance variables in the meta tags to have them tailored to each instance page. For example, if you have a car shop, interpolate "@car.name" in the meta_title so you start ranking with all the different car brand keywords with just one line! 🏎️

How to rank on Google

To start ranking on Google, create a search console account and submit the new links you wish to rank for. Make sure to link pages between each other for Google spiders to be able to crawl more effectively across your site, if done right, you will send traffic from some of your pages towards the main ones, the ones that transform and make money, it is called a Keyword tree 🌳

Pro Tip: Don't forget to add "skip_before_action :authenticate_user" to all the actions you wish to rank for. If the page is hidden behind an authentication wall google won't be able to access it and won't index it.

Last updated