https://github.com/pdabrowski6/seo_sensei
Make your Rails application SEO-friendly
https://github.com/pdabrowski6/seo_sensei
ruby ruby-on-rails seo
Last synced: about 1 month ago
JSON representation
Make your Rails application SEO-friendly
- Host: GitHub
- URL: https://github.com/pdabrowski6/seo_sensei
- Owner: pdabrowski6
- License: mit
- Created: 2019-01-24T18:22:05.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-05-06T15:43:09.000Z (about 7 years ago)
- Last Synced: 2026-05-06T09:14:02.314Z (about 2 months ago)
- Topics: ruby, ruby-on-rails, seo
- Language: Ruby
- Homepage: https://pdabrowski.com
- Size: 37.1 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Seo Sensei
The Seo Sensei gem is a wrapper for [meta-tags](https://github.com/kpumuk/meta-tags) which allows to easily set meta tags inside your Rails application without extra configuration.
## Installation
gem install seo_sensei
## Usage
Update your layout and in the `head` section render meta tags:
```ruby
= display_meta_tags
```
Update your translations and create `seo` section for your controllers:
```yaml
en:
seo:
articles:
index:
title: 'This is articles page'
```
Make it happen in your controller:
```ruby
class ArticlesController < ApplicationController
enable_seo
def index
end
end
```
### Custom information
If you want to display unique title for your article you can do this using the following code:
```ruby
class ArticlesController < ApplicationController
def show
seo_tags_with(@article)
end
end
```
then update translations:
```yaml
en:
seo:
articles:
show:
title: 'This is article page - %{title}'
```
If you don't want to index given page, you can call `disable_seo`:
```ruby
class ArticlesController < ApplicationController
disable_seo
end
```
## TODO
* Make it easier to include assocation with soeable model in a Rails model
## Copyright
Copyright (c) 2019 Paweł Dąbrowski.
See [LICENSE][] for details.
[license]: LICENSE.md