diff --git a/app/controllers/sitemap_controller.rb b/app/controllers/sitemap_controller.rb new file mode 100644 index 0000000..981baac --- /dev/null +++ b/app/controllers/sitemap_controller.rb @@ -0,0 +1,7 @@ +class SitemapController < ApplicationController + def sitemap + respond_to do |format| + format.xml { render layout: false } + end + end +end diff --git a/app/controllers/static_pages_controller.rb b/app/controllers/static_pages_controller.rb index f8d3f1b..77c6368 100644 --- a/app/controllers/static_pages_controller.rb +++ b/app/controllers/static_pages_controller.rb @@ -67,6 +67,9 @@ class StaticPagesController < ApplicationController instance_variable_set("@#{key}", value) end else + # Set homepage SEO content for logged-out users only + set_homepage_seo_content + @usage_social_proof = Cache::UsageSocialProofJob.perform_now @home_stats = Cache::HomeStatsJob.perform_now @@ -204,6 +207,16 @@ class StaticPagesController < ApplicationController redirect_to root_path, alert: "You must be logged in to view this page" unless current_user end + def set_homepage_seo_content + @page_title = "Hackatime - Free Coding Time Tracker | Track Your Programming Time" + @meta_description = "Track your coding time easily with Hackatime. See how long you spend programming in different languages. Free alternative to WakaTime. Join thousands of high schoolers!" + @meta_keywords = "coding time tracker, programming stats, wakatime alternative, free time tracking, code statistics, high school programming, coding analytics" + @og_title = "Hackatime - Free Coding Time Tracker" + @og_description = "Track your coding time easily with Hackatime. See how long you spend programming. Free and better than WakaTime!" + @twitter_title = "Hackatime - Free Coding Time Tracker" + @twitter_description = "Track your coding time easily with Hackatime. See how long you spend programming. Free and better than WakaTime!" + end + def filterable_dashboard_data filters = %i[project language operating_system editor category] diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 80a5f53..e7f4438 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -1,36 +1,138 @@ ">
-