Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
zjy365 committed Sep 6, 2024
1 parent 9ca435c commit 6dabc64
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
3 changes: 2 additions & 1 deletion docs/website/src/hooks/useWindow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import useIsBrowser from '@docusaurus/useIsBrowser';
interface SemParams {
bd_vid: string;
keywords: string;
s: string;
}

export default function useWindow() {
Expand All @@ -13,7 +14,7 @@ export default function useWindow() {
isBrowser ? document.documentElement.lang : 'en'
);
const [cloudUrl, setCloudUrl] = useState('https://cloud.sealos.io');
const [semParams, setSemParams] = useState<SemParams>({ bd_vid: '', keywords: '' });
const [semParams, setSemParams] = useState<SemParams>({ bd_vid: '', keywords: '', s: '' });

useEffect(() => {
if (!isBrowser) return;
Expand Down
4 changes: 2 additions & 2 deletions docs/website/src/pages/components/Header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ const HomeHeader = ({ isPc }: { isPc: boolean }) => {
)}
<a
className="start-now-button"
href={`${cloudUrl}?bd_vid=${semParams.bd_vid}&k=${semParams.keywords}`}
href={`${cloudUrl}?bd_vid=${semParams.bd_vid}&k=${semParams.keywords}&s=${semParams.s}`}
target="_blank"
>
{i18nObj.startNow}
Expand Down Expand Up @@ -201,7 +201,7 @@ const HomeHeader = ({ isPc }: { isPc: boolean }) => {
)}
<a
className="start-now-button"
href={`${cloudUrl}?bd_vid=${semParams.bd_vid}&k=${semParams.keywords}`}
href={`${cloudUrl}?bd_vid=${semParams.bd_vid}&k=${semParams.keywords}&s=${semParams.s}`}
target="_blank"
>
{i18nObj.startNow}
Expand Down
3 changes: 3 additions & 0 deletions docs/website/src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ const Home = () => {
const k = urlParams.get('k');
if (k) params.keywords = k;

const s = urlParams.get('s');
if (s) params.s = s;

if (Object.keys(params).length > 0) {
sessionStorage.setItem('sealos_sem', JSON.stringify(params));
}
Expand Down
3 changes: 3 additions & 0 deletions docs/website/src/pages/self-hosting/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ export default function Pricing() {
const k = urlParams.get('k');
if (k) params.keywords = k;

const s = urlParams.get('s');
if (s) params.s = s;

if (Object.keys(params).length > 0) {
sessionStorage.setItem('sealos_sem', JSON.stringify(params));
}
Expand Down

0 comments on commit 6dabc64

Please sign in to comment.