blob: 0d791da886580eb86746e0d869d80472cfc4782c (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
|
<!doctype html>
<html lang="en">
<head>
{{ partial "head" . }}
</head>
<body id="icons-body">
{{ partialCached "skippy" . }}
{{ partialCached "navbar" . }}
<main class="container icon-examples" id="content">
<nav aria-label="breadcrumb">
<ol class="breadcrumb my-4 p-0">
<li class="breadcrumb-item"><a href="/">Icons</a></li>
<li class="breadcrumb-item active" aria-current="page">{{ .Title }}</li>
</ol>
</nav>
<div class="row align-items-md-center">
<div class="col-md-6 col-lg-8">
<h1>{{ .Title }}</h1>
{{ if or .Params.tags .Params.categories -}}
<ul class="list-unstyled mb-3 mb-md-0">
{{ with .Params.tags }}<li><strong>Tags:</strong> {{ delimit . ", " }}</li>{{ end }}
{{ with .Params.categories }}<li><strong>Category:</strong> {{ delimit . ", " }}</li>{{ end }}
</ul>
{{- end }}
</div>
<div class="col-md-6 col-lg-4">
{{ partialCached "ads" . }}
</div>
</div>
<hr class="my-4">
{{- $localSvgPath := printf "/icons/%s.svg" .File.TranslationBaseName -}}
{{- $svgPath := path.Join "/assets/" $localSvgPath -}}
{{- $svgHtml := readFile $localSvgPath | chomp | safeHTML -}}
<div class="row gx-lg-5">
<div class="col-lg-8 mb-4">
<div class="icon-demo mb-4 border rounded-3 d-flex align-items-center justify-content-center p-3 py-6" style="font-size: 10em" role="img" aria-label="{{ .Title }} - large preview">
{{ $svgHtml }}
</div>
<h2>Examples</h2>
<div class="p-3 p-md-4 border rounded-3 icon-demo-examples">
<div class="fs-2 mb-3">
{{ $svgHtml }}
Heading
</div>
<div class="fs-4 mb-3">
{{ $svgHtml }}
Smaller heading
</div>
<p>
Inline text {{ $svgHtml }}
</p>
<p>
<a href="#" class="text-decoration-none">
Example link text
{{ $svgHtml }}
</a>
</p>
<div class="d-flex gap-2 mb-3">
<button type="button" class="btn btn-primary">
{{ $svgHtml }}
Button
</button>
<button type="button" class="btn btn-success">
{{ $svgHtml }}
Button
</button>
<button type="button" class="btn btn-outline-danger">
{{ $svgHtml }}
Button
</button>
</div>
<div class="d-flex gap-2 mb-3">
<button type="button" class="btn btn-secondary">
{{ $svgHtml }}
</button>
<div class="btn-group">
<button type="button" class="btn btn-outline-secondary">
{{ $svgHtml }}
<span class="visually-hidden">Button</span>
</button>
<button type="button" class="btn btn-outline-secondary">
{{ $svgHtml }}
<span class="visually-hidden">Button</span>
</button>
<button type="button" class="btn btn-outline-secondary">
{{ $svgHtml }}
<span class="visually-hidden">Button</span>
</button>
</div>
</div>
<div class="col-md-6">
<div class="input-group">
<span class="input-group-text" id="basic-addon1">
{{ $svgHtml }}
</span>
<input type="text" class="form-control" placeholder="Input group example" aria-label="Input group example" aria-describedby="basic-addon1">
</div>
</div>
</div>
</div>
<div class="col-lg-4 mb-4">
<h2 class="fs-3">Download</h2>
<p>Download the SVG to use or edit.</p>
<a href="{{ $svgPath }}" class="btn btn-bd-primary mb-4" download>Download SVG</a>
<h2 class="fs-3">Icon font</h2>
<p>Using the web font? Copy, paste, and go.</p>
<div class="mb-4">
{{ $iconFontSnippet := printf `<i class="bi bi-%s"></i>` .File.TranslationBaseName -}}
{{- highlight $iconFontSnippet "html" "" }}
</div>
<h2 class="fs-3">Code point</h2>
<div class="mb-4">
{{ $codepoints := getJSON "font/bootstrap-icons.json" -}}
{{ $hexCodepoint := printf "%X" (int (index $codepoints .File.TranslationBaseName)) }}
<ul class="list-unstyled">
<li>
Unicode: <code>U+{{- $hexCodepoint}}</code>
</li>
<li>
CSS: <code>\{{- $hexCodepoint}}</code>
</li>
<li>
JS: <code>\u{{- $hexCodepoint}}</code>
</li>
<li>
HTML: <code>&#x{{- $hexCodepoint}};</code>
</li>
</ul>
</div>
<h2 class="fs-3">Copy HTML</h2>
<p>Paste the SVG right into your project's code.</p>
<div id="copy-error-callout" class="alert alert-info d-none" role="alert"></div>
{{ highlight $svgHtml "html" "" }}
</div>
</div>
</main>
{{- partialCached "footer" . }}
{{- partialCached "scripts" . "default" }}
</body>
</html>
|