@seqera/docusaurus-theme-seqera 1.0.32 → 1.0.33-next.106

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,3 @@
1
-
2
1
  h1,
3
2
  h2,
4
3
  h3,
@@ -108,14 +108,69 @@ export default function NavbarContent() {
108
108
  <div className="hidden md:flex! text-[.9rem] pt-1">
109
109
  <div className="flex flex-row justify-between w-full">
110
110
  <div>
111
- <NavbarItems items={leftItems} />
111
+ {/* <NavbarItems items={leftItems} /> */}
112
+ <a
113
+ className={clsx(
114
+ 'navbar__link font-normal',
115
+ pathname.startsWith('/platform-cloud/') &&
116
+ 'navbar__link--active',
117
+ )}
118
+ href="/platform-cloud/"
119
+ aria-label="Platform Cloud">
120
+ Cloud
121
+ </a>
122
+ <a
123
+ className={clsx(
124
+ 'navbar__link ml-8 font-normal',
125
+ pathname.startsWith('/platform-enterprise/') &&
126
+ 'navbar__link--active',
127
+ )}
128
+ href="/platform-enterprise/"
129
+ aria-label="Changelog">
130
+ Enterprise
131
+ </a>
132
+ <a
133
+ className={clsx(
134
+ 'navbar__link ml-8 font-normal',
135
+ pathname.startsWith('/nextflow/') && 'navbar__link--active',
136
+ )}
137
+ href="/nextflow/"
138
+ aria-label="Changelog">
139
+ Nextflow
140
+ </a>
141
+ <a
142
+ className={clsx(
143
+ 'navbar__link ml-8 font-normal',
144
+ pathname.startsWith('/multiqc/') && 'navbar__link--active',
145
+ )}
146
+ href="/multiqc/"
147
+ aria-label="MultiQC">
148
+ MultiQC
149
+ </a>
150
+ <a
151
+ className={clsx(
152
+ 'navbar__link ml-8 font-normal',
153
+ pathname.startsWith('/wave/') && 'navbar__link--active',
154
+ )}
155
+ href="/wave/"
156
+ aria-label="Wave">
157
+ Wave
158
+ </a>
159
+ <a
160
+ className={clsx(
161
+ 'navbar__link ml-8 font-normal',
162
+ pathname.startsWith('/fusion/') && 'navbar__link--active',
163
+ )}
164
+ href="/fusion/"
165
+ aria-label="Fusion">
166
+ Fusion
167
+ </a>
112
168
  </div>
113
169
  <div className="mr-2">
114
170
  <a
115
171
  className={clsx(
116
172
  'navbar__link ml-8 font-normal',
117
- pathname.replace(/\/$/, '').startsWith('/platform-api') &&
118
- 'navbar__link--active',
173
+ pathname.startsWith('/platform-api/') && 'navbar__link--active',
119
174
  )}
120
175
  href="/platform-api/"
121
176
  aria-label="Platform API">
@@ -124,8 +179,7 @@ export default function NavbarContent() {
124
179
  <a
125
180
  className={clsx(
126
181
  'navbar__link ml-8 font-normal',
127
- pathname.replace(/\/$/, '').startsWith('/changelog') &&
128
- 'navbar__link--active',
182
+ pathname.startsWith('/changelog/') && 'navbar__link--active',
129
183
  )}
130
184
  href="/changelog/"
131
185
  aria-label="Changelog">
@@ -17,11 +17,14 @@ export default function NavbarNavLink({
17
17
  prependBaseUrlToHref,
18
18
  ...props
19
19
  }) {
20
+ // TODO all this seems hacky
21
+ // {to: 'version'} should probably be forbidden, in favor of {to: '/version'}
20
22
  const toUrl = useBaseUrl(to);
21
23
  const activeBaseUrl = useBaseUrl(activeBasePath);
22
24
  const normalizedHref = useBaseUrl(href, {forcePrependBaseUrl: true});
23
25
  const isExternalLink = label && href && !isInternalUrl(href);
24
26
  const {pathname} = useLocation();
27
+ // Link content is set through html XOR label
25
28
  const linkContentProps = html
26
29
  ? {dangerouslySetInnerHTML: {__html: html}}
27
30
  : {
@@ -37,12 +40,7 @@ export default function NavbarNavLink({
37
40
  ),
38
41
  };
39
42
  if (href) {
40
- const normalizedPathname = pathname.replace(/\/$/, '');
41
- const normalizedHrefPath = href.replace(/\/$/, '');
42
- const isActiveHref =
43
- !isExternalLink &&
44
- (normalizedPathname === normalizedHrefPath ||
45
- normalizedPathname.startsWith(normalizedHrefPath + '/'));
43
+ const isActiveHref = !isExternalLink && pathname.startsWith(href);
46
44
  return (
47
45
  <Link
48
46
  href={prependBaseUrlToHref ? normalizedHref : href}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seqera/docusaurus-theme-seqera",
3
- "version": "1.0.32",
3
+ "version": "1.0.33-next.106",
4
4
  "description": "Seqera docs theme for Docusaurus",
5
5
  "author": "Seqera docs team <education@seqera.io>",
6
6
  "license": "Apache-2.0",
@@ -1,4 +1,3 @@
1
-
2
1
  h1,
3
2
  h2,
4
3
  h3,
@@ -124,17 +124,79 @@ export default function NavbarContent(): ReactNode {
124
124
  <div className="hidden md:flex! text-[.9rem] pt-1">
125
125
  <div className="flex flex-row justify-between w-full">
126
126
  <div>
127
- <NavbarItems items={leftItems} />
127
+ {/* <NavbarItems items={leftItems} /> */}
128
+ <a
129
+ className={clsx(
130
+ 'navbar__link font-normal',
131
+ pathname.startsWith('/platform-cloud/') &&
132
+ 'navbar__link--active',
133
+ )}
134
+ href="/platform-cloud/"
135
+ aria-label="Platform Cloud">
136
+ Cloud
137
+ </a>
138
+ <a
139
+ className={clsx(
140
+ 'navbar__link ml-8 font-normal',
141
+ pathname.startsWith('/platform-enterprise/') &&
142
+ 'navbar__link--active',
143
+ )}
144
+ href="/platform-enterprise/"
145
+ aria-label="Changelog">
146
+ Enterprise
147
+ </a>
148
+ <a
149
+ className={clsx(
150
+ 'navbar__link ml-8 font-normal',
151
+ pathname.startsWith('/nextflow/') && 'navbar__link--active',
152
+ )}
153
+ href="/nextflow/"
154
+ aria-label="Changelog">
155
+ Nextflow
156
+ </a>
157
+ <a
158
+ className={clsx(
159
+ 'navbar__link ml-8 font-normal',
160
+ pathname.startsWith('/multiqc/') && 'navbar__link--active',
161
+ )}
162
+ href="/multiqc/"
163
+ aria-label="MultiQC">
164
+ MultiQC
165
+ </a>
166
+ <a
167
+ className={clsx(
168
+ 'navbar__link ml-8 font-normal',
169
+ pathname.startsWith('/wave/') && 'navbar__link--active',
170
+ )}
171
+ href="/wave/"
172
+ aria-label="Wave">
173
+ Wave
174
+ </a>
175
+ <a
176
+ className={clsx(
177
+ 'navbar__link ml-8 font-normal',
178
+ pathname.startsWith('/fusion/') && 'navbar__link--active',
179
+ )}
180
+ href="/fusion/"
181
+ aria-label="Fusion">
182
+ Fusion
183
+ </a>
128
184
  </div>
129
185
  <div className="mr-2">
130
186
  <a
131
- className={clsx('navbar__link ml-8 font-normal', pathname.replace(/\/$/, '').startsWith('/platform-api') && 'navbar__link--active')}
187
+ className={clsx(
188
+ 'navbar__link ml-8 font-normal',
189
+ pathname.startsWith('/platform-api/') && 'navbar__link--active',
190
+ )}
132
191
  href="/platform-api/"
133
192
  aria-label="Platform API">
134
193
  Platform API
135
194
  </a>
136
195
  <a
137
- className={clsx('navbar__link ml-8 font-normal', pathname.replace(/\/$/, '').startsWith('/changelog') && 'navbar__link--active')}
196
+ className={clsx(
197
+ 'navbar__link ml-8 font-normal',
198
+ pathname.startsWith('/changelog/') && 'navbar__link--active',
199
+ )}
138
200
  href="/changelog/"
139
201
  aria-label="Changelog">
140
202
  Changelog
@@ -1,3 +1,5 @@
1
+
2
+
1
3
  import React, {type ReactNode} from 'react';
2
4
  import clsx from 'clsx';
3
5
  import Link from '@docusaurus/Link';
@@ -19,12 +21,15 @@ export default function NavbarNavLink({
19
21
  prependBaseUrlToHref,
20
22
  ...props
21
23
  }: Props): ReactNode {
24
+ // TODO all this seems hacky
25
+ // {to: 'version'} should probably be forbidden, in favor of {to: '/version'}
22
26
  const toUrl = useBaseUrl(to);
23
27
  const activeBaseUrl = useBaseUrl(activeBasePath);
24
28
  const normalizedHref = useBaseUrl(href, {forcePrependBaseUrl: true});
25
29
  const isExternalLink = label && href && !isInternalUrl(href);
26
30
  const {pathname} = useLocation();
27
31
 
32
+ // Link content is set through html XOR label
28
33
  const linkContentProps = html
29
34
  ? {dangerouslySetInnerHTML: {__html: html}}
30
35
  : {
@@ -41,13 +46,7 @@ export default function NavbarNavLink({
41
46
  };
42
47
 
43
48
  if (href) {
44
- const normalizedPathname = pathname.replace(/\/$/, '');
45
- const normalizedHrefPath = href.replace(/\/$/, '');
46
- const isActiveHref =
47
- !isExternalLink &&
48
- (normalizedPathname === normalizedHrefPath ||
49
- normalizedPathname.startsWith(normalizedHrefPath + '/'));
50
-
49
+ const isActiveHref = !isExternalLink && pathname.startsWith(href);
51
50
  return (
52
51
  <Link
53
52
  href={prependBaseUrlToHref ? normalizedHref : href}
@@ -74,4 +73,4 @@ export default function NavbarNavLink({
74
73
  {...linkContentProps}
75
74
  />
76
75
  );
77
- }
76
+ }