File tree Expand file tree Collapse file tree
themes/arm-design-system-hugo-theme
layouts/partials/package-display Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1313 < tbody id ="sw-tablebody ">
1414 {{ $id_index := 0}}
1515 {{ $os := .context.Params.os }}
16- {{ $dashboard_page_path := .context.RelPermalink | strings.TrimRight "/" }}
16+ {{ $dashboard_page_path := .context.RelPermalink }}
17+ {{ if eq .context.Site.BaseURL "/" }}
18+ {{ $base_path := (.context.Site.Params.dashboard_base_path | default "/ecosystem-dashboard") | strings.TrimRight "/" }}
19+ {{ if ne $base_path "" }}
20+ {{ $dashboard_page_path = printf "%s/%s" $base_path ($dashboard_page_path | strings.TrimLeft "/") }}
21+ {{ end }}
22+ {{ end }}
1723 {{ range .packages }}
1824
1925 {{ $id_index = add $id_index 1 }}
Original file line number Diff line number Diff line change @@ -59,11 +59,26 @@ function normalizePackageName(input) {
5959}
6060
6161function getDashboardPath ( dashboardPath ) {
62- if ( dashboardPath ) {
63- return dashboardPath . replace ( / \/ $ / , '' ) || '/' ;
62+ let normalizedPath = dashboardPath ;
63+
64+ if ( ! normalizedPath ) {
65+ normalizedPath = window . location . pathname ;
66+ }
67+
68+ if ( ! normalizedPath ) {
69+ return '/' ;
70+ }
71+
72+ normalizedPath = normalizedPath . trim ( ) ;
73+ if ( ! normalizedPath . startsWith ( '/' ) ) {
74+ normalizedPath = '/' + normalizedPath ;
75+ }
76+
77+ if ( ! normalizedPath . endsWith ( '/' ) ) {
78+ normalizedPath = normalizedPath + '/' ;
6479 }
6580
66- return window . location . pathname . replace ( / \/ $ / , '' ) || '/' ;
81+ return normalizedPath ;
6782}
6883
6984function buildPackageDashboardUrl ( packageSlug , dashboardPath ) {
You can’t perform that action at this time.
0 commit comments