Skip to content

Commit b061637

Browse files
authored
Minor contribute updates (#19752)
* Minor contribute updates * Minor contribute updates
1 parent cf72851 commit b061637

File tree

3 files changed

+56
-1
lines changed

3 files changed

+56
-1
lines changed

content/contribute/components/badges.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ You can also make a badge a link.
1616

1717
[{{< badge color="blue" text="badge with a link" >}}](../_index.md)
1818

19+
### Usage guidelines
20+
21+
We use the violet badge to highlight new content in our docs: {{< badge color=violet text="New" >}}
22+
23+
Best practice is to use this badge for no longer than 2 months post release of the feature.
24+
1925
### Markup
2026

2127
```go

content/contribute/components/call-outs.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ toc_max: 3
66

77
We support these broad categories of callouts:
88

9+
- Version callouts
910
- Notes (no HTML attribute required)
1011
- Tips, which use the `{ .tip }` class
1112
- Important, which use the `{ .important }` class
@@ -15,6 +16,8 @@ We support these broad categories of callouts:
1516

1617
## Examples
1718

19+
{{< introduced buildx 0.10.4 "../../release-notes.md#0104" >}}
20+
1821
> **Note**
1922
>
2023
> Note the way the `get_hit_count` function is written. This basic retry
@@ -62,7 +65,11 @@ For both of the following callouts, consult [the Docker release lifecycle](/rele
6265
> product.
6366
{ .restricted}
6467

65-
## HTML
68+
## Formatting
69+
70+
```go
71+
{{</* introduced buildx 0.10.4 "../../release-notes.md#0104" */>}}
72+
```
6673

6774
```html
6875
> **Note**

content/contribute/components/code-blocks.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,48 @@ incoming := map[string]interface{}{
5050
```
5151
````
5252

53+
## Collapsible code blocks
54+
55+
```dockerfile {collapse=true}
56+
# syntax=docker/dockerfile:1
57+
58+
ARG GO_VERSION="1.21"
59+
60+
FROM golang:${GO_VERSION}-alpine AS base
61+
ENV CGO_ENABLED=0
62+
ENV GOPRIVATE="github.com/foo/*"
63+
RUN apk add --no-cache file git rsync openssh-client
64+
RUN mkdir -p -m 0700 ~/.ssh && ssh-keyscan github.com >> ~/.ssh/known_hosts
65+
WORKDIR /src
66+
67+
FROM base AS vendor
68+
# this step configure git and checks the ssh key is loaded
69+
RUN --mount=type=ssh <<EOT
70+
set -e
71+
echo "Setting Git SSH protocol"
72+
git config --global url."[email protected]:".insteadOf "https://github.com/"
73+
(
74+
set +e
75+
76+
if [ ! "$?" = "1" ]; then
77+
echo "No GitHub SSH key loaded exiting..."
78+
exit 1
79+
fi
80+
)
81+
EOT
82+
# this one download go modules
83+
RUN --mount=type=bind,target=. \
84+
--mount=type=cache,target=/go/pkg/mod \
85+
--mount=type=ssh \
86+
go mod download -x
87+
88+
FROM vendor AS build
89+
RUN --mount=type=bind,target=. \
90+
--mount=type=cache,target=/go/pkg/mod \
91+
--mount=type=cache,target=/root/.cache \
92+
go build ...
93+
```
94+
5395
## Bash
5496

5597
Use the `bash` language code block when you want to show a Bash script:

0 commit comments

Comments
 (0)