better_seo 0.14.0 β†’ 1.0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +61 -0
  3. data/README.md +297 -179
  4. data/docs/00_OVERVIEW.md +472 -0
  5. data/docs/01_CORE_AND_CONFIGURATION.md +913 -0
  6. data/docs/02_META_TAGS_AND_OPEN_GRAPH.md +251 -0
  7. data/docs/03_STRUCTURED_DATA.md +140 -0
  8. data/docs/04_SITEMAP_AND_ROBOTS.md +131 -0
  9. data/docs/05_RAILS_INTEGRATION.md +175 -0
  10. data/docs/06_I18N_PAGE_GENERATOR.md +233 -0
  11. data/docs/07_IMAGE_OPTIMIZATION.md +260 -0
  12. data/docs/DEPENDENCIES.md +383 -0
  13. data/docs/README.md +180 -0
  14. data/docs/TESTING_STRATEGY.md +663 -0
  15. data/lib/better_seo/analytics/google_analytics.rb +83 -0
  16. data/lib/better_seo/analytics/google_tag_manager.rb +74 -0
  17. data/lib/better_seo/configuration.rb +316 -0
  18. data/lib/better_seo/dsl/base.rb +86 -0
  19. data/lib/better_seo/dsl/meta_tags.rb +55 -0
  20. data/lib/better_seo/dsl/open_graph.rb +109 -0
  21. data/lib/better_seo/dsl/twitter_cards.rb +131 -0
  22. data/lib/better_seo/errors.rb +31 -0
  23. data/lib/better_seo/generators/amp_generator.rb +83 -0
  24. data/lib/better_seo/generators/breadcrumbs_generator.rb +126 -0
  25. data/lib/better_seo/generators/canonical_url_manager.rb +106 -0
  26. data/lib/better_seo/generators/meta_tags_generator.rb +100 -0
  27. data/lib/better_seo/generators/open_graph_generator.rb +110 -0
  28. data/lib/better_seo/generators/robots_txt_generator.rb +102 -0
  29. data/lib/better_seo/generators/twitter_cards_generator.rb +102 -0
  30. data/lib/better_seo/image/optimizer.rb +143 -0
  31. data/lib/better_seo/rails/helpers/controller_helpers.rb +118 -0
  32. data/lib/better_seo/rails/helpers/seo_helper.rb +176 -0
  33. data/lib/better_seo/rails/helpers/structured_data_helper.rb +123 -0
  34. data/lib/better_seo/rails/model_helpers.rb +62 -0
  35. data/lib/better_seo/rails/railtie.rb +22 -0
  36. data/lib/better_seo/sitemap/builder.rb +65 -0
  37. data/lib/better_seo/sitemap/generator.rb +57 -0
  38. data/lib/better_seo/sitemap/sitemap_index.rb +73 -0
  39. data/lib/better_seo/sitemap/url_entry.rb +157 -0
  40. data/lib/better_seo/structured_data/article.rb +55 -0
  41. data/lib/better_seo/structured_data/base.rb +73 -0
  42. data/lib/better_seo/structured_data/breadcrumb_list.rb +49 -0
  43. data/lib/better_seo/structured_data/event.rb +207 -0
  44. data/lib/better_seo/structured_data/faq_page.rb +55 -0
  45. data/lib/better_seo/structured_data/generator.rb +75 -0
  46. data/lib/better_seo/structured_data/how_to.rb +96 -0
  47. data/lib/better_seo/structured_data/local_business.rb +94 -0
  48. data/lib/better_seo/structured_data/organization.rb +67 -0
  49. data/lib/better_seo/structured_data/person.rb +51 -0
  50. data/lib/better_seo/structured_data/product.rb +123 -0
  51. data/lib/better_seo/structured_data/recipe.rb +135 -0
  52. data/lib/better_seo/validators/seo_recommendations.rb +165 -0
  53. data/lib/better_seo/validators/seo_validator.rb +195 -0
  54. data/lib/better_seo/version.rb +1 -1
  55. data/lib/better_seo.rb +1 -0
  56. data/lib/generators/better_seo/install_generator.rb +21 -0
  57. data/lib/generators/better_seo/templates/README +29 -0
  58. data/lib/generators/better_seo/templates/better_seo.rb +40 -0
  59. metadata +55 -2
data/README.md CHANGED
@@ -1,134 +1,218 @@
1
- # BetterSeo
1
+ # πŸš€ BetterSeo
2
2
 
3
- A comprehensive SEO gem for Ruby and Rails applications. BetterSeo provides a clean, fluent DSL for managing meta tags, Open Graph, Twitter Cards, structured data, sitemaps, and more.
3
+ > A comprehensive, production-ready SEO toolkit for Ruby and Rails applications
4
+
5
+ BetterSeo provides a clean, fluent DSL for managing meta tags, Open Graph, Twitter Cards, structured data, sitemaps, and advanced SEO tools. Built with 899 passing tests and 94.3% code coverage.
4
6
 
5
7
  [![Tests](https://img.shields.io/badge/tests-899%20passing-brightgreen)](https://github.com/yourusername/better_seo)
6
8
  [![Coverage](https://img.shields.io/badge/coverage-94.3%25-brightgreen)](https://github.com/yourusername/better_seo)
7
9
  [![Ruby](https://img.shields.io/badge/ruby-%3E%3D%203.0.0-red)](https://www.ruby-lang.org)
8
10
  [![Rails](https://img.shields.io/badge/rails-%3E%3D%206.1-red)](https://rubyonrails.org)
9
11
 
10
- ## Features
11
-
12
- ### βœ… Implemented (v0.14.0)
13
-
14
- - **Core Configuration System**
15
- - Singleton configuration with block-style setup
16
- - Nested configuration objects
17
- - Feature flags for enabling/disabling modules
18
- - Validation with detailed error messages
19
- - i18n support with multiple locales
20
-
21
- - **DSL Builders**
22
- - **Meta Tags DSL**: title, description, keywords, author, canonical, robots, viewport, charset
23
- - **Open Graph DSL**: Complete OG protocol support including articles, images, videos, audio
24
- - **Twitter Cards DSL**: All card types (summary, summary_large_image, app, player)
25
- - Fluent interface with method chaining
26
- - Automatic validation (title/description length, required fields)
27
-
28
- - **HTML Generators** - Advanced generators for modern web
29
- - **MetaTagsGenerator**: Converts DSL to HTML meta tags
30
- - **OpenGraphGenerator**: Converts DSL to Open Graph meta tags
31
- - **TwitterCardsGenerator**: Converts DSL to Twitter Card meta tags
32
- - **BreadcrumbsGenerator**: HTML breadcrumb navigation with Schema.org support
33
- - **AMP Generator**: Accelerated Mobile Pages (AMP) support
34
- - **Canonical URL Manager**: Canonical URL normalization and management
35
- - HTML entity escaping for security
36
- - Integration with DSL builders
37
-
38
- - **Rails Integration** - Complete framework integration
39
- - **SEO View Helpers**: `seo_meta_tags`, `seo_open_graph_tags`, `seo_twitter_tags`, `seo_tags`
40
- - **Structured Data Helpers**: `structured_data_tag`, `organization_sd`, `article_sd`, `person_sd`, `product_sd`, `breadcrumb_list_sd`, `local_business_sd`, `event_sd`, `faq_page_sd`, `how_to_sd`, `recipe_sd`
41
- - **Controller Helpers**: `set_page_title`, `set_page_description`, `set_page_keywords`, `set_page_image`, `set_canonical`, `set_noindex`, `set_meta_tags`, `set_og_tags`, `set_twitter_tags`
42
- - **Model Helpers**: `seo_attributes` macro for automatic SEO from model attributes
43
- - **Railtie**: Automatic initialization and helper injection
44
- - **Generator**: `rails generate better_seo:install` creates initializer
45
- - Support for hash configuration and DSL blocks
46
- - Automatic HTML safety with `raw` helper
47
- - Integration with global configuration defaults
48
-
49
- - **Sitemap Generation** - Advanced features for large sites
50
- - **XML Sitemap Builder**: Fluent API for building sitemaps
51
- - **Sitemap Generator**: Generate from blocks, arrays, or model collections
52
- - **URL Entry**: Full sitemap.org protocol support (loc, lastmod, changefreq, priority)
53
- - **Multi-language Support**: hreflang alternates for international sites
54
- - **Image Sitemaps**: Add images with title and caption to URLs
55
- - **Video Sitemaps**: Add videos with thumbnail, title, description, duration
56
- - **Sitemap Index**: Manage large sites with 50,000+ URLs across multiple sitemaps
57
- - **Dynamic Generation**: Lambda support for dynamic attributes
58
- - **File Writing**: Write sitemaps directly to files
59
- - **Rails Integration**: Controller actions and Rake tasks
60
- - **Validation**: Automatic URL validation (format, protocol)
61
- - **Method Chaining**: Fluent interface for adding multiple URLs
62
-
63
- - **Structured Data (JSON-LD)** - 10 comprehensive types
64
- - **Base Class**: Generic structured data with full Schema.org support
65
- - **Organization**: Company/organization information with address, social profiles
66
- - **Article**: Blog posts, news articles with author, publisher, metadata
67
- - **Person**: Author profiles, team members with job title, social links
68
- - **Product**: E-commerce products with price, availability, ratings, reviews
69
- - **BreadcrumbList**: Navigation breadcrumbs for improved site structure
70
- - **LocalBusiness**: Physical locations with address, hours, geo coordinates, ratings
71
- - **Event**: Conferences, webinars with dates, location, tickets, performers
72
- - **FAQPage**: Structured FAQ with questions/answers for rich snippets
73
- - **HowTo**: Step-by-step guides with supplies, tools, and instructions
74
- - **Recipe**: Cooking recipes with ingredients, nutrition, cooking time
75
- - **Generator Helper**: Factory methods for all types with block support
76
- - **Nested Data**: Automatic handling of complex object relationships
77
- - **JSON-LD Output**: Valid Schema.org JSON-LD format
78
- - **Rails Integration**: Complete view helpers for all types
79
-
80
- ### 🚧 Planned
81
-
82
- - **Advanced Features** (v0.13.0+)
83
- - robots.txt generator
84
- - Image optimization with WebP conversion
85
- - SEO validators and recommendations
86
- - Performance monitoring and analytics integration
87
-
88
- ## Installation
89
-
90
- ### For Production Use (when published to RubyGems)
91
-
92
- Add this line to your application's Gemfile:
93
-
94
- ```ruby
95
- gem 'better_seo', '~> 0.7.0'
96
- ```
97
-
98
- And then execute:
12
+ ### 🎯 Key Features at a Glance
13
+
14
+ | Feature | Description |
15
+ |---------|-------------|
16
+ | 🏷️ **Meta Tags** | Complete DSL for title, description, keywords, robots |
17
+ | πŸ“± **Social Media** | Open Graph & Twitter Cards with validation |
18
+ | πŸ—ΊοΈ **Sitemaps** | XML sitemaps with hreflang, images, videos |
19
+ | πŸ“Š **Structured Data** | 10+ JSON-LD types (Article, Product, Recipe, etc.) |
20
+ | πŸ€– **Robots.txt** | Dynamic robots.txt generation |
21
+ | βœ… **SEO Validator** | Score pages 0-100 with recommendations |
22
+ | πŸ–ΌοΈ **Image Optimizer** | WebP conversion, resize, compress |
23
+ | πŸ“ˆ **Analytics** | Google Analytics 4 & Tag Manager |
24
+
25
+ ---
26
+
27
+ ## πŸ“‹ Table of Contents
28
+
29
+ - [✨ Features](#-features)
30
+ - [πŸ“¦ Installation](#-installation)
31
+ - [πŸš€ Quick Start](#-quick-start)
32
+ - [πŸ“– Core Features](#-core-features)
33
+ - [🏷️ Meta Tags DSL](#️-meta-tags-dsl)
34
+ - [πŸ“± Open Graph & Twitter Cards](#-open-graph--twitter-cards)
35
+ - [🎯 Rails Integration](#-rails-integration)
36
+ - [πŸ—ΊοΈ Sitemap Generation](#️-sitemap-generation)
37
+ - [πŸ“Š Structured Data (JSON-LD)](#-structured-data-json-ld)
38
+ - [πŸ› οΈ Advanced Tools](#️-advanced-tools)
39
+ - [🍞 Breadcrumbs Generator](#-breadcrumbs-generator)
40
+ - [⚑ AMP Support](#-amp-support)
41
+ - [πŸ”— Canonical URL Manager](#-canonical-url-manager)
42
+ - [πŸ€– Robots.txt Generator](#-robotstxt-generator)
43
+ - [βœ… SEO Validator & Recommendations](#-seo-validator--recommendations)
44
+ - [πŸ–ΌοΈ Image Optimizer](#️-image-optimizer)
45
+ - [πŸ“ˆ Analytics Integration](#-analytics-integration)
46
+ - [βš™οΈ Configuration](#️-configuration)
47
+ - [πŸ’» Development](#-development)
48
+ - [🀝 Contributing](#-contributing)
49
+ - [πŸ“„ License](#-license)
50
+
51
+ ---
52
+
53
+ ## ⚑ Quick Reference
54
+
55
+ ```ruby
56
+ # 1️⃣ Install
57
+ gem 'better_seo', '~> 1.0'
58
+
59
+ # 2️⃣ Configure
60
+ BetterSeo.configure do |config|
61
+ config.site_name = "My Site"
62
+ config.meta_tags.default_title = "Default Title"
63
+ end
64
+
65
+ # 3️⃣ Use in Views
66
+ <%= seo_tags do |seo|
67
+ seo.meta { |m| m.title("Page Title").description("Description") }
68
+ seo.og { |og| og.type("article").image(image_url) }
69
+ seo.twitter { |t| t.card("summary_large_image") }
70
+ end %>
71
+
72
+ # 4️⃣ Generate Sitemap
73
+ xml = BetterSeo::Sitemap::Generator.generate do |sitemap|
74
+ sitemap.add_url("https://example.com", priority: 1.0)
75
+ end
76
+
77
+ # 5️⃣ Add Structured Data
78
+ <%= article_sd(headline: @post.title, author: @post.author.name) %>
79
+ ```
80
+
81
+ ---
82
+
83
+ ## ✨ Features
84
+
85
+ ### 🎯 Core Capabilities (v1.0.0 - Production Ready)
86
+
87
+ <details>
88
+ <summary><b>πŸ—οΈ Core Configuration System</b></summary>
89
+
90
+ - βš™οΈ Singleton configuration with block-style setup
91
+ - πŸ”§ Nested configuration objects
92
+ - 🚩 Feature flags for enabling/disabling modules
93
+ - βœ… Validation with detailed error messages
94
+ - 🌍 i18n support with multiple locales
95
+ </details>
96
+
97
+ <details>
98
+ <summary><b>🏷️ DSL Builders</b></summary>
99
+
100
+ - **Meta Tags**: title, description, keywords, author, canonical, robots, viewport, charset
101
+ - **Open Graph**: Complete OG protocol including articles, images, videos, audio
102
+ - **Twitter Cards**: All card types (summary, summary_large_image, app, player)
103
+ - πŸ”— Fluent interface with method chaining
104
+ - βœ… Automatic validation (length, required fields)
105
+ </details>
106
+
107
+ <details>
108
+ <summary><b>🎨 HTML Generators</b></summary>
109
+
110
+ - 🏷️ **MetaTagsGenerator**: Converts DSL to HTML meta tags
111
+ - πŸ“± **OpenGraphGenerator**: Open Graph meta tags
112
+ - 🐦 **TwitterCardsGenerator**: Twitter Card meta tags
113
+ - 🍞 **BreadcrumbsGenerator**: HTML breadcrumbs with Schema.org
114
+ - ⚑ **AMP Generator**: Accelerated Mobile Pages support
115
+ - πŸ”— **Canonical URL Manager**: URL normalization and management
116
+ - πŸ”’ HTML entity escaping for security
117
+ </details>
118
+
119
+ <details>
120
+ <summary><b>🎯 Rails Integration</b></summary>
121
+
122
+ - **View Helpers**: `seo_meta_tags`, `seo_open_graph_tags`, `seo_twitter_tags`, `seo_tags`
123
+ - **Structured Data Helpers**: 10+ helpers for all Schema.org types
124
+ - **Controller Helpers**: `set_page_title`, `set_page_description`, `set_page_keywords`, and more
125
+ - **Model Helpers**: `seo_attributes` macro for automatic SEO
126
+ - **Railtie**: Automatic initialization and helper injection
127
+ - **Generator**: `rails generate better_seo:install`
128
+ </details>
129
+
130
+ <details>
131
+ <summary><b>πŸ—ΊοΈ Sitemap Generation</b></summary>
132
+
133
+ - πŸ“ XML Sitemap Builder with fluent API
134
+ - 🌍 Multi-language support (hreflang alternates)
135
+ - πŸ–ΌοΈ Image sitemaps with title and caption
136
+ - πŸŽ₯ Video sitemaps with metadata
137
+ - πŸ“š Sitemap Index for 50,000+ URLs
138
+ - πŸ”„ Dynamic generation with lambda support
139
+ - πŸ’Ύ File writing capabilities
140
+ - βœ… Automatic URL validation
141
+ </details>
142
+
143
+ <details>
144
+ <summary><b>πŸ“Š Structured Data (JSON-LD)</b></summary>
145
+
146
+ **10 comprehensive Schema.org types:**
147
+ - 🏒 **Organization**: Company info with address, social profiles
148
+ - πŸ“° **Article**: Blog posts with author, publisher, metadata
149
+ - πŸ‘€ **Person**: Author profiles with job title, social links
150
+ - πŸ›οΈ **Product**: E-commerce with price, ratings, reviews
151
+ - 🍞 **BreadcrumbList**: Navigation breadcrumbs
152
+ - πŸͺ **LocalBusiness**: Physical locations with hours, geo coordinates
153
+ - 🎫 **Event**: Conferences, webinars with dates, tickets
154
+ - ❓ **FAQPage**: Structured FAQ for rich snippets
155
+ - πŸ“‹ **HowTo**: Step-by-step guides
156
+ - 🍳 **Recipe**: Cooking recipes with ingredients, nutrition
157
+
158
+ ✨ Full Rails integration with dedicated view helpers
159
+ </details>
160
+
161
+ <details>
162
+ <summary><b>πŸ› οΈ Advanced SEO Tools</b></summary>
163
+
164
+ - πŸ€– **Robots.txt Generator**: Control crawler access
165
+ - βœ… **SEO Validator**: Page scoring (0-100) with detailed reports
166
+ - πŸ’‘ **SEO Recommendations**: AI-powered suggestions by priority
167
+ - πŸ–ΌοΈ **Image Optimizer**: WebP conversion, resize, compress
168
+ - πŸ“ˆ **Google Analytics 4**: GA4 integration
169
+ - 🏷️ **Google Tag Manager**: GTM support with custom events
170
+ </details>
171
+
172
+ ## πŸ“¦ Installation
173
+
174
+ ### πŸ’Ž Production Use (RubyGems)
175
+
176
+ Add to your `Gemfile`:
177
+
178
+ ```ruby
179
+ gem 'better_seo', '~> 1.0'
180
+ ```
181
+
182
+ Then run:
99
183
 
100
184
  ```bash
101
185
  bundle install
102
186
  ```
103
187
 
104
- Or install it yourself as:
188
+ Or install directly:
105
189
 
106
190
  ```bash
107
191
  gem install better_seo
108
192
  ```
109
193
 
110
- ### For Development (from source)
194
+ ### πŸ”§ Development (from source)
111
195
 
112
- Add this line to your application's Gemfile:
196
+ **From Git:**
113
197
 
114
198
  ```ruby
115
- gem 'better_seo', git: 'https://github.com/alessiobussolari/better_seo.git', tag: 'v0.7.0'
199
+ gem 'better_seo', git: 'https://github.com/alessiobussolari/better_seo.git', tag: 'v1.0.0'
116
200
  ```
117
201
 
118
- Or clone and build locally:
202
+ **Clone and build locally:**
119
203
 
120
204
  ```bash
121
205
  git clone https://github.com/alessiobussolari/better_seo.git
122
206
  cd better_seo
123
207
  gem build better_seo.gemspec
124
- gem install better_seo-0.7.0.gem
208
+ gem install better_seo-1.0.0.gem
125
209
  ```
126
210
 
127
- ## Quick Start
211
+ ## πŸš€ Quick Start
128
212
 
129
- ### 1. Configuration
213
+ ### 1️⃣ Configuration
130
214
 
131
- Create an initializer (Rails) or configure at app startup:
215
+ Create an initializer in Rails or configure at app startup:
132
216
 
133
217
  ```ruby
134
218
  # config/initializers/better_seo.rb
@@ -156,9 +240,9 @@ BetterSeo.configure do |config|
156
240
  end
157
241
  ```
158
242
 
159
- ### 2. Using DSL Builders
243
+ ### 2️⃣ Using DSL Builders
160
244
 
161
- #### Meta Tags
245
+ #### 🏷️ Meta Tags
162
246
 
163
247
  ```ruby
164
248
  meta = BetterSeo::DSL::MetaTags.new
@@ -184,7 +268,7 @@ config = meta.build
184
268
  # }
185
269
  ```
186
270
 
187
- #### Open Graph
271
+ #### πŸ“± Open Graph
188
272
 
189
273
  ```ruby
190
274
  og = BetterSeo::DSL::OpenGraph.new
@@ -212,7 +296,7 @@ end
212
296
  config = og.build
213
297
  ```
214
298
 
215
- #### Twitter Cards
299
+ #### 🐦 Twitter Cards
216
300
 
217
301
  ```ruby
218
302
  twitter = BetterSeo::DSL::TwitterCards.new
@@ -230,7 +314,7 @@ end
230
314
  config = twitter.build
231
315
  ```
232
316
 
233
- #### Method Chaining
317
+ #### πŸ”— Method Chaining
234
318
 
235
319
  All DSL builders support fluent interface:
236
320
 
@@ -256,11 +340,11 @@ twitter = BetterSeo::DSL::TwitterCards.new
256
340
  .image("https://example.com/twitter.jpg")
257
341
  ```
258
342
 
259
- ### 3. HTML Generation
343
+ ### 3️⃣ HTML Generation
260
344
 
261
345
  Once you've built your SEO configuration with DSL builders, use generators to convert them to HTML tags:
262
346
 
263
- #### Meta Tags Generator
347
+ #### 🎨 Meta Tags Generator
264
348
 
265
349
  ```ruby
266
350
  # Build configuration with DSL
@@ -285,7 +369,7 @@ html = generator.generate
285
369
  # <meta name="robots" content="index, follow">
286
370
  ```
287
371
 
288
- #### Open Graph Generator
372
+ #### πŸ“± Open Graph Generator
289
373
 
290
374
  ```ruby
291
375
  # Build configuration with DSL
@@ -308,7 +392,7 @@ html = generator.generate
308
392
  # <meta property="og:image:height" content="630">
309
393
  ```
310
394
 
311
- #### Twitter Cards Generator
395
+ #### 🐦 Twitter Cards Generator
312
396
 
313
397
  ```ruby
314
398
  # Build configuration with DSL
@@ -331,7 +415,7 @@ html = generator.generate
331
415
  # <meta name="twitter:image" content="https://example.com/twitter.jpg">
332
416
  ```
333
417
 
334
- #### Complete Example
418
+ #### ✨ Complete Example
335
419
 
336
420
  ```ruby
337
421
  # Build all SEO tags for a page
@@ -364,7 +448,7 @@ twitter_html = BetterSeo::Generators::TwitterCardsGenerator.new(twitter.build).g
364
448
  all_tags = [meta_html, og_html, twitter_html].join("\n")
365
449
  ```
366
450
 
367
- #### Security Features
451
+ #### πŸ”’ Security Features
368
452
 
369
453
  All generators automatically escape HTML entities to prevent XSS attacks:
370
454
 
@@ -380,7 +464,7 @@ html = generator.generate
380
464
  # All dangerous characters are properly escaped
381
465
  ```
382
466
 
383
- ### 4. Validation
467
+ ### 4️⃣ Validation
384
468
 
385
469
  All DSL builders include automatic validation:
386
470
 
@@ -401,11 +485,15 @@ twitter.build
401
485
  # => BetterSeo::ValidationError: Invalid card type: invalid_type. Valid types: summary, summary_large_image, app, player
402
486
  ```
403
487
 
404
- ### 5. Rails Integration
488
+ ---
489
+
490
+ ## πŸ“– Core Features
405
491
 
406
- BetterSeo provides view helpers for easy integration in Rails applications.
492
+ ### 🎯 Rails Integration
407
493
 
408
- #### Setup
494
+ BetterSeo provides comprehensive view helpers for seamless Rails integration.
495
+
496
+ #### πŸ”§ Setup
409
497
 
410
498
  Include the helpers in your `ApplicationHelper`:
411
499
 
@@ -425,9 +513,9 @@ class ApplicationController < ActionController::Base
425
513
  end
426
514
  ```
427
515
 
428
- #### Using View Helpers
516
+ #### 🎨 Using View Helpers
429
517
 
430
- ##### Single Tag Group Helpers
518
+ ##### 🏷️ Single Tag Group Helpers
431
519
 
432
520
  ```erb
433
521
  <%# app/views/layouts/application.html.erb %>
@@ -458,7 +546,7 @@ end
458
546
  </head>
459
547
  ```
460
548
 
461
- ##### All-in-One Helper
549
+ ##### ✨ All-in-One Helper
462
550
 
463
551
  ```erb
464
552
  <%# Generate all SEO tags at once %>
@@ -597,11 +685,11 @@ Then use it in your views:
597
685
  og_image: url_for(@article.cover_image) %>
598
686
  ```
599
687
 
600
- ### 6. Sitemap Generation
688
+ ### πŸ—ΊοΈ Sitemap Generation
601
689
 
602
690
  BetterSeo provides a comprehensive sitemap generation system with support for XML sitemaps, dynamic content, and model collections.
603
691
 
604
- #### Basic Sitemap Generation
692
+ #### πŸ“ Basic Sitemap Generation
605
693
 
606
694
  Generate a simple sitemap using the block syntax:
607
695
 
@@ -624,7 +712,7 @@ puts xml
624
712
  # </urlset>
625
713
  ```
626
714
 
627
- #### URL Entry with Full Attributes
715
+ #### βš™οΈ URL Entry with Full Attributes
628
716
 
629
717
  Add URLs with all sitemap attributes (lastmod, changefreq, priority):
630
718
 
@@ -656,7 +744,7 @@ end
656
744
 
657
745
  **Priority range**: 0.0 to 1.0 (default: 0.5)
658
746
 
659
- #### Method Chaining
747
+ #### πŸ”— Method Chaining
660
748
 
661
749
  The builder supports fluent method chaining:
662
750
 
@@ -1033,11 +1121,11 @@ end
1033
1121
  # SitemapGeneratorService.generate
1034
1122
  ```
1035
1123
 
1036
- ### 7. Structured Data (JSON-LD)
1124
+ ### πŸ“Š Structured Data (JSON-LD)
1037
1125
 
1038
1126
  BetterSeo provides comprehensive support for Schema.org structured data using JSON-LD format, helping search engines better understand your content.
1039
1127
 
1040
- #### Basic Usage
1128
+ #### πŸ’‘ Basic Usage
1041
1129
 
1042
1130
  Create structured data objects and generate JSON-LD script tags:
1043
1131
 
@@ -1061,9 +1149,9 @@ org.to_script_tag
1061
1149
  # </script>
1062
1150
  ```
1063
1151
 
1064
- #### Available Types
1152
+ #### πŸ“š Available Types
1065
1153
 
1066
- **Organization** - Company/organization information:
1154
+ **🏒 Organization** - Company/organization information:
1067
1155
 
1068
1156
  ```ruby
1069
1157
  org = BetterSeo::StructuredData::Organization.new
@@ -1087,7 +1175,7 @@ org.same_as([
1087
1175
  org.founding_date("2015-03-20")
1088
1176
  ```
1089
1177
 
1090
- **Article** - Blog posts, news articles, content:
1178
+ **πŸ“° Article** - Blog posts, news articles, content:
1091
1179
 
1092
1180
  ```ruby
1093
1181
  article = BetterSeo::StructuredData::Article.new
@@ -1103,7 +1191,7 @@ article.keywords(["Web Development", "Technology", "Trends"])
1103
1191
  article.article_section("Technology")
1104
1192
  ```
1105
1193
 
1106
- **Person** - Author profiles, team members:
1194
+ **πŸ‘€ Person** - Author profiles, team members:
1107
1195
 
1108
1196
  ```ruby
1109
1197
  person = BetterSeo::StructuredData::Person.new
@@ -1121,7 +1209,7 @@ person.same_as([
1121
1209
  ])
1122
1210
  ```
1123
1211
 
1124
- **Product** - E-commerce products:
1212
+ **πŸ›οΈ Product** - E-commerce products:
1125
1213
 
1126
1214
  ```ruby
1127
1215
  product = BetterSeo::StructuredData::Product.new
@@ -1142,7 +1230,7 @@ product.aggregate_rating(
1142
1230
  )
1143
1231
  ```
1144
1232
 
1145
- **BreadcrumbList** - Navigation breadcrumbs:
1233
+ **🍞 BreadcrumbList** - Navigation breadcrumbs:
1146
1234
 
1147
1235
  ```ruby
1148
1236
  breadcrumb = BetterSeo::StructuredData::BreadcrumbList.new
@@ -1532,13 +1620,13 @@ all_tags = BetterSeo::StructuredData::Generator.generate_script_tags([
1532
1620
 
1533
1621
  ---
1534
1622
 
1535
- ## Advanced Generators
1623
+ ## πŸ› οΈ Advanced Tools
1536
1624
 
1537
- ### Breadcrumbs Generator
1625
+ ### 🍞 Breadcrumbs Generator
1538
1626
 
1539
1627
  Generate HTML breadcrumb navigation with Schema.org structured data support.
1540
1628
 
1541
- #### Basic Usage
1629
+ #### πŸ’‘ Basic Usage
1542
1630
 
1543
1631
  ```ruby
1544
1632
  generator = BetterSeo::Generators::BreadcrumbsGenerator.new
@@ -1607,11 +1695,11 @@ generator.add_items([
1607
1695
 
1608
1696
  ---
1609
1697
 
1610
- ### AMP Generator
1698
+ ### ⚑ AMP Generator
1611
1699
 
1612
1700
  Generate Accelerated Mobile Pages (AMP) HTML components.
1613
1701
 
1614
- #### Basic Usage
1702
+ #### πŸ’‘ Basic Usage
1615
1703
 
1616
1704
  ```ruby
1617
1705
  amp = BetterSeo::Generators::AmpGenerator.new(
@@ -1693,11 +1781,11 @@ end
1693
1781
 
1694
1782
  ---
1695
1783
 
1696
- ### Canonical URL Manager
1784
+ ### πŸ”— Canonical URL Manager
1697
1785
 
1698
1786
  Manage and normalize canonical URLs with validation.
1699
1787
 
1700
- #### Basic Usage
1788
+ #### πŸ’‘ Basic Usage
1701
1789
 
1702
1790
  ```ruby
1703
1791
  manager = BetterSeo::Generators::CanonicalUrlManager.new("https://example.com/page")
@@ -1793,13 +1881,11 @@ manager.validate! # Raises: "URL is required"
1793
1881
 
1794
1882
  ---
1795
1883
 
1796
- ## SEO Tools
1797
-
1798
- ### Robots.txt Generator
1884
+ ### πŸ€– Robots.txt Generator
1799
1885
 
1800
1886
  Generate robots.txt files to control search engine crawler access.
1801
1887
 
1802
- #### Basic Usage
1888
+ #### πŸ’‘ Basic Usage
1803
1889
 
1804
1890
  ```ruby
1805
1891
  robots = BetterSeo::Generators::RobotsTxtGenerator.new
@@ -1875,11 +1961,11 @@ get '/robots.txt', to: 'robots#index'
1875
1961
 
1876
1962
  ---
1877
1963
 
1878
- ### SEO Validator
1964
+ ### βœ… SEO Validator & Recommendations
1879
1965
 
1880
- Validate and score your pages for SEO best practices.
1966
+ Validate and score your pages for SEO best practices with AI-powered recommendations.
1881
1967
 
1882
- #### Basic Usage
1968
+ #### πŸ’‘ Basic Usage
1883
1969
 
1884
1970
  ```ruby
1885
1971
  validator = BetterSeo::Validators::SeoValidator.new
@@ -1986,9 +2072,9 @@ end
1986
2072
 
1987
2073
  ---
1988
2074
 
1989
- ## Configuration Reference
2075
+ ## βš™οΈ Configuration
1990
2076
 
1991
- ### Global Configuration
2077
+ ### πŸ”§ Global Configuration
1992
2078
 
1993
2079
  ```ruby
1994
2080
  BetterSeo.configure do |config|
@@ -2043,7 +2129,7 @@ BetterSeo.configure do |config|
2043
2129
  end
2044
2130
  ```
2045
2131
 
2046
- ### Checking Configuration
2132
+ ### βœ… Checking Configuration
2047
2133
 
2048
2134
  ```ruby
2049
2135
  # Access configuration
@@ -2061,7 +2147,9 @@ BetterSeo.enabled?(:sitemap)
2061
2147
  BetterSeo.reset_configuration!
2062
2148
  ```
2063
2149
 
2064
- ## Development
2150
+ ---
2151
+
2152
+ ## πŸ’» Development
2065
2153
 
2066
2154
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests.
2067
2155
 
@@ -2079,9 +2167,9 @@ bundle exec rspec --format documentation
2079
2167
  open coverage/index.html
2080
2168
  ```
2081
2169
 
2082
- ### Running Tests
2170
+ ### πŸ§ͺ Running Tests
2083
2171
 
2084
- The gem uses RSpec with SimpleCov for test coverage. We maintain **100% code coverage**.
2172
+ The gem uses RSpec with SimpleCov for test coverage.
2085
2173
 
2086
2174
  ```bash
2087
2175
  # Run all tests
@@ -2094,18 +2182,15 @@ bundle exec rspec spec/dsl/meta_tags_spec.rb
2094
2182
  bundle exec rspec --format documentation
2095
2183
  ```
2096
2184
 
2097
- Current test statistics:
2098
- - **742 tests** passing
2099
- - **96.12% code coverage** (1364/1419 lines)
2100
- - **3 DSL builders** fully tested
2101
- - **3 HTML generators** fully tested
2102
- - **3 Rails helper modules** fully tested (View, Controller, Model)
2103
- - **10 Structured data types** fully tested
2104
- - **1 Advanced sitemap system** with hreflang, images, videos, and index
2105
- - **1 Railtie and Generator** fully tested
2106
- - **1 core configuration system** fully tested
2185
+ **πŸ“Š Test Statistics:**
2186
+ - βœ… **899 tests** passing
2187
+ - πŸ“ˆ **94.3% code coverage**
2188
+ - πŸ—οΈ **Complete test suite** for all modules
2189
+ - πŸ”’ **Production-ready** quality
2190
+
2191
+ ---
2107
2192
 
2108
- ## Architecture
2193
+ ## πŸ—οΈ Architecture
2109
2194
 
2110
2195
  ```
2111
2196
  lib/better_seo/
@@ -2129,35 +2214,68 @@ lib/better_seo/
2129
2214
  └── sitemap/ # Sitemap generation
2130
2215
  ```
2131
2216
 
2132
- ## Contributing
2217
+ ---
2218
+
2219
+ ## 🀝 Contributing
2133
2220
 
2134
2221
  Bug reports and pull requests are welcome on GitHub at https://github.com/yourusername/better_seo.
2135
2222
 
2136
- 1. Fork it
2137
- 2. Create your feature branch (`git checkout -b feature/my-new-feature`)
2138
- 3. Write tests (we maintain 100% coverage)
2139
- 4. Commit your changes (`git commit -am 'Add some feature'`)
2140
- 5. Push to the branch (`git push origin feature/my-new-feature`)
2141
- 6. Create new Pull Request
2223
+ 1. 🍴 Fork it
2224
+ 2. 🌿 Create your feature branch (`git checkout -b feature/my-new-feature`)
2225
+ 3. βœ… Write tests (we maintain high test coverage)
2226
+ 4. πŸ’Ύ Commit your changes (`git commit -am 'Add some feature'`)
2227
+ 5. πŸ“€ Push to the branch (`git push origin feature/my-new-feature`)
2228
+ 6. πŸŽ‰ Create new Pull Request
2229
+
2230
+ ---
2142
2231
 
2143
- ## License
2232
+ ## πŸ“„ License
2144
2233
 
2145
2234
  The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
2146
2235
 
2147
- ## Code of Conduct
2236
+ ---
2237
+
2238
+ ## πŸ“œ Code of Conduct
2148
2239
 
2149
2240
  Everyone interacting in the BetterSeo project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/yourusername/better_seo/blob/main/CODE_OF_CONDUCT.md).
2150
2241
 
2151
- ## Roadmap
2242
+ ---
2243
+
2244
+ ## πŸ—ΊοΈ Roadmap
2152
2245
 
2153
2246
  See [docs/00_OVERVIEW.md](docs/00_OVERVIEW.md) for the complete implementation roadmap.
2154
2247
 
2155
- ### Version History
2248
+ ### πŸ“… Version History
2249
+
2250
+ - βœ… **v0.1.0** - Core configuration system
2251
+ - βœ… **v0.2.0** - DSL builders (Meta Tags, Open Graph, Twitter Cards)
2252
+ - βœ… **v0.3.0** - HTML generators (Meta Tags, Open Graph, Twitter Cards)
2253
+ - βœ… **v0.4.0** - Rails view helpers integration
2254
+ - βœ… **v0.5.0** - Sitemap generation
2255
+ - βœ… **v0.6.0** - Structured data (JSON-LD)
2256
+ - βœ… **v0.7.0** - Advanced Rails integration
2257
+ - βœ… **v0.8.0** - Structured data helpers
2258
+ - βœ… **v0.9.0** - Additional structured data types
2259
+ - βœ… **v0.10.0** - Rails model helpers
2260
+ - βœ… **v0.11.0** - Advanced sitemap features
2261
+ - βœ… **v0.12.0** - Advanced generators (Breadcrumbs, AMP, Canonical)
2262
+ - βœ… **v0.13.0** - SEO tools (Robots.txt, Validator, Image Optimizer, Analytics)
2263
+ - βœ… **v0.14.0** - SEO intelligence (GTM, Recommendations)
2264
+ - πŸŽ‰ **v1.0.0** - **Production Ready** ← **Current**
2265
+
2266
+ ---
2267
+
2268
+ ## 🌟 Why BetterSeo?
2269
+
2270
+ - βœ… **Production-Ready**: 899 tests, 94.3% coverage
2271
+ - πŸš€ **Complete Solution**: Everything you need for SEO in one gem
2272
+ - 🎯 **Rails-First**: Designed specifically for Rails applications
2273
+ - πŸ”§ **Flexible**: Use as much or as little as you need
2274
+ - πŸ“š **Well-Documented**: Comprehensive examples and guides
2275
+ - 🌍 **i18n Support**: Built-in internationalization
2276
+ - πŸ”’ **Secure**: Automatic XSS protection
2277
+ - πŸ’Ž **Modern Ruby**: Built with Ruby 3.0+ and Rails 6.1+
2278
+
2279
+ ---
2156
2280
 
2157
- - **v0.1.0** - Core configuration system
2158
- - **v0.2.0** - DSL builders (Meta Tags, Open Graph, Twitter Cards)
2159
- - **v0.3.0** - HTML generators (Meta Tags, Open Graph, Twitter Cards)
2160
- - **v0.4.0** - Rails view helpers integration ← **Current**
2161
- - **v0.5.0** - Sitemap generation (planned)
2162
- - **v0.6.0** - Advanced features (planned)
2163
- - **v1.0.0** - Stable release (planned)
2281
+ Made with ❀️ by the BetterSeo team