Skip to content

Server driven meta tags #240

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 38 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
e719c95
Add server managed meta tags to the page object
bknoles Apr 24, 2025
58f417f
Add shared meta tags, similar to shared props
bknoles Apr 25, 2025
22ce34b
Naming things is important
bknoles Apr 25, 2025
a8b0b37
Local assigns doesn't work here so let's use a controller instance va…
bknoles Apr 26, 2025
25cb5bb
head-key is awkward to consume in JS and doesn't offer any benefits s…
bknoles Apr 26, 2025
9ef9056
React and Vue both know how to deal with camelCase so let's use that …
bknoles May 1, 2025
0d752d7
Instead of overloading the content key, use an inner_content for what…
bknoles May 2, 2025
9e6c2b4
Allow a shortened version of the title meta tag
bknoles May 2, 2025
d72efad
Only compute a single title tag
bknoles May 2, 2025
4919b72
Refactor inertia meta to use a controller instance method instead of …
bknoles Jun 20, 2025
45d3604
Use props._inertia_meta instead of adding a meta key to the top level…
bknoles Jun 20, 2025
4fb200b
Extra code cleanup from the redesign to use instance variables for me…
bknoles Jun 20, 2025
19735cd
Intelligently dedup meta tags without requiring head_key
bknoles Jun 24, 2025
8af1ebc
Opt-out functionality for automatic meta tag de-duping
bknoles Jun 24, 2025
3d0f9f9
Code cleanup
bknoles Jun 24, 2025
016112f
De-duplication must come from the head key to work client side
bknoles Jun 25, 2025
f218388
Allow clearing of meta tags
bknoles Jul 1, 2025
8127bfe
Add documentation for server managed meta tags
bknoles Jul 7, 2025
316b7a9
Add inertia tag to title with Svelte since server managed tags use it
bknoles Jul 7, 2025
fb4eb47
Prettier fixes for docs
bknoles Jul 7, 2025
591cbe9
Small docs clarification
bknoles Jul 7, 2025
87c1dc3
Appease the rubocop
bknoles Jul 7, 2025
ab16708
Fix method signature to match what earlier Rails versions expect
bknoles Jul 7, 2025
3cb496f
Fix Rubocop error
bknoles Jul 7, 2025
987b3db
Wrap Vue meta tag component in a function
bknoles Jul 10, 2025
747c48e
Rework script tag safety. JSON-LD gets through, everything else gets …
bknoles Jul 10, 2025
4e711d7
Docs updates for JSON LD
bknoles Jul 10, 2025
d91ad71
Update docs/guide/title-and-meta.md
bknoles Jul 10, 2025
4f886ff
Use **options to simplify extentions
skryukov Jul 24, 2025
82b52c9
Nitpicks
skryukov Jul 24, 2025
0ba12bf
More refactorings
skryukov Jul 24, 2025
84cf765
Make rubocop happy
skryukov Jul 24, 2025
0e3e274
Rails 8, whats your problem?
skryukov Jul 24, 2025
5b4b97a
Update rubocop todo
skryukov Jul 25, 2025
d22cad9
Merge pull request #243 from skryukov/server-driven-meta-tags-revamp
bknoles Jul 25, 2025
bacdb5e
Update docs to guide users to avoid duplicate title tags when using I…
bknoles Jul 26, 2025
1df7a06
Ensure default render path works with meta options
bknoles Jul 26, 2025
816655c
You win again, rubocop
bknoles Jul 26, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This configuration was generated by
# `rubocop --auto-gen-config --exclude-limit 10000`
# on 2025-04-10 07:56:29 UTC using RuboCop version 1.75.2.
# on 2025-07-25 08:41:37 UTC using RuboCop version 1.79.0.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
Expand Down Expand Up @@ -44,7 +44,7 @@ Layout/ExtraSpacing:
- 'spec/inertia/request_spec.rb'
- 'spec/inertia/response_spec.rb'

# Offense count: 2
# Offense count: 16
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: IndentationWidth.
# SupportedStyles: special_inside_parentheses, consistent, align_braces
Expand Down Expand Up @@ -184,8 +184,8 @@ Style/BlockDelimiters:
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: EnforcedStyle, EnforcedStyleForClasses, EnforcedStyleForModules.
# SupportedStyles: nested, compact
# SupportedStylesForClasses: , nested, compact
# SupportedStylesForModules: , nested, compact
# SupportedStylesForClasses: ~, nested, compact
# SupportedStylesForModules: ~, nested, compact
Style/ClassAndModuleChildren:
Exclude:
- 'lib/inertia_rails/helper.rb'
Expand Down Expand Up @@ -404,7 +404,7 @@ Style/SoleNestedConditional:
Exclude:
- 'lib/inertia_rails/controller.rb'

# Offense count: 78
# Offense count: 81
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline.
# SupportedStyles: single_quotes, double_quotes
Expand Down Expand Up @@ -434,7 +434,7 @@ Style/StringLiterals:
- 'spec/inertia/rspec_helper_spec.rb'
- 'spec/rails_helper.rb'

# Offense count: 2
# Offense count: 3
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: .
# SupportedStyles: percent, brackets
Expand Down Expand Up @@ -466,9 +466,9 @@ Style/TrailingCommaInHashLiteral:
- 'spec/inertia/response_spec.rb'
- 'spec/inertia/rspec_helper_spec.rb'

# Offense count: 19
# Offense count: 32
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns, SplitStrings.
# Configuration parameters: AllowHeredoc, AllowURI, AllowQualifiedName, URISchemes, IgnoreCopDirectives, AllowedPatterns, SplitStrings.
# URISchemes: http, https
Layout/LineLength:
Max: 276
9 changes: 9 additions & 0 deletions docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,15 @@ export default defineConfig({
{ text: 'Inertia Modal', link: '/cookbook/inertia-modal' },
],
},
{
text: 'Inertia-Rails-Only Features',
items: [
{
text: 'Server Managed Meta Tags',
link: '/cookbook/server-managed-meta-tags',
},
],
},
{
text: 'Troubleshooting',
items: [
Expand Down
Loading