Temporarily disable weekly summaries (#1012)

* Bit of SEO stuff + disable weekly summaries for now

* Update bundle
This commit is contained in:
Mahad Kalam 2026-02-28 23:41:57 +00:00 committed by GitHub
parent 66f928ca24
commit afb7e260e8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 85 additions and 55 deletions

View file

@ -77,7 +77,7 @@ GEM
securerandom (>= 0.3)
tzinfo (~> 2.0, >= 2.0.5)
uri (>= 0.13.1)
addressable (2.8.8)
addressable (2.8.9)
public_suffix (>= 2.0.2, < 8.0)
ast (2.4.3)
autotuner (1.1.0)
@ -94,7 +94,7 @@ GEM
bindex (0.8.1)
bootsnap (1.23.0)
msgpack (~> 1.2)
brakeman (8.0.2)
brakeman (8.0.4)
racc
builder (3.3.0)
bullet (8.1.0)
@ -141,7 +141,7 @@ GEM
drb (2.2.3)
dry-cli (1.4.1)
ed25519 (1.4.0)
erb (6.0.1)
erb (6.0.2)
erb_lint (0.9.0)
activesupport
better_html (>= 2.0.1)
@ -179,14 +179,14 @@ GEM
ffi (>= 1.15.5)
rake
flamegraph (0.9.5)
flipper (1.3.6)
flipper (1.4.0)
concurrent-ruby (< 2)
flipper-active_record (1.3.6)
flipper-active_record (1.4.0)
activerecord (>= 4.2, < 9)
flipper (~> 1.3.6)
flipper-ui (1.3.6)
flipper (~> 1.4.0)
flipper-ui (1.4.0)
erubi (>= 1.0.0, < 2.0.0)
flipper (~> 1.3.6)
flipper (~> 1.4.0)
rack (>= 1.4, < 4)
rack-protection (>= 1.5.3, < 5.0.0)
rack-session (>= 1.0.2, < 3.0.0)
@ -283,11 +283,14 @@ GEM
net-smtp
marcel (1.1.0)
matrix (0.4.3)
mcp (0.7.1)
json-schema (>= 4.1)
memory_profiler (1.1.0)
mini_magick (5.3.1)
logger
mini_mime (1.1.5)
minitest (6.0.1)
minitest (6.0.2)
drb (~> 2.0)
prism (~> 1.5)
msgpack (1.8.0)
multipart-post (2.4.1)
@ -406,8 +409,8 @@ GEM
activesupport (>= 5.0.0)
minitest
nokogiri (>= 1.6)
rails-html-sanitizer (1.6.2)
loofah (~> 2.21)
rails-html-sanitizer (1.7.0)
loofah (~> 2.25)
nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
railties (8.1.2)
actionpack (= 8.1.2)
@ -436,7 +439,7 @@ GEM
rspec-expectations (3.13.5)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-mocks (3.13.7)
rspec-mocks (3.13.8)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-rails (8.0.3)
@ -459,10 +462,11 @@ GEM
rswag-ui (2.17.0)
actionpack (>= 5.2, < 8.2)
railties (>= 5.2, < 8.2)
rubocop (1.84.2)
rubocop (1.85.0)
json (~> 2.3)
language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.1.0)
mcp (~> 0.6)
parallel (~> 1.10)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
@ -504,10 +508,10 @@ GEM
rexml (~> 3.2, >= 3.2.5)
rubyzip (>= 1.2.2, < 4.0)
websocket (~> 1.0)
sentry-rails (6.3.1)
sentry-rails (6.4.0)
railties (>= 5.2.0)
sentry-ruby (~> 6.3.1)
sentry-ruby (6.3.1)
sentry-ruby (~> 6.4.0)
sentry-ruby (6.4.0)
bigdecimal
concurrent-ruby (~> 1.0, >= 1.0.2)
logger
@ -530,13 +534,13 @@ GEM
activejob (>= 7.2)
activerecord (>= 7.2)
railties (>= 7.2)
sqlite3 (2.9.0-aarch64-linux-gnu)
sqlite3 (2.9.0-aarch64-linux-musl)
sqlite3 (2.9.0-arm-linux-gnu)
sqlite3 (2.9.0-arm-linux-musl)
sqlite3 (2.9.0-arm64-darwin)
sqlite3 (2.9.0-x86_64-linux-gnu)
sqlite3 (2.9.0-x86_64-linux-musl)
sqlite3 (2.9.1-aarch64-linux-gnu)
sqlite3 (2.9.1-aarch64-linux-musl)
sqlite3 (2.9.1-arm-linux-gnu)
sqlite3 (2.9.1-arm-linux-musl)
sqlite3 (2.9.1-arm64-darwin)
sqlite3 (2.9.1-x86_64-linux-gnu)
sqlite3 (2.9.1-x86_64-linux-musl)
sshkit (1.25.0)
base64
logger
@ -579,17 +583,16 @@ GEM
vite_rails (3.0.20)
railties (>= 5.1, < 9)
vite_ruby (~> 3.0, >= 3.2.2)
vite_ruby (3.9.2)
vite_ruby (3.9.3)
dry-cli (>= 0.7, < 2)
logger (~> 1.6)
mutex_m
rack-proxy (~> 0.6, >= 0.6.1)
zeitwerk (~> 2.2)
web-console (4.2.1)
actionview (>= 6.0.0)
activemodel (>= 6.0.0)
web-console (4.3.0)
actionview (>= 8.0.0)
bindex (>= 0.4.0)
railties (>= 6.0.0)
railties (>= 8.0.0)
webmock (3.26.1)
addressable (>= 2.8.0)
crack (>= 0.3.2)

View file

@ -45,6 +45,9 @@ class DocsController < InertiaController
# Docs are publicly accessible - no authentication required
def index
@page_title = "Hackatime Docs - Setup Guides for 75+ Code Editors & IDEs"
@meta_description = "Get started with Hackatime in minutes. Step-by-step setup guides for VS Code, JetBrains, vim, Neovim, Sublime Text, and 70+ more editors and IDEs."
render inertia: "Docs/Index", props: {
popular_editors: POPULAR_EDITORS,
all_editors: ALL_EDITORS

View file

@ -129,8 +129,8 @@ class StaticPagesController < InertiaController
private
def set_homepage_seo_content
@page_title = @og_title = @twitter_title = "Hackatime - See How Much You Code"
@meta_description = @og_description = @twitter_description = "Free and open source. Works with VS Code, JetBrains IDEs, vim, emacs, and 70+ other editors. Built and made free for teenagers by Hack Club."
@page_title = @og_title = @twitter_title = "Hackatime - Track How Much You Code | Free & Open Source"
@meta_description = @og_description = @twitter_description = "Free and open-source coding time tracker. Works with VS Code, JetBrains, vim, emacs, and 70+ editors. Built by Hack Club for teenage developers."
@meta_keywords = "coding time tracker, programming stats, open source time tracker, hack club coding tracker, free time tracking, code statistics, high school programming, coding analytics"
end

View file

@ -2,27 +2,29 @@ class WeeklySummaryEmailJob < ApplicationJob
queue_as :literally_whenever
def perform(reference_time = Time.current)
now_utc = reference_time.utc
return unless send_window?(now_utc)
# See https://hackclub.slack.com/archives/D083UR1DR7V/p1772321709715969
User.where(weekly_summary_email_enabled: true).find_each do |user|
recipient_email = user.email_addresses.order(:id).pick(:email)
next if recipient_email.blank?
# now_utc = reference_time.utc
# return unless send_window?(now_utc)
user_timezone = ActiveSupport::TimeZone[user.timezone] || ActiveSupport::TimeZone["UTC"]
user_now = now_utc.in_time_zone(user_timezone)
ends_at_local = user_now.beginning_of_week(:monday)
starts_at_local = ends_at_local - 1.week
# User.where(weekly_summary_email_enabled: true).find_each do |user|
# recipient_email = user.email_addresses.order(:id).pick(:email)
# next if recipient_email.blank?
WeeklySummaryMailer.weekly_summary(
user,
recipient_email: recipient_email,
starts_at: starts_at_local.utc,
ends_at: ends_at_local.utc
).deliver_now
rescue StandardError => e
Rails.logger.error("Weekly summary email failed for user #{user.id}: #{e.class} #{e.message}")
end
# user_timezone = ActiveSupport::TimeZone[user.timezone] || ActiveSupport::TimeZone["UTC"]
# user_now = now_utc.in_time_zone(user_timezone)
# ends_at_local = user_now.beginning_of_week(:monday)
# starts_at_local = ends_at_local - 1.week
# WeeklySummaryMailer.weekly_summary(
# user,
# recipient_email: recipient_email,
# starts_at: starts_at_local.utc,
# ends_at: ends_at_local.utc
# ).deliver_now
# rescue StandardError => e
# Rails.logger.error("Weekly summary email failed for user #{user.id}: #{e.class} #{e.message}")
# end
end
private

View file

@ -1,7 +1,7 @@
<!DOCTYPE html>
<html class="<%= Rails.env == 'production' ? 'production' : 'development' %>" data-theme="<%= current_theme %>">
<html lang="en" class="<%= Rails.env == 'production' ? 'production' : 'development' %>" data-theme="<%= current_theme %>">
<head>
<title><%= @page_title || content_for(:title) || 'Hackatime' %></title>
<title><%= @page_title || content_for(:title) || 'Hackatime - Free & Open Source Coding Time Tracker' %></title>
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="mobile-web-app-capable" content="yes">
@ -158,6 +158,7 @@
<%#= tag.link rel: "manifest", href: pwa_manifest_path(format: :json) %>
<%= favicon_link_tag asset_path('favicon.png'), type: 'image/png' %>
<link rel="apple-touch-icon" href="<%= asset_path('favicon.png') %>">
<script defer data-domain="hackatime.hackclub.com" src="https://plausible.io/js/script.file-downloads.hash.js"></script>

View file

@ -1,5 +1,5 @@
<!DOCTYPE html>
<html class="<%= Rails.env == 'production' ? 'production' : 'development' %>" data-theme="<%= current_theme %>">
<html lang="en" class="<%= Rails.env == 'production' ? 'production' : 'development' %>" data-theme="<%= current_theme %>">
<head>
<title><%= @title %> - Hackatime</title>
<meta name="viewport" content="width=device-width,initial-scale=1">

View file

@ -1,7 +1,7 @@
<!DOCTYPE html>
<html class="<%= Rails.env == 'production' ? 'production' : 'development' %>" data-theme="<%= current_theme %>">
<html lang="en" class="<%= Rails.env == 'production' ? 'production' : 'development' %>" data-theme="<%= current_theme %>">
<head>
<title><%= @page_title || content_for(:title) || 'Hackatime' %></title>
<title><%= @page_title || content_for(:title) || 'Hackatime - Free & Open Source Coding Time Tracker' %></title>
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="mobile-web-app-capable" content="yes">
@ -149,6 +149,7 @@
<% end %>
<%= favicon_link_tag asset_path('favicon.png'), type: 'image/png' %>
<link rel="apple-touch-icon" href="<%= asset_path('favicon.png') %>">
<% if include_external_scripts %>
<script defer data-domain="hackatime.hackclub.com" src="https://plausible.io/js/script.file-downloads.hash.js"></script>

View file

@ -7,7 +7,7 @@
<priority>1.0</priority>
</url>
<url>
<loc>https://hackatime.hackclub.com/leaderboard</loc>
<loc>https://hackatime.hackclub.com/leaderboards</loc>
<lastmod><%= Date.current.iso8601 %></lastmod>
<changefreq>hourly</changefreq>
<priority>0.8</priority>
@ -18,4 +18,22 @@
<changefreq>weekly</changefreq>
<priority>0.7</priority>
</url>
<url>
<loc>https://hackatime.hackclub.com/signin</loc>
<lastmod><%= Date.current.iso8601 %></lastmod>
<changefreq>monthly</changefreq>
<priority>0.5</priority>
</url>
<url>
<loc>https://hackatime.hackclub.com/wakatime-alternative</loc>
<lastmod><%= Date.current.iso8601 %></lastmod>
<changefreq>monthly</changefreq>
<priority>0.7</priority>
</url>
<url>
<loc>https://hackatime.hackclub.com/extensions</loc>
<lastmod><%= Date.current.iso8601 %></lastmod>
<changefreq>weekly</changefreq>
<priority>0.6</priority>
</url>
</urlset>

View file

@ -115,6 +115,8 @@ Rails.application.routes.draw do
get "/auth/close_window", to: "sessions#close_window", as: :close_window
delete "signout", to: "sessions#destroy", as: "signout"
get "/leaderboard", to: redirect("/leaderboards", status: 301)
resources :leaderboards, only: [ :index ] do
get :entries, on: :collection
end

View file

@ -4,7 +4,7 @@ Allow: /
# Important pages for crawling
Allow: /docs
Allow: /docs/*
Allow: /leaderboard
Allow: /leaderboards
# Disallow private/internal pages
Disallow: /my/