From 2742dba7fa0ab2fc17f71a27dbde1923be62e2d7 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Mon, 1 Dec 2025 13:54:54 +0000 Subject: [PATCH] feat: Add meta descriptions to pages Adds a meta description tag to the landing, crops, plantings, harvests, seeds, and comments pages. Also creates a new index page for comments. --- app/views/comments/index.html.haml | 13 +++++++++++++ app/views/crops/index.html.haml | 1 + app/views/harvests/index.html.haml | 1 + app/views/home/index.html.haml | 2 ++ app/views/layouts/_head.html.haml | 4 ++++ app/views/plantings/index.html.haml | 1 + app/views/seeds/index.html.haml | 1 + 7 files changed, 23 insertions(+) create mode 100644 app/views/comments/index.html.haml diff --git a/app/views/comments/index.html.haml b/app/views/comments/index.html.haml new file mode 100644 index 000000000..280252e66 --- /dev/null +++ b/app/views/comments/index.html.haml @@ -0,0 +1,13 @@ +- content_for :title, "Comments" +- content_for :meta_description, "Browse and search for comments." +- content_for :breadcrumbs do + %li.breadcrumb-item.active= link_to "Comments", comments_path + +%h1 Comments + += will_paginate @comments + +- @comments.each do |comment| + = render 'single', comment: comment + += will_paginate @comments diff --git a/app/views/crops/index.html.haml b/app/views/crops/index.html.haml index 9d0425588..6b588b1cf 100644 --- a/app/views/crops/index.html.haml +++ b/app/views/crops/index.html.haml @@ -1,4 +1,5 @@ - content_for :title, t('.title') +- content_for :meta_description, "Browse and search for crops." - content_for :buttonbar do - if can? :wrangle, Crop diff --git a/app/views/harvests/index.html.haml b/app/views/harvests/index.html.haml index 9c5ad8c69..7038e5249 100644 --- a/app/views/harvests/index.html.haml +++ b/app/views/harvests/index.html.haml @@ -1,5 +1,6 @@ - content_for(:title) do = title('harvests', @owner, @crop, @planting) +- content_for :meta_description, "Browse and search for harvests." - content_for :breadcrumbs do - if @owner %li.breadcrumb-item= link_to 'Harvests', harvests_path diff --git a/app/views/home/index.html.haml b/app/views/home/index.html.haml index d54f92ec7..5fd22b22d 100644 --- a/app/views/home/index.html.haml +++ b/app/views/home/index.html.haml @@ -1,5 +1,7 @@ - content_for :title do = ENV['GROWSTUFF_SITE_NAME'] +- content_for :meta_description do + Growstuff is a community of food gardeners. Let's learn to grow food together. - if member_signed_in? .row diff --git a/app/views/layouts/_head.html.haml b/app/views/layouts/_head.html.haml index e3058ad55..5c66460e4 100644 --- a/app/views/layouts/_head.html.haml +++ b/app/views/layouts/_head.html.haml @@ -27,6 +27,10 @@ %title = content_for?(:title) ? yield(:title) + " - #{ENV['GROWSTUFF_SITE_NAME']} " : ENV['GROWSTUFF_SITE_NAME'] + - if content_for?(:meta_description) + %meta{name: "description", content: yield(:meta_description)} + - else + %meta{name: "description", content: "Growstuff is a community of food gardeners. Let's learn to grow food together."} = csrf_meta_tags = stylesheet_link_tag "application", media: "all" diff --git a/app/views/plantings/index.html.haml b/app/views/plantings/index.html.haml index fb6cf6d25..9d01c9b3e 100644 --- a/app/views/plantings/index.html.haml +++ b/app/views/plantings/index.html.haml @@ -1,4 +1,5 @@ - content_for :title, title('plantings', @owner, @crop, @planting) +- content_for :meta_description, "Browse and search for plantings." - content_for :breadcrumbs do - if @owner diff --git a/app/views/seeds/index.html.haml b/app/views/seeds/index.html.haml index a05f54362..619379779 100644 --- a/app/views/seeds/index.html.haml +++ b/app/views/seeds/index.html.haml @@ -6,6 +6,7 @@ %li.breadcrumb-item.active= link_to 'Seeds', seeds_path - content_for :title, title('seeds', @owner, @crop, @planting) +- content_for :meta_description, "Browse and search for seeds." .row .col-md-2