Skip to content

Commit

Permalink
Merge branch 'datahub-project:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
jayacryl authored Sep 27, 2024
2 parents 9acc15c + f8dd1a6 commit d6e785c
Show file tree
Hide file tree
Showing 7 changed files with 236 additions and 103 deletions.
131 changes: 43 additions & 88 deletions docs-website/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,22 +86,34 @@ module.exports = {
position: "right",
},
{
to: "/cloud",
activeBasePath: "cloud",
html: "Cloud",
to: "/integrations",
activeBasePath: "integrations",
label: "Integrations",
position: "right",
},
{
to: "/learn",
type: "dropdown",
activeBasePath: "learn",
label: "Learn",
position: "right",
},
{
to: "/integrations",
activeBasePath: "integrations",
label: "Integrations",
position: "right",
items: [
{
to: "/learn",
label: "Use Cases",
},
{
to: "/adoption-stories",
label: "Adoption Stories",
},
{
href: "https://blog.datahubproject.io/",
label: "Blog",
},
{
href: "https://www.youtube.com/channel/UC3qFQC5IiwR5fvWEqi_tJ5w",
label: "YouTube",
},
],
},
{
type: "dropdown",
Expand Down Expand Up @@ -131,87 +143,29 @@ module.exports = {
],
},
{
type: "dropdown",
label: "Resources",
href: "/slack",
html: `
<style>
.slack-logo:hover {
opacity: 0.8;
}
</style>
<img class='slack-logo' src='https://upload.wikimedia.org/wikipedia/commons/d/d5/Slack_icon_2019.svg', alt='slack', height='20px' style='margin: 10px 0 0 0;'/>
`,
position: "right",
items: [
{
href: "https://demo.datahubproject.io/",
label: "Demo",
},
{
href: "https://blog.datahubproject.io/",
label: "Blog",
},
{
href: "https://feature-requests.datahubproject.io/roadmap",
label: "Roadmap",
},
{
href: "https://github.com/datahub-project/datahub",
label: "GitHub",
},
{
href: "https://www.youtube.com/channel/UC3qFQC5IiwR5fvWEqi_tJ5w",
label: "YouTube",
},
{
href: "/adoption-stories",
label: "Adoption Stories",
},
{
href: "https://www.youtube.com/playlist?list=PLdCtLs64vZvErAXMiqUYH9e63wyDaMBgg",
label: "DataHub Basics",
},
],
},
{
type: "docsVersionDropdown",
position: "left",
dropdownActiveClassDisabled: true,
dropdownItemsAfter: [
{
type: 'html',
value: '<hr class="dropdown-separator" style="margin: 0.4rem;">',
},
{
type: 'html',
value: '<div class="dropdown__link"><b>Archived versions</b></div>',
},
{
value: `
<a class="dropdown__link" href="https://docs-website-lzxh86531-acryldata.vercel.app/docs/features">0.13.0
<svg width="12" height="12" aria-hidden="true" viewBox="0 0 24 24"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg>
</a>
`,
type: "html",
},
{
value: `
<a class="dropdown__link" href="https://docs-website-2uuxmgza2-acryldata.vercel.app/docs/features">0.12.1
<svg width="12" height="12" aria-hidden="true" viewBox="0 0 24 24"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg>
</a>
`,
type: "html",
},
{
value: `
<a class="dropdown__link" href="https://docs-website-irpoe2osc-acryldata.vercel.app/docs/features">0.11.0
<svg width="12" height="12" aria-hidden="true" viewBox="0 0 24 24"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg>
</a>
`,
type: "html",
},
{
value: `
<a class="dropdown__link" href="https://docs-website-1gv2yzn9d-acryldata.vercel.app/docs/features">0.10.5
<svg width="12" height="12" aria-hidden="true" viewBox="0 0 24 24"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg>
</a>
`,
type: "html",
},
],
},
href: "/cloud",
html: `
<style>
.cloud-cta:hover {
opacity: 0.8;
}
</style>
<div class='cloud-cta button button--primary' alt='try-datahub-cloud' style='font-weight: 700;'>Try DataHub Cloud Free</div>
`,
position: "right",
}
],
},
footer: {
Expand Down Expand Up @@ -335,6 +289,7 @@ module.exports = {
require.resolve("./src/styles/global.scss"),
require.resolve("./src/styles/sphinx.scss"),
require.resolve("./src/styles/config-table.scss"),
require.resolve("./src/components/SecondNavbar/styles.module.scss"),
],
},
gtag: {
Expand Down
55 changes: 55 additions & 0 deletions docs-website/src/components/SecondNavbar/SecondNavbar.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import React from 'react';
import { Link, useLocation } from 'react-router-dom';
import clsx from 'clsx';
import { useColorMode } from '@docusaurus/theme-common';
import SearchBar from '@theme/SearchBar';
import ColorModeToggle from '@theme/ColorModeToggle';
import styles from './styles.module.scss';
import DocsVersionDropdownNavbarItem from '@theme/NavbarItem/DocsVersionDropdownNavbarItem';

function SecondNavbarContent() {
const { colorMode, setColorMode } = useColorMode();
const location = useLocation();
const isDocsPath = location.pathname.startsWith('/docs');
if (!isDocsPath) {
return null;
}

return (
<div className={clsx(styles.secondNavbar, colorMode === 'dark' && styles.darkMode)}>
<div className={styles.container}>
<div className={styles.versionDropdown}>
<DocsVersionDropdownNavbarItem
docsPluginId="default"
dropdownItemsBefore={[]}
dropdownItemsAfter={[]}
dropdownActiveClassDisabled={false}
mobile={false}
/>
</div>
<div className={clsx(styles.navbarItemsRight)}>
<div className={styles.colorModeToggle}>
<ColorModeToggle
className="clean-btn toggleButton_node_modules-@docusaurus-theme-classic-lib-theme-ColorModeToggle-styles-module"
title={`Switch between dark and light mode (currently ${colorMode} mode)`}
aria-label={`Switch between dark and light mode (currently ${colorMode} mode)`}
aria-live="polite"
onChange={() => setColorMode(colorMode === 'dark' ? 'light' : 'dark')}
/>
</div>
<div className={styles.searchBox}>
<SearchBar />
</div>
</div>
</div>
</div>
);
}

function SecondNavbar() {
return (
<SecondNavbarContent />
);
}

export default SecondNavbar;
64 changes: 64 additions & 0 deletions docs-website/src/components/SecondNavbar/styles.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
.secondNavbar {
background-color: #fff;
border-bottom: 1px solid #eaeaea;
z-index: 10;
color: black;

&.darkMode {
background-color: #000;
color: #fff;
}
}

.container,
.coreCloudSwitch,
.docsSwitchButton {
display: flex;
align-items: center;
height: 50px;
}

.container {
padding: 0rem 1rem;
}

.coreCloudSwitch {
width: var(--doc-sidebar-width);
}

.docsSwitchButton {
padding: 0.5rem 1rem;
font-weight: 500;
font-size: 1.1rem;
color: black;
text-decoration: none;

&:hover {
cursor: pointer;
text-decoration: none;
color: #007bff;
}
}

.activeButton {
border-bottom: 2px solid #007bff;
}

.darkMode .docsSwitchButton {
color: white;

&:hover {
color: #4db5ff;
}
}

.searchBox,
.colorModeToggle {
padding: 0.5rem 1rem;
}

.navbarItemsRight {
display: flex;
margin-left: auto;
align-items: center;
}
5 changes: 5 additions & 0 deletions docs-website/src/styles/global.scss
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,11 @@ div[class^="announcementBar"] {
}
}

/* Hide Searchbar in Nav */
.navbar--fixed-top .DocSearch {
display: none;
}

/* Search */

[data-theme="light"] .DocSearch {
Expand Down
14 changes: 14 additions & 0 deletions docs-website/src/theme/Layout/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import React from 'react';
import Layout from '@theme-original/Layout';
import SecondNavbar from '../../components/SecondNavbar/SecondNavbar';

export default function LayoutWrapper(props) {
return (
<>
<Layout {...props}>
<SecondNavbar />
{props.children}
</Layout>
</>
);
}
Loading

0 comments on commit d6e785c

Please sign in to comment.