diff --git a/app/controllers/docs_controller.rb b/app/controllers/docs_controller.rb
index cefc25c08..6e69b23c1 100644
--- a/app/controllers/docs_controller.rb
+++ b/app/controllers/docs_controller.rb
@@ -1,6 +1,8 @@
class DocsController < InertiaController
layout "inertia"
+ inertia_share docs_nav: -> { docs_nav_props }
+
POPULAR_EDITORS = [
[ "VS Code", "vs-code" ], [ "PyCharm", "pycharm" ], [ "IntelliJ IDEA", "intellij-idea" ],
[ "Sublime Text", "sublime-text" ], [ "Vim", "vim" ], [ "Neovim", "neovim" ],
@@ -104,6 +106,36 @@ def show
private
+ def docs_nav_props
+ current_path = request.path
+ {
+ current_path: current_path,
+ home_url: docs_path,
+ api_docs_url: "/api-docs",
+ github_url: "https://github.com/hackclub/hackatime",
+ slack_url: "https://hackclub.slack.com/archives/C07MQ845X1F",
+ sections: [
+ {
+ title: "Getting Started",
+ links: [
+ { label: "Quick Start", href: doc_path("getting-started/quick-start") },
+ { label: "Installation", href: doc_path("getting-started/installation") },
+ { label: "Configuration", href: doc_path("getting-started/configuration") }
+ ]
+ },
+ {
+ title: "Developers",
+ links: [
+ { label: "API Docs", href: "/api-docs/" },
+ { label: "OAuth Apps", href: doc_path("oauth/oauth-apps") }
+ ]
+ }
+ ],
+ popular_editors: POPULAR_EDITORS,
+ all_editors: ALL_EDITORS
+ }
+ end
+
def sanitize_path(path)
# Remove any directory traversal attempts and normalize path
return "index" if path.blank?
diff --git a/app/controllers/extensions_controller.rb b/app/controllers/extensions_controller.rb
deleted file mode 100644
index a17528106..000000000
--- a/app/controllers/extensions_controller.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-class ExtensionsController < InertiaController
- layout "inertia"
-
- def index
- render inertia: "Extensions/Index"
- end
-end
diff --git a/app/controllers/inertia_controller.rb b/app/controllers/inertia_controller.rb
index 1a5f2a6fd..aa889a779 100644
--- a/app/controllers/inertia_controller.rb
+++ b/app/controllers/inertia_controller.rb
@@ -71,13 +71,13 @@ def inertia_primary_links
if current_user
links << inertia_link("Projects", my_projects_path, active: request.path.start_with?("/my/projects"), inertia: true)
links << inertia_link("Docs", docs_path, active: helpers.current_page?(docs_path) || request.path.start_with?("/docs"), inertia: true)
- links << inertia_link("Extensions", extensions_path, active: helpers.current_page?(extensions_path), inertia: true)
+ links << inertia_link("Setup", my_wakatime_setup_path, active: helpers.current_page?(my_wakatime_setup_path), inertia: true)
links << inertia_link("Settings", my_settings_path, active: request.path.start_with?("/my/settings"), inertia: true)
links << inertia_link("My OAuth Apps", oauth_applications_path, active: helpers.current_page?(oauth_applications_path) || request.path.start_with?("/oauth/applications"), inertia: true)
links << { label: "Logout", action: "logout" }
else
links << inertia_link("Docs", docs_path, active: helpers.current_page?(docs_path) || request.path.start_with?("/docs"), inertia: true)
- links << inertia_link("Extensions", extensions_path, active: helpers.current_page?(extensions_path), inertia: true)
+ links << inertia_link("Setup", my_wakatime_setup_path, active: helpers.current_page?(my_wakatime_setup_path), inertia: true)
end
links
diff --git a/app/helpers/extensions_helper.rb b/app/helpers/extensions_helper.rb
deleted file mode 100644
index 383b12c96..000000000
--- a/app/helpers/extensions_helper.rb
+++ /dev/null
@@ -1,2 +0,0 @@
-module ExtensionsHelper
-end
diff --git a/app/javascript/layouts/AppLayout.svelte b/app/javascript/layouts/AppLayout.svelte
index 4a8dc081e..e1b1d7bcb 100644
--- a/app/javascript/layouts/AppLayout.svelte
+++ b/app/javascript/layouts/AppLayout.svelte
@@ -153,8 +153,7 @@
const navLinkWithToolClass = (link: NavLink, toolClass = "") =>
`${navLinkClass(link.active)}${toolClass ? ` ${toolClass}` : ""}`;
- const isLongCachedLink = (link: NavLink) =>
- link.label === "Docs" || link.label === "Extensions";
+ const isLongCachedLink = (link: NavLink) => link.label === "Docs";
const linkCacheFor = (link: NavLink): string | [string, string] =>
isLongCachedLink(link) ? "10m" : ["0s", "30s"];
diff --git a/app/javascript/layouts/DocsLayout.svelte b/app/javascript/layouts/DocsLayout.svelte
new file mode 100644
index 000000000..f393ae939
--- /dev/null
+++ b/app/javascript/layouts/DocsLayout.svelte
@@ -0,0 +1,311 @@
+
+
+
+
+
+
+
+
+
- Free, open-source time tracking for Hack Club. Like WakaTime, but free. -
-+ Learn how to use Hackatime, the open-source time tracking tool from Hack + Club. +
+- Set up in under a minute +
+ Personalised setup for your editor in under a minute.
- +Add to your editor
- ++ Step-by-step instructions for every supported editor. +
+Interactive reference
- + ++ Interactive Swagger reference for the public API. +
+Build integrations
- -+ Build integrations on top of Hackatime's OAuth provider. +
+- Need help? Ask in - #hackatime-help - on Slack or - open an issue - on GitHub. -
+ +- Third-party tools created by the community. - - * Not guaranteed to work. - -
-- {extension.description} -
- - -