Skip to content
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
6 changes: 6 additions & 0 deletions content/contribute/components/badges.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ You can also make a badge a link.

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

### Usage guidelines

We use the violet badge to highlight new content in our docs: {{< badge color=violet text="New" >}}

Best practice is to use this badge for no longer than 2 months post release of the feature.

### Markup

```go
Expand Down
9 changes: 8 additions & 1 deletion content/contribute/components/call-outs.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ toc_max: 3

We support these broad categories of callouts:

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

## Examples

{{< introduced buildx 0.10.4 "../../release-notes.md#0104" >}}

> **Note**
>
> Note the way the `get_hit_count` function is written. This basic retry
Expand Down Expand Up @@ -62,7 +65,11 @@ For both of the following callouts, consult [the Docker release lifecycle](/rele
> product.
{ .restricted}

## HTML
## Formatting

```go
{{</* introduced buildx 0.10.4 "../../release-notes.md#0104" */>}}
```

```html
> **Note**
Expand Down
42 changes: 42 additions & 0 deletions content/contribute/components/code-blocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,48 @@ incoming := map[string]interface{}{
```
````

## Collapsible code blocks

```dockerfile {collapse=true}
# syntax=docker/dockerfile:1

ARG GO_VERSION="1.21"

FROM golang:${GO_VERSION}-alpine AS base
ENV CGO_ENABLED=0
ENV GOPRIVATE="github.com/foo/*"
RUN apk add --no-cache file git rsync openssh-client
RUN mkdir -p -m 0700 ~/.ssh && ssh-keyscan github.com >> ~/.ssh/known_hosts
WORKDIR /src

FROM base AS vendor
# this step configure git and checks the ssh key is loaded
RUN --mount=type=ssh <<EOT
set -e
echo "Setting Git SSH protocol"
git config --global url."git@github.com:".insteadOf "https://github.com/"
(
set +e
ssh -T git@github.com
if [ ! "$?" = "1" ]; then
echo "No GitHub SSH key loaded exiting..."
exit 1
fi
)
EOT
# this one download go modules
RUN --mount=type=bind,target=. \
--mount=type=cache,target=/go/pkg/mod \
--mount=type=ssh \
go mod download -x

FROM vendor AS build
RUN --mount=type=bind,target=. \
--mount=type=cache,target=/go/pkg/mod \
--mount=type=cache,target=/root/.cache \
go build ...
```

## Bash

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