From b870b661cc011889f471b717e3ba5e2ee41ad19f Mon Sep 17 00:00:00 2001
From: Luis Garcia
Date: Mon, 9 Dec 2024 10:58:38 -0500
Subject: [PATCH 1/3] landing page first render bugfix and code cleanup
---
docs/src/css/style.module.css | 21 ++++++++++++++++
docs/src/css/styles.css | 33 -------------------------
docs/src/pages/index.tsx | 46 ++++++-----------------------------
3 files changed, 29 insertions(+), 71 deletions(-)
delete mode 100644 docs/src/css/styles.css
diff --git a/docs/src/css/style.module.css b/docs/src/css/style.module.css
index e59a8a20..f0e12180 100644
--- a/docs/src/css/style.module.css
+++ b/docs/src/css/style.module.css
@@ -3,12 +3,33 @@
box-sizing: border-box;
}
+a {
+ color: inherit;
+ display: inline-block;
+}
+
+h1,
+h2,
+h3 {
+ line-height: 1.25;
+ font-weight: 500;
+}
+
.container {
width: 100%;
margin-inline: auto;
padding-inline: 12px;
}
+.landing-page-container {
+ margin: 0;
+ padding: 0;
+ color: #ffffff;
+ background-color: #121212;
+ font-family: "Chivo", sans-serif;
+ line-height: 1.5;
+}
+
@media (min-width: 576px) {
.container {
max-width: 540px;
diff --git a/docs/src/css/styles.css b/docs/src/css/styles.css
deleted file mode 100644
index 36272b9c..00000000
--- a/docs/src/css/styles.css
+++ /dev/null
@@ -1,33 +0,0 @@
-.remove-default-components nav.navbar.navbar--fixed-top {
- display: none !important;
-}
-
-.remove-default-components .footer.footer--dark {
- display: none !important;
-}
-
-.landing-page-container {
- margin: 0;
- padding: 0;
- color: #ffffff;
- background-color: #121212;
- font-family: "Chivo", sans-serif;
- line-height: 1.5;
-}
-
-.custom-a a {
- color: inherit;
- display: inline-block;
-}
-
-.custom-head h1,
-.custom-head h2,
-.custom-head h3 {
- line-height: 1.25;
- font-weight: 500;
-}
-
-/* .custom-img img {
- vertical-align: middle;
- width: 100%;
-} */
diff --git a/docs/src/pages/index.tsx b/docs/src/pages/index.tsx
index 1e5585c9..3fe97d2c 100644
--- a/docs/src/pages/index.tsx
+++ b/docs/src/pages/index.tsx
@@ -1,15 +1,8 @@
-import useDocusaurusContext from "@docusaurus/useDocusaurusContext";
-import Layout from "@theme/Layout";
-import { useLocation } from "react-router-dom";
-// There should be a line here that says
-// import React from "react";
-// VSCode might try to delete it, but that will break the site.
-import { useEffect, useState } from "react";
+import React from "react";
+import { useState } from "react";
import baseStyles from '../css/style.module.css';
-import "../css/styles.css";
function HomepageHeader() {
- const { siteConfig } = useDocusaurusContext();
const [isActive, setIsActive] = useState(false);
const toggleMenu = () => {
setIsActive((prevState) => !prevState);
@@ -40,27 +33,7 @@ function HomepageHeader() {
}
export default function Home(): JSX.Element {
- const { siteConfig } = useDocusaurusContext();
-
- const location = useLocation();
- const isBasePath = location.pathname === "/python-sdk/";
-
- useEffect(() => {
- // Add or remove the class on the tag
- const mainWrapper = document.querySelector('#__docusaurus')
-
- if (isBasePath) {
- mainWrapper.classList.add("remove-default-components", "landing-page-container", "custom-head", "custom-a", "custom-img");
- } else {
- mainWrapper.classList.remove("remove-default-components", "landing-page-container", "custom-head", "custom-a", "custom-img");
- }
-
- // Cleanup on component unmount
- return () => {
- mainWrapper.classList.remove("remove-default-components", "landing-page-container", "custom-head", "custom-a", "custom-img");
- };
- }, [isBasePath]);
-
+
const code = `import groundlight
from framegrab import FrameGrabber
@@ -77,12 +50,9 @@ image_query = gl.ask_confident(detector, image)
print(image_query)`;
// Split the code into lines
const codeLines = code.split("\n");
-
+
return (
-
+
@@ -94,7 +64,7 @@ print(image_query)`;
computer vision application. Groundlight’s fully managed computer vision solution takes care of the ML so
you can focus on building.
@@ -286,10 +256,10 @@ print(image_query)`;
- Copyright © {new Date().getFullYear()} Groundlight AI.
+ Copyright © 2024 Groundlight AI.
-
+
);
}
\ No newline at end of file
From 9065de8cd0a2ce2ac2c0297877b530dc14d9fc1a Mon Sep 17 00:00:00 2001
From: Tyler Romero
Date: Mon, 9 Dec 2024 10:02:16 -0800
Subject: [PATCH 2/3] Apply suggestions from code review
Quick fixes
---
docs/src/pages/index.tsx | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/docs/src/pages/index.tsx b/docs/src/pages/index.tsx
index 3fe97d2c..00fdea11 100644
--- a/docs/src/pages/index.tsx
+++ b/docs/src/pages/index.tsx
@@ -64,7 +64,7 @@ print(image_query)`;
computer vision application. Groundlight’s fully managed computer vision solution takes care of the ML so
you can focus on building.
@@ -256,7 +256,7 @@ print(image_query)`;
- Copyright © 2024 Groundlight AI.
+ Copyright © {new Date().getFullYear()} Groundlight AI.
From e7ccaa519a1d84631720885bea7038e8f5929e68 Mon Sep 17 00:00:00 2001
From: Tyler Romero
Date: Mon, 9 Dec 2024 13:02:48 -0800
Subject: [PATCH 3/3] Fix link
---
docs/src/pages/index.tsx | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/docs/src/pages/index.tsx b/docs/src/pages/index.tsx
index 00fdea11..b4d08374 100644
--- a/docs/src/pages/index.tsx
+++ b/docs/src/pages/index.tsx
@@ -1,4 +1,3 @@
-import React from "react";
import { useState } from "react";
import baseStyles from '../css/style.module.css';
@@ -33,7 +32,7 @@ function HomepageHeader() {
}
export default function Home(): JSX.Element {
-
+
const code = `import groundlight
from framegrab import FrameGrabber
@@ -50,7 +49,7 @@ image_query = gl.ask_confident(detector, image)
print(image_query)`;
// Split the code into lines
const codeLines = code.split("\n");
-
+
return (
@@ -64,7 +63,7 @@ print(image_query)`;
computer vision application. Groundlight’s fully managed computer vision solution takes care of the ML so
you can focus on building.