Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nav with versions #19

Merged
merged 10 commits into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified build/ui-bundle.zip
Binary file not shown.
8,649 changes: 4,759 additions & 3,890 deletions package-lock.json

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions src/css/nav.css
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,6 @@ html.is-clipped--nav {
}

.nav-panel-explore .component .title {
display: none;
font-weight: var(--body-font-weight-bold);
color: inherit;
}
Expand All @@ -313,7 +312,7 @@ html.is-clipped--nav {
}

.nav-panel-explore .component .version {
display: none;
display: block;
margin: 0.375rem 0.375rem 0 0;
}

Expand Down
10 changes: 7 additions & 3 deletions src/partials/header-content.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@
<div id="topbar-nav" class="navbar-menu">
<div class="navbar-end">
<!-- Language Picker Dropdown -->
<div class="navbar-item has-dropdown is-hoverable">
<!--div class="navbar-item has-dropdown is-hoverable">
<a class="navbar-link" href="#">
English
</a>
<div class="navbar-dropdown">
<a class="navbar-item" href="https://docs.tigergraph.com/">English</a>
<a class="navbar-item" href="https://jp.docs.tigergraph.com/">日本語</a>
</div>
</div>
</div-->
<div class="navbar-item search hide-for-print">
{{#if (and page.component (ne page.component.name 'home') (ne page.component.name 'ROOT'))}}
<div id="search" class="field has-filter">
Expand All @@ -40,7 +40,7 @@
{{/if}}
</div>

<a class="navbar-item" href="/home">Home</a>
<!--a class="navbar-item" href="/home">Home</a-->
<div class="navbar-item has-dropdown is-hoverable">
<a class="navbar-link" href="#">Products</a>
<div class="navbar-dropdown">
Expand All @@ -64,12 +64,16 @@
<div class="dropdown-label">TigerGraph Cloud</div>
<div class="dropdown-category">
<a class="category-item" href="{{relativize site.components.cloud.url}}">{{site.components.cloud.title}}</a>
<a class="category-item" href="https://docs.tigergraph.com/cloudbeta/overview/">{{site.components.cloudBeta.title}}
<span style="font-weight: 400; top: -2px; position: relative; margin-left: 8px; color: rgb(255, 255, 254); padding: 2px 4px; font-size: 10px; border-radius: 2px; background-color: rgb(255, 109, 0);">New</span>
</a>
</div>

<div class="dropdown-label">Graph Data Science</div>
<div class="dropdown-category">
<a class="category-item" href="{{relativize site.components.graph-ml.url}}">{{site.components.graph-ml.title}}</a>
<a class="category-item" href="{{relativize site.components.ml-workbench.url}}">{{site.components.ml-workbench.title}}</a>
<a class="category-item" href="{{relativize site.components.tg-copilot.url}}">{{site.components.tg-copilot.title}}</a>
</div>

<div class="dropdown-label">Connectors and APIs</div>
Expand Down
52 changes: 2 additions & 50 deletions src/partials/nav-explore.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -6,56 +6,7 @@
</div>
{{/if}}
<ul class="components">
{{!-- Below is new nav code after revamp--}}
<div class="home-left-nav-title" style="font-weight: bold;">TigerGraph DB</div>
<div class="dropdown-category">
<a class="category-item" href="{{relativize site.components.tigergraph-server.url}}">{{site.components.tigergraph-server.title}}</a>
<a class="category-item" href="https://docs.tigergraph.com/tigergraph-server/current/getting-started/">Get Started</a>
</div>

<div class="home-left-nav-title" style="font-weight: bold;">TigerGraph Cloud</div>
<div class="dropdown-category">
<a class="category-item" href="{{relativize site.components.cloud.url}}">{{site.components.cloud.title}}</a>
<a class="category-item" href="https://docs.tigergraph.com/cloud/start/get_started">Get Started</a>
{{!-- Below is code for the cloudbeta--}}
<div style="display: flex; align-items: center;">
<a class="category-item" href="https://docs.tigergraph.com/cloudbeta/overview/">{{site.components.cloudBeta.title}}</a>
<span style="font-weight: 400; top: -2px; position: relative; margin-left: 8px; color: rgb(255, 255, 254); padding: 2px 4px; font-size: 10px; border-radius: 2px; background-color: rgb(255, 109, 0);">New</span>
</div>
</div>

<div class="home-left-nav-title" style="font-weight: bold;">TigerGraph Suite</div>
<div class="dropdown-category">
<a class="category-item" href="{{relativize site.components.gui.url}}">Admin Portal and GraphStudio</a>
<a class="category-item" href="{{relativize site.components.insights.url}}">{{site.components.insights.title}}</a>
<a class="category-item" href="https://docs.tigergraph.com/tigergraph-server/current/gsql-shell/web">GSQL Web Shell</a>
</div>

<div class="home-left-nav-title" style="font-weight: bold;">GSQL Language</div>
<div class="dropdown-category">
<a class="category-item" href="{{relativize site.components.gsql-ref.url}}">GSQL Language Reference</a>
<a class="category-item" href="https://docs.tigergraph.com/gsql-ref/current/tutorials/gsql-101/">GSQL 101</a>
</div>

<div class="home-left-nav-title" style="font-weight: bold;">Graph + AI</div>
<div class="dropdown-category">
<a class="category-item" href="{{relativize site.components.graph-ml.url}}">Graph Data Science Library</a>
<a class="category-item" href="{{relativize site.components.ml-workbench.url}}">ML Workbench</a>
{{!-- Below is code for the CoPilot--}}
<div style="display: flex; align-items: center;">
<a class="category-item" href="https://docs.tigergraph.com/tg-copilot/current/intro/">TigerGraph CoPilot</a>
<span style="font-weight: 400; top: -2px; position: relative; margin-left: 8px; color: rgb(255, 255, 254); padding: 2px 4px; font-size: 10px; border-radius: 2px; background-color: rgb(255, 109, 0);">New</span>
</div>
<a class="category-item" href="{{relativize site.components.pytigergraph.url}}">pyTigerGraph</a>
</div>

<div class="home-left-nav-title" style="font-weight: bold;">Connectors and APIs</div>
<div class="dropdown-category">
<a class="category-item" href="{{relativize site.components.graphql.url}}">GraphQL Service</a>
<a class="category-item" href="https://github.com/tigergraph/ecosys/tree/master/tools/etl/tg-jdbc-driver">JDBC Driver</a>
<a class="category-item" href="https://docs.tigergraph.com/tigergraph-server/current/api/">API Reference</a>
</div>
{{!--Old Nav this does NOT display: none but can still be indexed in the DOM--}}
{{!--Old Nav. Up here, it DOES display: whether it's visible or not, it can still be indexed in the DOM--}}
{{#each (rearrange site.components 'name' page.attributes.component-order)}}
<li class="component{{#if (eq this @root.page.component)}} is-current{{/if}}">
<a class="title" href="{{{relativize ./url}}}">{{{./title}}}</a>
Expand All @@ -70,6 +21,7 @@
{{/each}}
</ul>
{{/if}}
</li>
{{/each}}
</ul>
</div>
76 changes: 76 additions & 0 deletions src/partials/nav-explore.hbs.backup
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
<div class="nav-panel-explore{{#unless page.navigation}} is-active{{/unless}}" data-panel="explore">
{{#if page.component}}
<div class="context">
<span class="title">{{page.component.title}}</span>
<span class="version">{{#unless (eq page.componentVersion.displayVersion 'default')}}{{page.componentVersion.displayVersion}}{{/unless}}</span>
</div>
{{/if}}
<ul class="components">
{{!-- Below is new nav code after revamp--}}
<div class="home-left-nav-title" style="font-weight: bold;">TigerGraph DB</div>
<div class="dropdown-category">
<a class="category-item" href="{{relativize site.components.tigergraph-server.url}}">{{site.components.tigergraph-server.title}}</a>
<a class="category-item" href="https://docs.tigergraph.com/tigergraph-server/current/getting-started/">Get Started</a>
</div>

<div class="home-left-nav-title" style="font-weight: bold;">TigerGraph Cloud</div>
<div class="dropdown-category">
<a class="category-item" href="{{relativize site.components.cloud.url}}">{{site.components.cloud.title}}</a>
<a class="category-item" href="https://docs.tigergraph.com/cloud/main/start/get_started">Get Started</a>
{{!-- Below is code for the cloudbeta--}}
<div style="display: flex; align-items: center;">
<a class="category-item" href="https://docs.tigergraph.com/cloudbeta/overview/">{{site.components.cloudBeta.title}}
<span style="font-weight: 400; top: -2px; position: relative; margin-left: 8px; color: rgb(255, 255, 254); padding: 2px 4px; font-size: 10px; border-radius: 2px; background-color: rgb(255, 109, 0);">New</span>
</a>

</div>
</div>

<div class="home-left-nav-title" style="font-weight: bold;">TigerGraph Suite</div>
<div class="dropdown-category">
<a class="category-item" href="{{relativize site.components.gui.url}}">Admin Portal and GraphStudio</a>
<a class="category-item" href="{{relativize site.components.insights.url}}">{{site.components.insights.title}}</a>
<a class="category-item" href="https://docs.tigergraph.com/tigergraph-server/current/gsql-shell/web">GSQL Web Shell</a>
</div>

<div class="home-left-nav-title" style="font-weight: bold;">GSQL Language</div>
<div class="dropdown-category">
<a class="category-item" href="{{relativize site.components.gsql-ref.url}}">GSQL Language Reference</a>
<a class="category-item" href="https://docs.tigergraph.com/gsql-ref/current/tutorials/gsql-101/">GSQL 101</a>
</div>

<div class="home-left-nav-title" style="font-weight: bold;">Graph + AI</div>
<div class="dropdown-category">
<a class="category-item" href="{{relativize site.components.graph-ml.url}}">Graph Data Science Library</a>
<a class="category-item" href="{{relativize site.components.ml-workbench.url}}">ML Workbench</a>
{{!-- Below is code for the CoPilot--}}
<div style="display: flex; align-items: center;">
<a class="category-item" href="https://docs.tigergraph.com/tg-copilot/current/intro/">TigerGraph CoPilot</a>
</div>
<a class="category-item" href="{{relativize site.components.pytigergraph.url}}">pyTigerGraph</a>
</div>

<div class="home-left-nav-title" style="font-weight: bold;">Connectors and APIs</div>
<div class="dropdown-category">
<a class="category-item" href="{{relativize site.components.graphql.url}}">GraphQL Service</a>
<a class="category-item" href="https://github.com/tigergraph/ecosys/tree/master/tools/etl/tg-jdbc-driver">JDBC Driver</a>
<a class="category-item" href="https://docs.tigergraph.com/tigergraph-server/current/api/">API Reference</a>
</div>
{{!--Old Nav this does NOT display: none but can still be indexed in the DOM--}}
{{#each (rearrange site.components 'name' page.attributes.component-order)}}
<li class="component{{#if (eq this @root.page.component)}} is-current{{/if}}">
<a class="title" href="{{{relativize ./url}}}">{{{./title}}}</a>
{{#if (or ./versions.[1] (ne ./versions.[0].displayVersion 'default'))}}
<ul class="versions">
{{#each ./versions}}
<li class="version
{{~#if (and (eq .. @root.page.component) (eq this @root.page.componentVersion))}} is-current{{/if~}}
{{~#if (eq this ../latest)}} is-latest{{/if}}">
<a href="{{{relativize ./url}}}">{{./displayVersion}}</a>
</li>
{{/each}}
</ul>
{{/if}}
{{/each}}
</ul>
</div>
6 changes: 1 addition & 5 deletions src/partials/nav.hbs
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
<div class="nav-container"{{#if page.component}} data-component="{{page.component.name}}" data-version="{{page.version}}"{{/if}}>
<aside class="nav">
<div class="panels">
{{> page-versions}}
{{> nav-menu}}
{{#if (or (eq page.attributes.role "home") (eq page.layout "404"))}}
{{> nav-explore}}
{{/if}}
{{> nav-explore-hidden}}
{{> nav-explore}}
</div>
</aside>
</div>
8 changes: 8 additions & 0 deletions src/partials/nav.hbs.backup
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<div class="nav-container"{{#if page.component}} data-component="{{page.component.name}}" data-version="{{page.version}}"{{/if}}>
<aside class="nav">
<div class="panels">
{{> nav-menu}}
{{> nav-explore}}
</div>
</aside>
</div>
29 changes: 10 additions & 19 deletions src/partials/page-versions.hbs
Original file line number Diff line number Diff line change
@@ -1,22 +1,13 @@

{{#with page.versions}}
<div class="page-versions">
{{!--
<button class="version-menu-toggle" title="Show other versions of page"><div class="button-text">{{@root.page.componentVersion.displayVersion}}</div>
<div class="button-arrow">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-chevron-down" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z"/>
</svg>
</div>
</button>
--}}
<ul class="version-menu">
{{#each this}}
<li class="version
{{~#if (and (eq .. @root.page.component) (eq this @root.page.componentVersion))}} is-current{{/if~}}
{{~#if (eq this ../latest)}} is-latest{{/if}}">
<a href="{{{relativize ./url}}}">{{./displayVersion}}</a>
</li>
{{/each}}
</ul>
<div class="page-versions">
<button class="version-menu-toggle" title="Show other versions of page">{{@root.page.componentVersion.displayVersion}}</button>
<div class="version-menu">
{{#each this}}
<a class="version
{{~#if (eq ./version @root.page.version)}} is-current{{/if~}}
{{~#if ./missing}} is-missing{{/if}}" href="{{{relativize ./url}}}">{{./displayVersion}}</a>
{{/each}}
</div>
</div>
{{/with}}
12 changes: 12 additions & 0 deletions src/partials/page-versions.hbs.backup
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{{#with page.versions}}
<div class="page-versions">
<button class="version-menu-toggle" title="Show other versions of page">{{@root.page.componentVersion.displayVersion}}</button>
<div class="version-menu">
{{#each this}}
<a class="version
{{~#if (eq ./version @root.page.version)}} is-current{{/if~}}
{{~#if ./missing}} is-missing{{/if}}" href="{{{relativize ./url}}}">{{./displayVersion}}</a>
{{/each}}
</div>
</div>
{{/with}}
Loading