Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 8b39609

Browse files
authoredMar 4, 2024
Merge pull request #19558 from dvdksn/dds-updates-march24
site: style updates and performance improvements
2 parents b1aa8d3 + df0455d commit 8b39609

File tree

18 files changed

+88
-100
lines changed

18 files changed

+88
-100
lines changed
 

‎assets/css/global.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88
:root {
99
-webkit-font-smoothing: antialiased;
1010
-moz-osx-font-smoothing: grayscale;
11+
12+
scrollbar-color: theme(colors.gray.light.400) theme(colors.black / 0.05);
13+
&.dark {
14+
scrollbar-color: theme(colors.gray.dark.800) theme(colors.white / 0.10);
15+
}
1116
}
1217
}
1318

‎assets/css/icons.css

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,19 @@
1111

1212
.icon-xs {
1313
svg {
14-
@apply text-base;
14+
font-size: 12px;
1515
}
1616
}
1717

1818
.icon-sm {
1919
svg {
20-
@apply text-lg;
20+
font-size: 16px;
2121
}
2222
}
2323

24-
.icon-top {
24+
.icon-lg {
2525
svg {
26-
@apply ml-1 align-top;
26+
font-size: 32px;
2727
}
2828
}
2929
}

‎assets/css/styles.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
@import "/assets/css/code";
1111
@import "/assets/css/toc";
1212
@import "/assets/css/callouts";
13-
@import "/assets/css/tables";
1413

1514
@import "tailwindcss/utilities";
1615
@import "/assets/css/syntax-light";

‎assets/css/tables.css

Lines changed: 0 additions & 15 deletions
This file was deleted.

‎content/scout/integrations/registry/acr.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,14 @@ the Azure resources.
5454
{{< accordion title="JSON template" >}}
5555

5656
{{< acr-template.inline >}}
57-
{{ $data := data.GetJSON "https://prod-scout-integration-templates.s3.amazonaws.com/latest/acr_token_template.json" }}
57+
{{ with resources.GetRemote "https://prod-scout-integration-templates.s3.amazonaws.com/latest/acr_token_template.json" }}
58+
{{ $data := .Content | transform.Unmarshal }}
5859

5960
```json
6061
{{ transform.Remarshal "json" $data }}
6162
```
6263

64+
{{ end }}
6365
{{< /acr-template.inline >}}
6466

6567
{{< /accordion >}}

‎layouts/_default/_markup/render-codeblock.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
copying = true;
88
setTimeout(() => copying = false, 2000);"
99
>
10-
<span :class="{ 'group-hover:block' : !copying }" class="hidden icon-svg">{{ partial "icon" "content_copy" }}</span>
11-
<span :class="{ 'group-hover:block' : copying }" class="hidden icon-svg">{{ partial "icon" "check_circle" }}</span>
10+
<span :class="{ 'group-hover:block' : !copying }" class="hidden icon-svg">{{ partialCached "icon" "content_copy" "content_copy" }}</span>
11+
<span :class="{ 'group-hover:block' : copying }" class="hidden icon-svg">{{ partialCached "icon" "check_circle" "check_circle" }}</span>
1212
</button>
1313
{{ $result := transform.HighlightCodeBlock . }}
1414
<div class="syntax-light dark:syntax-dark">

‎layouts/_default/_markup/render-image.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
<button
3838
class="text-white fixed z-30 top-6 right-8 icon-svg"
3939
>
40-
{{ partial "icon" "close" }}
40+
{{ partialCached "icon" "close" "close" }}
4141
</button>
4242
<img
4343
loading="lazy"

‎layouts/_default/_markup/render-link.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
target="_blank"
88
rel="noopener">
99
{{- .Text | safeHTML -}}
10-
<span class="icon-svg icon-xs icon-top">
11-
{{- partial "icon" "open_in_new" -}}
10+
<span class="pl-1 icon-svg icon-sm">
11+
{{- partialCached "icon" "open_in_new" "open_in_new" -}}
1212
</span></a>
1313
{{- else if (strings.HasPrefix $url "/") -}}
1414
{{/* absolute link, use url as-is */}}

‎layouts/_default/cli.html

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ <h1 class="scroll-mt-36">{{ .Title }}</h1>
3333
<tr>
3434
<th class="text-left w-32 flex items-center gap-2">
3535
<span>Aliases</span>
36-
{{ partial "tooltip.html" "An alias is a short or memorable alternative for a longer command." }}
36+
{{ partialCached "tooltip.html" "An alias is a short or memorable alternative for a longer command." "cli-alias" }}
3737
</th>
3838
<td>
3939
<div class="flex gap-3">
@@ -71,19 +71,19 @@ <h1 class="scroll-mt-36">{{ .Title }}</h1>
7171
{{ end }}
7272
{{ with $data.kubernetes }}
7373
<p>
74-
{{ partial "components/badge.html" (dict "color" "blue" "content" "Kubernetes") }}
74+
{{ partialCached "components/badge.html" (dict "color" "blue" "content" "Kubernetes") "k8s" }}
7575
This command works with the Kubernetes orchestrator.
7676
</p>
7777
{{ end }}
7878
{{ with $data.swarm }}
7979
<p>
80-
{{ partial "components/badge.html" (dict "color" "blue" "content" "Swarm") }}
80+
{{ partialCached "components/badge.html" (dict "color" "blue" "content" "Swarm") "swarm" }}
8181
This command works with the Swarm orchestrator.
8282
</p>
8383
{{ end }}
8484
{{ with $data.long }}
8585
{{ $heading := dict "level" 2 "text" "Description" }}
86-
{{ partial "heading.html" $heading }}
86+
{{ partialCached "heading.html" $heading "cli-description" }}
8787
{{ $subHeadings := (strings.FindRE `(?m:#{3,4} .*)` .) }}
8888
{{ $.Scratch.Add "headings" $heading }}
8989
{{ range $subHeadings }}
@@ -97,7 +97,7 @@ <h1 class="scroll-mt-36">{{ .Title }}</h1>
9797
{{ $opts := where . "hidden" false }}
9898
{{ with $opts }}
9999
{{ $heading := dict "level" 2 "text" "Options" }}
100-
{{ partial "heading.html" $heading }}
100+
{{ partialCached "heading.html" $heading "cli-options" }}
101101
{{ $.Scratch.Add "headings" $heading }}
102102
<table>
103103
<thead>
@@ -129,22 +129,22 @@ <h1 class="scroll-mt-36">{{ .Title }}</h1>
129129
</td>
130130
<td>
131131
{{ with .min_api_version }}
132-
{{ partial "components/badge.html" (dict "color" "blue" "content" (printf "API %s+" .)) }}
132+
{{ partialCached "components/badge.html" (dict "color" "blue" "content" (printf "API %s+" .)) "api" . }}
133133
{{ end }}
134134
{{ with .deprecated }}
135-
{{ partial "components/badge.html" (dict "color" "red" "content" "Deprecated") }}
135+
{{ partialCached "components/badge.html" (dict "color" "red" "content" "Deprecated") "deprecated" }}
136136
{{ end }}
137137
{{ with .experimental }}
138-
{{ partial "components/badge.html" (dict "color" "amber" "content" "experimental (daemon)") }}
138+
{{ partialCached "components/badge.html" (dict "color" "amber" "content" "experimental (daemon)") "exp" }}
139139
{{ end }}
140140
{{ with .experimentalcli }}
141-
{{ partial "components/badge.html" (dict "color" "amber" "content" "experimental (CLI)") }}
141+
{{ partialCached "components/badge.html" (dict "color" "amber" "content" "experimental (CLI)") "exp-cli" }}
142142
{{ end }}
143143
{{ with .kubernetes }}
144-
{{ partial "components/badge.html" (dict "color" "blue" "content" "Kubernetes") }}
144+
{{ partialCached "components/badge.html" (dict "color" "blue" "content" "Kubernetes") "k8s" }}
145145
{{ end }}
146146
{{ with .swarm }}
147-
{{ partial "components/badge.html" (dict "color" "blue" "content" "Swarm") }}
147+
{{ partialCached "components/badge.html" (dict "color" "blue" "content" "Swarm") "swarm" }}
148148
{{ end }}
149149
{{ if .description }}
150150
{{/* replace newlines in long desc with break tags */}}
@@ -159,7 +159,7 @@ <h1 class="scroll-mt-36">{{ .Title }}</h1>
159159
{{ end }}
160160
{{ with $data.examples }}
161161
{{ $heading := dict "level" 2 "text" "Examples" }}
162-
{{ partial "heading.html" $heading }}
162+
{{ partialCached "heading.html" $heading "cli-examples" }}
163163
{{ $subHeadings := (strings.FindRE `(?m:#{3,4} .*)` .) }}
164164
{{ $.Scratch.Add "headings" $heading }}
165165
{{ range $subHeadings }}
@@ -171,7 +171,7 @@ <h1 class="scroll-mt-36">{{ .Title }}</h1>
171171
{{ end }}
172172
{{ if eq .Kind "section" }}
173173
{{ $heading := dict "level" 2 "text" "Subcommands" }}
174-
{{ partial "heading.html" $heading }}
174+
{{ partialCached "heading.html" $heading "cli-subcommands" }}
175175
{{ $.Scratch.Add "headings" $heading }}
176176
<table>
177177
<thead>

‎layouts/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ <h2 class="text-2xl">Community resources</h2>
281281
</div>
282282
</div>
283283
</main>
284-
<footer>{{ partial "footer.html" . }}</footer>
284+
<footer>{{ partialCached "footer.html" . }}</footer>
285285
</body>
286286

287287
</html>

‎layouts/partials/components/accordion.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<div x-data="{ open: false }" class="border border-gray-light-200 dark:border-gray-dark-200 bg-white dark:bg-gray-dark-100">
22
<button class="not-prose w-full py-2 px-4 flex justify-between" x-on:click="open = ! open">
33
<span>{{ .title }}</span>
4-
<span :class="{ 'hidden' : !open }" class="icon-svg">{{ partial "icon" "expand_less" }}</span>
5-
<span :class="{ 'hidden' : open }" class="icon-svg">{{ partial "icon" "expand_more" }}</span>
4+
<span :class="{ 'hidden' : !open }" class="icon-svg">{{ partialCached "icon" "expand_less" "expand_less" }}</span>
5+
<span :class="{ 'hidden' : open }" class="icon-svg">{{ partialCached "icon" "expand_more" "expand_more" }}</span>
66
</button>
77

88
<div x-show="open" x-collapse class="px-4">

‎layouts/partials/components/card.html

Lines changed: 38 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,52 @@
11
{{ if (and .image .icon) }}
22
{{ errorf "card: don't use both image and icon: %s" . }}
33
{{ end }}
4-
<div class="not-prose overflow-x-hidden">
4+
<div class="not-prose overflow-x-hidden drop-shadow bg-white rounded
5+
border border-gray-light-100 dark:bg-gray-dark-200 dark:border-gray-dark-400
6+
{{ if .link }}hover:border-gray-light-200 hover:dark:border-gray-dark{{ end }}">
57
{{ if .link }}
6-
<a class="h-full" href="{{ .link }}">
7-
{{ end }}
8-
<div class="h-full bg-white rounded-sm
9-
border border-gray-light-100 drop-shadow-sm dark:bg-gray-dark-200 dark:border-gray-dark-400
10-
{{ if .link }}hover:drop-shadow-lg hover:border-gray-light-200 hover:dark:border-gray-dark{{ end }}">
11-
{{ if .image }}
12-
{{/* use the "tall image" layout */}}
13-
<div class="flex gap-2 items-stretch">
14-
<div class="basis-1/3">
15-
<img class="h-full w-full object-cover" src="{{ .image }}" alt="">
8+
<a href="{{ .link }}">
9+
{{ end }}
10+
{{ if .image }}
11+
{{/* use the "tall image" layout */}}
12+
<div class="flex gap-2 items-stretch">
13+
<div class="basis-1/3">
14+
<img class="h-full w-full object-cover" src="{{ .image }}" alt="">
15+
</div>
16+
<div class="basis-2/3 flex flex-col gap-2 p-4">
17+
<div class="text-xl text-gray-light-800 leading-snug dark:text-white flex gap-2">
18+
{{ markdownify .title }}
1619
</div>
17-
<div class="basis-2/3 flex flex-col gap-2 p-4">
18-
<div class="text-xl text-gray-light-800 leading-snug dark:text-white flex gap-2">
19-
{{ markdownify .title }}
20-
</div>
21-
<div class="text-gray-light-500 leading-snug dark:text-gray-dark-700">
22-
{{ .description | markdownify }}
23-
</div>
20+
<div class="text-gray-light-500 leading-snug dark:text-gray-dark-700">
21+
{{ .description | markdownify }}
2422
</div>
2523
</div>
26-
{{ else }}
27-
{{/* use the default layout */}}
28-
<div class="flex flex-col gap-2 p-4">
29-
<div class="flex gap-4 items-center">
30-
{{ with .icon }}
31-
{{ if strings.ContainsAny . "/." }}
32-
{{/* image file */}}
33-
<img class="w-[32px] invertible" src="{{ . }}" alt="">
34-
{{ else }}
35-
{{/* icon ligature */}}
36-
<span class="icon-svg">{{ partial "icon" . }}</span>
37-
{{ end }}
24+
</div>
25+
{{ else }}
26+
{{/* use the default layout */}}
27+
<div class="flex flex-col gap-2 p-4">
28+
<div class="flex gap-4 items-center">
29+
{{ with .icon }}
30+
{{ if strings.ContainsAny . "/." }}
31+
{{/* image file */}}
32+
<img class="w-[32px] invertible" src="{{ . }}" alt="">
33+
{{ else }}
34+
{{/* icon ligature */}}
35+
<span class="icon-svg">{{ partial "icon" . }}</span>
3836
{{ end }}
39-
<div>
40-
<div class="text-xl text-gray-light-800 leading-snug dark:text-white flex items-center gap-2">
41-
{{ markdownify .title }}
42-
</div>
37+
{{ end }}
38+
<div>
39+
<div class="text-xl text-gray-light-800 leading-snug dark:text-white flex items-center gap-2">
40+
{{ markdownify .title }}
4341
</div>
4442
</div>
45-
<div class="text-gray-light-500 leading-snug dark:text-gray-dark-700">
46-
{{ .description | markdownify }}
47-
</div>
4843
</div>
49-
{{ end }}
44+
<div class="text-gray-light-600 leading-snug dark:text-gray-dark-700">
45+
{{ .description | markdownify }}
46+
</div>
5047
</div>
51-
{{ if .link }}
52-
</a>
48+
{{ end }}
49+
{{ if .link }}
50+
</a>
5351
{{ end }}
5452
</div>

‎layouts/partials/github-links.html

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,21 @@
22
{{ with .File }}
33
{{ if not (in .Filename "/_vendor/") }}
44
<p class="flex items-center gap-2">
5-
<span class="icon-svg">{{ partial "icon" "edit" }}</span>
5+
<span class="icon-svg">{{ partialCached "icon" "edit" "edit" }}</span>
66
<a class="link" target="_blank" rel="noopener"
7-
href="{{ site.Params.repo }}/edit/main/content/{{ .Path }}">{{ T "editPage" }}
8-
<span class="icon-svg icon-xs icon-top">
9-
{{- partial "icon" "open_in_new" -}}
7+
href="{{ site.Params.repo }}/edit/main/content/{{ .Path }}">{{- T "editPage" -}}
8+
<span class="icon-svg icon-xs">
9+
{{ partialCached "icon" "open_in_new" "open_in_new" }}
1010
</span></a>
1111
</p>
1212
{{ end }}
1313
{{ end }}
1414
<p class="flex items-center gap-2">
15-
<span class="icon-svg">{{ partial "icon" "done" }}</span>
15+
<span class="icon-svg">{{ partialCached "icon" "done" "done" }}</span>
1616
<a class="link" target="_blank" rel="noopener"
17-
href="{{ site.Params.repo }}/issues/new?template=doc_issue.yml&location={{ .Permalink }}&labels=status%2Ftriage">{{ T "requestChanges" }}
18-
<span class="icon-svg icon-xs icon-top">
19-
{{- partial "icon" "open_in_new" -}}
17+
href="{{ site.Params.repo }}/issues/new?template=doc_issue.yml&location={{ .Permalink }}&labels=status%2Ftriage">{{- T "requestChanges" -}}
18+
<span class="icon-svg icon-xs">
19+
{{ partialCached "icon" "open_in_new" "open_in_new" }}
2020
</span></a>
2121
</a>
2222
</p>

‎layouts/partials/head.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
{{ end }}
3939
{{/* preload Roboto Flex as it's a critical font: https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel/preload */}}
4040
<link href="/assets/fonts/RobotoFlex.woff2" rel="preload" as="font" type="font/woff2" crossorigin />
41-
{{ partial "utils/css.html" . }}
41+
{{ partialCached "utils/css.html" "-" }}
4242
{{ $theme := resources.Get "js/theme.js" | js.Build (dict "minify" true) }}
4343
<script>{{ $theme.Content | safeJS }}</script>
4444
{{ $js := resources.Match "js/src/**.js"
@@ -55,4 +55,4 @@
5555
}}
5656
<script defer src="{{ $js.Permalink }}"></script>
5757
<link rel="preconnect" href="https://{{ site.Params.algolia.appid }}-dsn.algolia.net" crossorigin />
58-
{{ partialCached "utils/resources.html" . }}
58+
{{ partialCached "utils/resources.html" "-" }}

‎layouts/partials/header.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
sidebar.classList.replace('md:block', 'md:hidden');
1212
}
1313
}" class="icon-svg hidden px-4 md:block" aria-label="Menu">
14-
{{ partial "icon" "menu" }}
14+
{{ partialCached "icon" "menu" "menu" }}
1515
</button>
1616
{{ end }}
1717
<div>
@@ -31,8 +31,8 @@
3131
localStorage.setItem('theme-preference', value);
3232
document.firstElementChild.className = value;
3333
})" @click="theme = (theme === 'dark' ? 'light' : 'dark')">
34-
<span class="icon-svg dark:hidden">{{ partial "icon" "light_mode"}}</span>
35-
<span class="icon-svg hidden dark:block">{{ partial "icon" "dark_mode"}}</span>
34+
<span class="icon-svg dark:hidden">{{ partialCached "icon" "light_mode" "light_mode"}}</span>
35+
<span class="icon-svg hidden dark:block">{{ partialCached "icon" "dark_mode" "dark_mode"}}</span>
3636
</button>
3737
</div>
3838
</div>

‎layouts/partials/sidebar.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@
4949
{{ markdownify .entry.sectiontitle }}
5050
</span>
5151
<span class="icon-svg {{ if $expanded }}hidden{{ end }}">
52-
{{ partial "icon" "expand_more" }}
52+
{{ partialCached "icon" "expand_more" "expand_more" }}
5353
</span>
5454
<span class="icon-svg {{ if not $expanded }}hidden{{ end }}">
55-
{{ partial "icon" "expand_less" }}
55+
{{ partialCached "icon" "expand_less" "expand_less" }}
5656
</span>
5757
</button>
5858
<ul class="{{if not $expanded}}hidden {{end}}ml-3 md:ml-[21px]">

‎layouts/partials/tooltip.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div data-tooltip-wrapper>
2-
<div data-tooltip-button class="icon-svg icon-sm flex items-center text-blue-light dark:text-blue-dark">
3-
{{ partial "icon" "help" }}
2+
<div data-tooltip-button class="icon-svg flex items-center text-blue-light dark:text-blue-dark">
3+
{{ partialCached "icon" "help" "help" }}
44
</div>
55
<div data-tooltip-body
66
class="absolute left-0 top-0 hidden max-w-56 rounded bg-accent-light p-2 text-white dark:bg-accent-dark"

‎tailwind.config.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ module.exports = {
1212
'pre code': false,
1313
'code::before': false,
1414
'code::after': false,
15-
table: false,
1615
// light colors for prose
1716
"--tw-prose-body": theme("colors.black"),
1817
"--tw-prose-headings": theme("colors.black"),

0 commit comments

Comments
 (0)
Please sign in to comment.