fi_seo 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +15 -0
  3. data/.rspec +3 -0
  4. data/.ruby-version +1 -0
  5. data/.travis.yml +6 -0
  6. data/CODE_OF_CONDUCT.md +74 -0
  7. data/Gemfile +10 -0
  8. data/Gemfile.lock +93 -0
  9. data/LICENSE.txt +21 -0
  10. data/README.md +309 -0
  11. data/Rakefile +6 -0
  12. data/app/controller/sitemap_controller.rb +58 -0
  13. data/app/views/acts_as_seoable/_view_helper.html.arb +31 -0
  14. data/app/views/google_analytics/_acts_as_seoable.html.erb +9 -0
  15. data/app/views/sitemap/sitemap.xml.erb +1 -0
  16. data/bin/console +14 -0
  17. data/bin/setup +8 -0
  18. data/config/routes.rb +7 -0
  19. data/fi_seo.gemspec +29 -0
  20. data/lib/acts_as_seoable/dynamic_seo.rb +6 -0
  21. data/lib/acts_as_seoable/engine.rb +6 -0
  22. data/lib/acts_as_seoable/google_analytic_seo.rb +5 -0
  23. data/lib/acts_as_seoable/helpers/sitemap_helper.rb +32 -0
  24. data/lib/acts_as_seoable/helpers/static_helper.rb +94 -0
  25. data/lib/acts_as_seoable/sitemap_seo.rb +10 -0
  26. data/lib/acts_as_seoable/static_seo.rb +5 -0
  27. data/lib/acts_as_seoable/version.rb +3 -0
  28. data/lib/fi_seo.rb +205 -0
  29. data/lib/generators/acts_as_seoable/admin/admin_generator.rb +17 -0
  30. data/lib/generators/acts_as_seoable/admin/templates/admin.rb +250 -0
  31. data/lib/generators/acts_as_seoable/admin_view_helper/admin_view_helper_generator.rb +17 -0
  32. data/lib/generators/acts_as_seoable/admin_view_helper/templates/_view_helper.html.arb +31 -0
  33. data/lib/generators/acts_as_seoable/install/install_generator.rb +13 -0
  34. data/lib/generators/acts_as_seoable/install/templates/initializer.rb +20 -0
  35. data/lib/generators/acts_as_seoable/migrate/migrate_generator.rb +22 -0
  36. data/lib/generators/acts_as_seoable/migrate/templates/migration.rb +65 -0
  37. data/screenshots/dynamic-pages-seoable.png +0 -0
  38. data/screenshots/static-pages-seoable-details.png +0 -0
  39. data/screenshots/static-pages-seoable-frontend.png +0 -0
  40. data/screenshots/static-pages-seoable.png +0 -0
  41. metadata +140 -0
@@ -0,0 +1,17 @@
1
+ require 'rails/generators'
2
+
3
+ module ActsAsSeoable
4
+ module Generators
5
+ class AdminViewHelperGenerator < Rails::Generators::Base
6
+ source_root File.expand_path('templates', __dir__)
7
+
8
+ def generate_config_file
9
+ if Gem.loaded_specs.has_key?('activeadmin')
10
+ template '_view_helper.html.arb', 'app/views/acts_as_seoable/_view_helper.html.arb'
11
+ else
12
+ raise StandardError, 'Could not generate activeadmin helper page without activeadmin installed.'
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,31 @@
1
+ if defined?(seoable)
2
+ unless seoable.nil?
3
+ if action.to_s == 'show' && seoable.present? && seoable.dynamic_seo.present?
4
+ panel 'Dynamic SEO Information' do
5
+ attributes_table_for seoable.dynamic_seo do
6
+ row 'Title' do
7
+ seoable.dynamic_seo.title
8
+ end
9
+ row 'Description' do
10
+ seoable.dynamic_seo.description
11
+ end
12
+ row 'Keywords' do
13
+ seoable.dynamic_seo.keywords
14
+ end
15
+ end
16
+ end
17
+ elsif action.to_s == 'edit' && seoable.object.dynamic_seo.present?
18
+ seoable.inputs 'Dynamic SEO Information', for: [:dynamic_seo, seoable.object.dynamic_seo] do |dynamic_seo|
19
+ dynamic_seo.input :title
20
+ dynamic_seo.input :description
21
+ dynamic_seo.input :keywords
22
+ end
23
+ elsif action.to_s == 'new'
24
+ seoable.inputs 'Dynamic SEO Information', for: [:dynamic_seo, seoable.object.dynamic_seo || DynamicSeo.new] do |dynamic_seo|
25
+ dynamic_seo.input :title
26
+ dynamic_seo.input :description
27
+ dynamic_seo.input :keywords
28
+ end
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,13 @@
1
+ require 'rails/generators'
2
+
3
+ module ActsAsSeoable
4
+ module Generators
5
+ class InstallGenerator < ::Rails::Generators::Base
6
+ source_root File.expand_path('../templates', __FILE__)
7
+
8
+ def copy_initializer_file
9
+ copy_file 'initializer.rb', 'config/initializers/acts_as_seoable.rb'
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ FiSeo.configure do |config|
4
+ # config.default_facebook_title = ''
5
+ # config.default_facebook_url = ''
6
+ # config.default_facebook_type = ''
7
+ # config.default_facebook_image = ''
8
+ # config.default_facebook_description = ''
9
+ #
10
+ # config.default_twitter_title = ''
11
+ # config.default_twitter_card = ''
12
+ # config.default_twitter_site = ''
13
+ # config.default_twitter_image = ''
14
+ # config.default_twitter_description = ''
15
+ #
16
+ # config.default_canonical_url = ''
17
+ #
18
+ # config.sitemap_host_url = 'www.domain.com'
19
+ # config.sitemap_enable = true
20
+ end
@@ -0,0 +1,22 @@
1
+
2
+ require 'rails/generators'
3
+ require 'rails/generators/migration'
4
+
5
+ module ActsAsSeoable
6
+ module Generators
7
+ class MigrateGenerator < ::Rails::Generators::Base
8
+ include Rails::Generators::Migration
9
+ source_root File.expand_path('../templates', __FILE__)
10
+
11
+ def self.next_migration_number(path)
12
+ next_migration_number = current_migration_number(path) + 1
13
+ ActiveRecord::Migration.next_migration_number(next_migration_number)
14
+ end
15
+
16
+ def copy_migrations
17
+ migration_template 'migration.rb',
18
+ 'db/migrate/create_seo_tables.rb'
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,65 @@
1
+ class CreateSeoTables < ActiveRecord::Migration[5.2]
2
+ def self.up
3
+ create_table :dynamic_seos do |t|
4
+ t.string :seoable_type, null: false
5
+ t.integer :seoable_id, null: false
6
+ t.string :title, null: false, default: ''
7
+ t.text :description, null: false, default: ''
8
+ t.text :keywords, null: false, default: ''
9
+
10
+ t.timestamps
11
+ end
12
+
13
+ create_table :static_seos do |t|
14
+ t.string :seoable_controller, null: false
15
+ t.string :seoable_action, null: false
16
+ t.string :title, null: false, default: ''
17
+ t.text :description, null: false, default: ''
18
+ t.text :keywords, null: false, default: ''
19
+ t.boolean :status, null: false, default: false
20
+ t.string :facebook_title, null: false, default: ''
21
+ t.string :facebook_url, null: false, default: ''
22
+ t.string :facebook_type, null: false, default: ''
23
+ t.string :facebook_image, null: false, default: ''
24
+ t.string :facebook_description, null: false, default: ''
25
+ t.string :twitter_title, null: false, default: ''
26
+ t.string :twitter_card, null: false, default: ''
27
+ t.string :twitter_site, null: false, default: ''
28
+ t.string :twitter_image, null: false, default: ''
29
+ t.string :twitter_description, null: false, default: ''
30
+
31
+ t.timestamps
32
+ end
33
+
34
+ create_table :sitemap_seos do |t|
35
+ t.string :sitemap_controller, null: false
36
+ t.string :sitemap_action, null: false
37
+ t.boolean :status, null: false
38
+ t.decimal :priority, null: false, default: 1
39
+ t.integer :period, null: false, default: 0
40
+ t.boolean :static, null: false, default: false
41
+
42
+ t.timestamps
43
+ end
44
+
45
+ create_table :google_analytic_seos do |t|
46
+ t.string :title, null: false
47
+ t.string :content, null: false, default: ''
48
+
49
+ t.timestamps
50
+ end
51
+
52
+ GoogleAnalyticSeo.create(title: 'analytic id', content: '')
53
+
54
+ add_index :dynamic_seos, %i[seoable_type seoable_id], unique: true
55
+ add_index :static_seos, %i[seoable_controller seoable_action], unique: true
56
+ add_index :sitemap_seos, %i[sitemap_controller sitemap_action], unique: true
57
+ end
58
+
59
+ def self.down
60
+ drop_table :dynamic_seos
61
+ drop_table :static_seos
62
+ drop_table :sitemap_seos
63
+ drop_table :google_analytic_seos
64
+ end
65
+ end
metadata ADDED
@@ -0,0 +1,140 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: fi_seo
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Banura Randika
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2020-05-19 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: activerecord
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '5.0'
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: 5.0.0.1
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - "~>"
28
+ - !ruby/object:Gem::Version
29
+ version: '5.0'
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: 5.0.0.1
33
+ - !ruby/object:Gem::Dependency
34
+ name: meta-tags
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - "~>"
38
+ - !ruby/object:Gem::Version
39
+ version: '2.13'
40
+ type: :runtime
41
+ prerelease: false
42
+ version_requirements: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - "~>"
45
+ - !ruby/object:Gem::Version
46
+ version: '2.13'
47
+ - !ruby/object:Gem::Dependency
48
+ name: xml-sitemap
49
+ requirement: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - "~>"
52
+ - !ruby/object:Gem::Version
53
+ version: '1.3'
54
+ - - ">="
55
+ - !ruby/object:Gem::Version
56
+ version: 1.3.3
57
+ type: :runtime
58
+ prerelease: false
59
+ version_requirements: !ruby/object:Gem::Requirement
60
+ requirements:
61
+ - - "~>"
62
+ - !ruby/object:Gem::Version
63
+ version: '1.3'
64
+ - - ">="
65
+ - !ruby/object:Gem::Version
66
+ version: 1.3.3
67
+ description: |-
68
+ This gem provides a easier solution to search engine optimization(SEO) in a ruby project. This will give you the seo capabilities to your static pages anddynamic pages alike with few lines of code.
69
+ Also site maps are essential to the SEO of your web application. So this gem gives that capabilities with a feature to integrate google analytics.
70
+ email:
71
+ - info@fidenz.com
72
+ - tech@fidenz.com
73
+ - banura.r@fidenz.com
74
+ executables: []
75
+ extensions: []
76
+ extra_rdoc_files: []
77
+ files:
78
+ - ".gitignore"
79
+ - ".rspec"
80
+ - ".ruby-version"
81
+ - ".travis.yml"
82
+ - CODE_OF_CONDUCT.md
83
+ - Gemfile
84
+ - Gemfile.lock
85
+ - LICENSE.txt
86
+ - README.md
87
+ - Rakefile
88
+ - app/controller/sitemap_controller.rb
89
+ - app/views/acts_as_seoable/_view_helper.html.arb
90
+ - app/views/google_analytics/_acts_as_seoable.html.erb
91
+ - app/views/sitemap/sitemap.xml.erb
92
+ - bin/console
93
+ - bin/setup
94
+ - config/routes.rb
95
+ - fi_seo.gemspec
96
+ - lib/acts_as_seoable/dynamic_seo.rb
97
+ - lib/acts_as_seoable/engine.rb
98
+ - lib/acts_as_seoable/google_analytic_seo.rb
99
+ - lib/acts_as_seoable/helpers/sitemap_helper.rb
100
+ - lib/acts_as_seoable/helpers/static_helper.rb
101
+ - lib/acts_as_seoable/sitemap_seo.rb
102
+ - lib/acts_as_seoable/static_seo.rb
103
+ - lib/acts_as_seoable/version.rb
104
+ - lib/fi_seo.rb
105
+ - lib/generators/acts_as_seoable/admin/admin_generator.rb
106
+ - lib/generators/acts_as_seoable/admin/templates/admin.rb
107
+ - lib/generators/acts_as_seoable/admin_view_helper/admin_view_helper_generator.rb
108
+ - lib/generators/acts_as_seoable/admin_view_helper/templates/_view_helper.html.arb
109
+ - lib/generators/acts_as_seoable/install/install_generator.rb
110
+ - lib/generators/acts_as_seoable/install/templates/initializer.rb
111
+ - lib/generators/acts_as_seoable/migrate/migrate_generator.rb
112
+ - lib/generators/acts_as_seoable/migrate/templates/migration.rb
113
+ - screenshots/dynamic-pages-seoable.png
114
+ - screenshots/static-pages-seoable-details.png
115
+ - screenshots/static-pages-seoable-frontend.png
116
+ - screenshots/static-pages-seoable.png
117
+ homepage: https://github.com/fidenz-developer/fi-seo.git
118
+ licenses:
119
+ - MIT
120
+ metadata: {}
121
+ post_install_message:
122
+ rdoc_options: []
123
+ require_paths:
124
+ - lib
125
+ required_ruby_version: !ruby/object:Gem::Requirement
126
+ requirements:
127
+ - - ">="
128
+ - !ruby/object:Gem::Version
129
+ version: 2.3.0
130
+ required_rubygems_version: !ruby/object:Gem::Requirement
131
+ requirements:
132
+ - - ">="
133
+ - !ruby/object:Gem::Version
134
+ version: '0'
135
+ requirements: []
136
+ rubygems_version: 3.0.3
137
+ signing_key:
138
+ specification_version: 4
139
+ summary: Flexible SEO solution for rails projects
140
+ test_files: []