radiant-trailing_slash_seo-extension 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README +3 -0
- data/Rakefile +1 -0
- data/lib/trailing_slash_seo.rb +15 -0
- data/radiant-trailing_slash_seo-extension.gemspec +32 -0
- data/trailing_slash_seo_extension.rb +11 -0
- metadata +48 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 626b9e4ff0d516c8afe4c1339f1f189e2ce054cb
|
4
|
+
data.tar.gz: cbb0b357a8858a1d47547ed493b62e0ddce70124
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 3626adc356b69eac5f042ab3e1ae432328e09ae7f27c26bed2b171d881b8baf6aea0ad543d4317ad64bc7548306c0be614afe4593f89b4c3bf656a0794bcd2d3
|
7
|
+
data.tar.gz: f7e7448dc8898b0107f430d2c7af3a41245006c2ef54fa5d29dd8d9893338cd3ce01509c42e2084cfcafea1953d83f71fc7084296954cfbf1cf8c23f2924da09
|
data/README
ADDED
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module TrailingSlashSeo
|
2
|
+
def self.included(base)
|
3
|
+
base.send :include, ClassMethods
|
4
|
+
base.class_eval do
|
5
|
+
alias_method_chain :process, :redirect
|
6
|
+
end
|
7
|
+
end
|
8
|
+
|
9
|
+
module ClassMethods
|
10
|
+
def process_with_redirect(request, response)
|
11
|
+
return response.redirect(self.url, 301) if !self.virtual? && request.path != self.url
|
12
|
+
process_without_redirect(request, response)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
## This is the rakegem gemspec template. Make sure you read and understand
|
2
|
+
## all of the comments. Some sections require modification, and others can
|
3
|
+
## be deleted if you don't need them. Once you understand the contents of
|
4
|
+
## this file, feel free to delete any comments that begin with two hash marks.
|
5
|
+
## You can find comprehensive Gem::Specification documentation, at
|
6
|
+
## http://docs.rubygems.org/read/chapter/20
|
7
|
+
Gem::Specification.new do |s|
|
8
|
+
## Leave these as is they will be modified for you by the rake gemspec task.
|
9
|
+
## If your rubyforge_project name is different, then edit it and comment out
|
10
|
+
## the sub! line in the Rakefile
|
11
|
+
s.name = 'radiant-trailing_slash_seo-extension'
|
12
|
+
s.version = '0.1.0'
|
13
|
+
|
14
|
+
## Make sure your summary is short. The description may be as long
|
15
|
+
## as you like.
|
16
|
+
s.summary = "Extension to handle trailing slashes for SEO."
|
17
|
+
s.description = "See README for full details on how to install, use, etc."
|
18
|
+
|
19
|
+
## List the primary authors. If there are a bunch of authors, it's probably
|
20
|
+
## better to set the email to an email list or something. If you don't have
|
21
|
+
## a custom homepage, consider using your GitHub URL or the like.
|
22
|
+
s.authors = ["mikz"]
|
23
|
+
s.email = 'support@travellink.com.au'
|
24
|
+
s.homepage = 'http://github.com/sealink/radiant-trailing_slash_seo-extension'
|
25
|
+
|
26
|
+
s.license = "MIT"
|
27
|
+
|
28
|
+
s.files = `git ls-files`.split($/)
|
29
|
+
s.executables = s.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
30
|
+
s.test_files = s.files.grep(%r{^(test|spec|features)/})
|
31
|
+
s.require_paths = ["lib"]
|
32
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
require_dependency "#{File.expand_path(File.dirname(__FILE__))}/lib/trailing_slash_seo"
|
2
|
+
|
3
|
+
class TrailingSlashSeoExtension < Radiant::Extension
|
4
|
+
version "1.0"
|
5
|
+
description "Redirects Page urls without slash to version with slash to do some SEO"
|
6
|
+
url "http://github.com/mikz/radiant-trailing-slash-seo"
|
7
|
+
|
8
|
+
def activate
|
9
|
+
Page.send :include, TrailingSlashSeo
|
10
|
+
end
|
11
|
+
end
|
metadata
ADDED
@@ -0,0 +1,48 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: radiant-trailing_slash_seo-extension
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- mikz
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2017-08-21 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: See README for full details on how to install, use, etc.
|
14
|
+
email: support@travellink.com.au
|
15
|
+
executables: []
|
16
|
+
extensions: []
|
17
|
+
extra_rdoc_files: []
|
18
|
+
files:
|
19
|
+
- README
|
20
|
+
- Rakefile
|
21
|
+
- lib/trailing_slash_seo.rb
|
22
|
+
- radiant-trailing_slash_seo-extension.gemspec
|
23
|
+
- trailing_slash_seo_extension.rb
|
24
|
+
homepage: http://github.com/sealink/radiant-trailing_slash_seo-extension
|
25
|
+
licenses:
|
26
|
+
- MIT
|
27
|
+
metadata: {}
|
28
|
+
post_install_message:
|
29
|
+
rdoc_options: []
|
30
|
+
require_paths:
|
31
|
+
- lib
|
32
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
33
|
+
requirements:
|
34
|
+
- - ">="
|
35
|
+
- !ruby/object:Gem::Version
|
36
|
+
version: '0'
|
37
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - ">="
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: '0'
|
42
|
+
requirements: []
|
43
|
+
rubyforge_project:
|
44
|
+
rubygems_version: 2.5.2
|
45
|
+
signing_key:
|
46
|
+
specification_version: 4
|
47
|
+
summary: Extension to handle trailing slashes for SEO.
|
48
|
+
test_files: []
|