feat: improve seo urls?

This commit is contained in:
kbe
2025-09-06 01:44:48 +02:00
parent fa99a167a5
commit 5105964b39
22 changed files with 702 additions and 367 deletions

View File

@@ -1,4 +1,62 @@
<div class="min-h-screen bg-gradient-to-br from-gray-50 to-gray-100">
<!-- SEO Meta Tags for Event -->
<% content_for :title, "#{@event.name} - #{@event.start_time.strftime('%d/%m/%Y')} | Aperonight" %>
<% content_for :description, @event.description.truncate(160) %>
<% content_for :keywords, "#{@event.name}, événement, soirée, #{@event.venue_name}, billets, réservation" %>
<% content_for :canonical_url, seo_event_path(@event) %>
<% content_for :og_image, @event.image if @event.image.present? %>
<!-- Structured Data for Event -->
<% content_for :head do %>
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Event",
"name": "<%= @event.name %>",
"description": "<%= strip_tags(@event.description) %>",
"startDate": "<%= @event.start_time.iso8601 %>",
"endDate": "<%= @event.end_time&.iso8601 || (@event.start_time + 4.hours).iso8601 %>",
"eventStatus": "https://schema.org/EventScheduled",
"eventAttendanceMode": "https://schema.org/OfflineEventAttendanceMode",
"location": {
"@type": "Place",
"name": "<%= @event.venue_name %>",
"address": {
"@type": "PostalAddress",
"streetAddress": "<%= @event.venue_address %>"
},
"geo": {
"@type": "GeoCoordinates",
"latitude": <%= @event.latitude %>,
"longitude": <%= @event.longitude %>
}
},
"organizer": {
"@type": "Organization",
"name": "<%= @event.user.company_name.present? ? @event.user.company_name : "#{@event.user.first_name} #{@event.user.last_name}" %>",
"email": "<%= @event.user.email %>"
},
<% if @event.image.present? %>
"image": [
"<%= @event.image %>"
],
<% end %>
"offers": [
<% @event.ticket_types.each_with_index do |ticket_type, index| %>
{
"@type": "Offer",
"name": "<%= ticket_type.name %>",
"price": "<%= ticket_type.price_cents / 100.0 %>",
"priceCurrency": "EUR",
"availability": "https://schema.org/InStock",
"url": "<%= seo_book_tickets_path(@event) %>"
}<%= ',' if index < @event.ticket_types.count - 1 %>
<% end %>
]
}
</script>
<% end %>
<div class="min-h-screen bg-gradient-to-br from-gray-50 to-gray-100">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8">
<!-- Breadcrumb -->
<nav class="mb-6" aria-label="Breadcrumb">
@@ -197,7 +255,7 @@
<!-- Right Column: Ticket Selection -->
<div class="lg:col-span-1">
<%= form_with url: event_order_new_path(@event.slug, @event.id), method: :get, id: "checkout_form", local: true, data: {
<%= form_with url: book_event_tickets_path(year: @event.start_time.year, month: format("%02d", @event.start_time.month), slug: @event.slug), method: :get, id: "checkout_form", local: true, data: {
controller: "ticket-selection",
ticket_selection_target: "form",
ticket_selection_event_slug_value: @event.slug,