Files
archived-hc-harbor/app/views/layouts/application.html.erb
2025-06-08 21:21:56 -04:00

191 lines
8.5 KiB
Plaintext

<!DOCTYPE html>
<html class="<%= Rails.env == "production" ? "production" : "development" %>">
<head>
<title><%= @page_title || content_for(:title) || "Hackatime" %></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">
<!-- SEO Meta Tags -->
<meta name="description" content="<%= @meta_description || content_for(:meta_description) || 'Track your coding time easily with Hackatime. A free tool to see how much time you spend programming in different languages and editors. Better than WakaTime and totally free!' %>">
<meta name="keywords" content="<%= @meta_keywords || content_for(:meta_keywords) || 'coding time tracker, programming stats, wakatime alternative, free time tracking, code statistics, developer analytics, programming time, coding productivity' %>">
<meta name="author" content="Hack Club">
<meta name="robots" content="index, follow">
<link rel="canonical" href="<%= content_for(:canonical_url) || request.original_url %>">
<!-- Enhanced SEO -->
<meta name="theme-color" content="#ec3750">
<meta name="msapplication-TileColor" content="#ec3750">
<!-- Open Graph Tags -->
<meta property="og:title" content="<%= @og_title || content_for(:og_title) || @page_title || content_for(:title) || 'Hackatime - Free Coding Time Tracker' %>">
<meta property="og:description" content="<%= @og_description || content_for(:og_description) || @meta_description || content_for(:meta_description) || 'Track your coding time easily with Hackatime. A free tool to see how much time you spend programming. Better than WakaTime!' %>">
<meta property="og:url" content="<%= content_for(:og_url) || request.original_url %>">
<meta property="og:type" content="<%= content_for(:og_type) || 'website' %>">
<meta property="og:image" content="<%= content_for(:og_image) || asset_path('favicon.png') %>">
<meta property="og:image:width" content="1200">
<meta property="og:image:height" content="630">
<meta property="og:site_name" content="Hackatime">
<meta property="og:locale" content="en_US">
<!-- Twitter Card Tags -->
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="@hackclub">
<meta name="twitter:creator" content="@hackclub">
<meta name="twitter:title" content="<%= @twitter_title || content_for(:twitter_title) || @page_title || content_for(:title) || 'Hackatime - Free Coding Time Tracker' %>">
<meta name="twitter:description" content="<%= @twitter_description || content_for(:twitter_description) || @meta_description || content_for(:meta_description) || 'Track your coding time easily with Hackatime. A free tool to see how much time you spend programming. Better than WakaTime!' %>">
<meta name="twitter:image" content="<%= content_for(:twitter_image) || asset_path('favicon.png') %>">
<%= csrf_meta_tags %>
<%= csp_meta_tag %>
<%= yield :head %>
<!-- JSON-LD Structured Data -->
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "SoftwareApplication",
"name": "Hackatime",
"applicationCategory": "DeveloperApplication",
"operatingSystem": "Any",
"description": "Track your coding time easily with Hackatime. A free tool to see how much time you spend programming in different languages and editors.",
"url": "https://hackatime.hackclub.com",
"downloadUrl": "https://hackatime.hackclub.com",
"author": {
"@type": "Organization",
"name": "Hack Club",
"url": "https://hackclub.com"
},
"softwareVersion": "2.0",
"datePublished": "2025-01-01",
"license": "https://opensource.org/licenses/MIT",
"programmingLanguage": "Ruby",
"codeRepository": "https://github.com/hackclub/hackatime",
"supportingData": "Free coding time tracker",
"featureList": [
"Track coding time across 75+ editors",
"See which languages you use most",
"View daily coding statistics",
"Compare with other high schoolers",
"Free and open source"
]
}
</script>
<!-- Organization Schema -->
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Organization",
"name": "Hack Club",
"url": "https://hackclub.com",
"logo": "https://hackclub.com/logo.png",
"sameAs": [
"https://twitter.com/hackclub",
"https://github.com/hackclub"
]
}
</script>
<!-- FAQ Schema for Homepage -->
<% if request.path == "/" %>
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "FAQPage",
"mainEntity": [
{
"@type": "Question",
"name": "What is Hackatime?",
"acceptedAnswer": {
"@type": "Answer",
"text": "Hackatime is a free coding time tracker that helps you see how much time you spend programming. It tracks your coding time across different languages and editors."
}
},
{
"@type": "Question",
"name": "Is Hackatime free?",
"acceptedAnswer": {
"@type": "Answer",
"text": "Yes! Hackatime is completely free to use. There are no paid plans or hidden costs."
}
},
{
"@type": "Question",
"name": "How is Hackatime different from WakaTime?",
"acceptedAnswer": {
"@type": "Answer",
"text": "Hackatime is free and open source, while WakaTime has paid plans. Hackatime gives you all features for free and you can host it yourself."
}
}
]
}
</script>
<% end %>
<%# Enable PWA manifest for installable apps (make sure to enable in config/routes.rb too!) %>
<%#= tag.link rel: "manifest", href: pwa_manifest_path(format: :json) %>
<%= favicon_link_tag asset_path('favicon.png'), type: 'image/png' %>
<script defer data-domain="hackatime.hackclub.com" src="https://plausible.io/js/script.file-downloads.hash.js"></script>
<%# Includes all stylesheet files in app/assets/stylesheets %>
<%= stylesheet_link_tag :app %>
<%= javascript_importmap_tags %>
<%= Sentry.get_trace_propagation_meta.html_safe %>
</head>
<body class="<%= content_for(:body_class) %>" style="display: flex;" data-controller="nav">
<!-- Mobile nav toggle button -->
<button class="nav-toggle" data-action="click->nav#toggle">Menu</button>
<!-- Mobile nav overlay -->
<div class="nav-overlay" data-nav-target="overlay" data-action="click->nav#close"></div>
<%= render "shared/nav" %>
<!-- 250px is defined in nav.css -->
<main>
<%= yield %>
<footer>
<div class="container">
<p>
Build <%= link_to Rails.application.config.git_version, Rails.application.config.commit_link %>
from <%= time_ago_in_words(Rails.application.config.server_start_time) %> ago.
<%= pluralize(Heartbeat.recent_count, 'heartbeat') %>
(<%= Heartbeat.recent_imported_count %> imported)
in the last 24 hours.
(DB: <%= pluralize(QueryCount::Counter.counter, "query") %>, <%= QueryCount::Counter.counter_cache %> cached)
(CACHE: <%= cache_stats[:hits] %> hits, <%= cache_stats[:misses] %> misses)
</p>
<% if session[:impersonater_user_id] %>
<%= link_to "Stop impersonating", stop_impersonating_path, class: "impersonate-link", data: { turbo_prefetch: "false" } %>
<% end %>
</div>
<%= render "static_pages/active_users_graph", hours: active_users_graph_data %>
</footer>
</main>
<div class="currently-hacking-container"
data-controller="currently-hacking"
data-currently-hacking-target="container"
data-currently-hacking-url-value="<%= currently_hacking_static_pages_path %>"
data-currently-hacking-interval-value="60000">
<div class="currently-hacking">
<div class="currently-hacking-header">
<span>
<div class="live-indicator"></div>
<span data-currently-hacking-target="count">
<%= pluralize(Cache::CurrentlyHackingJob.perform_now[:users].count, "person") %> currently hacking
</span>
</span>
</div>
</div>
<%= turbo_frame_tag "currently_hacking", src: currently_hacking_static_pages_path, 'no-spinner' => true do %>
<% end %>
</div>
</body>
</html>