Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Add the ability to deprecate icons #1150

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion docs/assets/scss/docs.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
@import "bootstrap/breadcrumb";
// @import "bootstrap/pagination";
// @import "bootstrap/badge";
// @import "bootstrap/alert";
@import "bootstrap/alert";
// @import "bootstrap/progress";
// @import "bootstrap/list-group";
@import "bootstrap/close";
Expand Down
11 changes: 11 additions & 0 deletions docs/content/icons/~deprecated.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
# TODO XXX
# PREVIEW FILE -- REMOVE BEFORE RELEASE
title: Deprecated Example
categories:
- Files and folders
tags:
- box
- delete
deprecated: true
---
6 changes: 6 additions & 0 deletions docs/layouts/icons/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ <h1>{{ .Title }}</h1>
</div>
</div>

{{ if .Params.deprecated -}}
<div class="alert alert-danger my-3" role="alert">
<strong>Deprecation notice:</strong> This icon is deprecated and will be removed in an upcoming version!
</div>
{{- end }}

<hr class="my-4">

{{- $localSvgPath := printf "/icons/%s.svg" .File.TranslationBaseName -}}
Expand Down
30 changes: 16 additions & 14 deletions docs/layouts/partials/icons.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,22 @@ <h2 id="icons" class="mb-0">Icons</h2>
{{ range (where .Site.RegularPages "Type" "icons") -}}
{{- $filename := .File.TranslationBaseName -}}
{{- with .Site.GetPage .File.Path }}
<li class="col mb-4"{{ with .Params.tags }} data-tags="{{ delimit . " " }}"{{ end }}{{ with .Params.categories }} data-categories="{{ delimit . " " | lower }}"{{ end }}>
<a class="d-block text-body-emphasis text-decoration-none" href="{{ .RelPermalink }}">
<div class="px-3 py-4 mb-2 bg-body-secondary text-center rounded">
{{ if $.IsHome -}}
<i class="bi bi-{{ $filename }}"></i>
{{- else -}}
<svg class="bi" width="1em" height="1em" fill="currentColor">
<use xlink:href="../bootstrap-icons.svg#{{ $filename }}"/>
</svg>
{{- end }}
</div>
<div class="name text-muted text-decoration-none text-center pt-1">{{ $filename }}</div>
</a>
</li>
{{- if not (.Params.deprecated) }}
<li class="col mb-4"{{ with .Params.tags }} data-tags="{{ delimit . " " }}"{{ end }}{{ with .Params.categories }} data-categories="{{ delimit . " " | lower }}"{{ end }}>
<a class="d-block text-body-emphasis text-decoration-none" href="{{ .RelPermalink }}">
<div class="px-3 py-4 mb-2 bg-body-secondary text-center rounded">
{{ if $.IsHome -}}
<i class="bi bi-{{ $filename }}"></i>
{{- else -}}
<svg class="bi" width="1em" height="1em" fill="currentColor">
<use xlink:href="../bootstrap-icons.svg#{{ $filename }}"/>
</svg>
{{- end }}
</div>
<div class="name text-muted text-decoration-none text-center pt-1">{{ $filename }}</div>
</a>
</li>
{{- end }}
{{- end }}
{{- end }}
</ul>
Expand Down