Skip to content

Commit

Permalink
Generate font page with Hugo
Browse files Browse the repository at this point in the history
  • Loading branch information
XhmikosR committed Feb 7, 2021
1 parent 25dc626 commit a2e8bc7
Show file tree
Hide file tree
Showing 12 changed files with 54 additions and 5,179 deletions.
2 changes: 1 addition & 1 deletion .fantasticonrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module.exports = {
inputDir: './icons', // (required)
outputDir: './font', // (required)
fontTypes: ['woff2', 'woff'],
assetTypes: ['css', 'json', 'html'],
assetTypes: ['css', 'json'],
name: 'bootstrap-icons',
prefix: 'bi',
selector: '.bi',
Expand Down
53 changes: 0 additions & 53 deletions build/font/html.hbs

This file was deleted.

5 changes: 5 additions & 0 deletions docs/content/font.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: Bootstrap Icons Font
description: TBF
layout: font
---
4 changes: 2 additions & 2 deletions docs/layouts/_default/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
</head>
<body class="d-flex flex-column min-vh-100">
{{ partialCached "skippy" . }}
{{ partialCached "navbar" . }}
{{ partialCached "navbar" . "404" }}

<main class="my-auto p-5" id="content" role="main">
{{ .Content }}
</main>

{{- partialCached "scripts" . .IsHome }}
{{- partialCached "scripts" . "404" }}
</body>
</html>
27 changes: 27 additions & 0 deletions docs/layouts/_default/font.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!doctype html>
<html lang="en">
<head>
{{ partial "header" . }}

<link rel="stylesheet" href="bootstrap-icons.css">
</head>
<body id="icons-body" class="text-center">
{{ partialCached "skippy" . }}
{{ partialCached "navbar" . "fonts" }}

<main class="container" id="content" role="main">
<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">Font</li>
</ol>
</nav>
{{ partialCached "icons" . "fonts" }}

{{ .Content }}
</main>

{{- partialCached "footer" . }}
{{- partialCached "scripts" . "fonts" }}
</body>
</html>
6 changes: 3 additions & 3 deletions docs/layouts/_default/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@
</head>
<body id="icons-body">
{{ partialCached "skippy" . }}
{{ partialCached "navbar" . }}
{{ partialCached "navbar" . "home" }}
{{ partialCached "hero" . }}

<main class="container" id="content" role="main">
{{ partial "icons" . }}
{{ partialCached "icons" . "home" }}

{{ .Content }}
</main>

{{- partialCached "footer" . }}
{{- partialCached "scripts" . .IsHome }}
{{- partialCached "scripts" . "home" }}
</body>
</html>
2 changes: 1 addition & 1 deletion docs/layouts/_default/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</head>
<body id="icons-body">
{{ partialCached "skippy" . }}
{{ partialCached "navbar" . }}
{{ partialCached "navbar" . "list" }}
{{ partialCached "hero" . }}

<main class="container" id="content" role="main">
Expand Down
2 changes: 1 addition & 1 deletion docs/layouts/_default/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</head>
<body id="icons-body">
{{ partialCached "skippy" . }}
{{ partialCached "navbar" . }}
{{ partialCached "navbar" . "single" }}
{{ partialCached "hero" . }}

<main class="container" id="content" role="main">
Expand Down
4 changes: 2 additions & 2 deletions docs/layouts/icons/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</head>
<body id="icons-body">
{{ partialCached "skippy" . }}
{{ partial "navbar" . }}
{{ partial "navbar" . "single" }}

<main class="container icon-examples" id="content" role="main">
<nav>
Expand Down Expand Up @@ -100,6 +100,6 @@ <h2 class="fs-3">Copy HTML</h2>
</main>

{{- partialCached "footer" . }}
{{- partialCached "scripts" . .IsHome }}
{{- partialCached "scripts" . "single" }}
</body>
</html>
19 changes: 11 additions & 8 deletions docs/layouts/partials/icons.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,24 @@ <h2 id="icons" class="mb-0">Icons</h2>
</form>
</div>
<ul class="row row-cols-3 row-cols-sm-4 row-cols-lg-6 row-cols-xl-8 list-unstyled list">
{{ $dirName := "icons" -}}

{{- range (readDir $dirName) -}}
{{- $filenameWithExt := split .Name "." -}}
{{- $filename := index $filenameWithExt 0 -}}
<li class="col mb-4" data-tags="{{ with $.Site.GetPage "icons" $filename }}{{ with .Params.tags }}{{ delimit . " " }}{{ end }}{{ end }}">
<a class="d-block text-dark text-decoration-none" href="/icons/{{ $filename }}/">
{{ range (where site.RegularPages "Type" "icons") -}}
{{- $filename := .File.TranslationBaseName -}}
{{- with .Site.GetPage "icons" $filename }}
<li class="col mb-4"{{ with .Params.tags }} data-tags="{{ delimit . " " }}"{{ end }}>
<a class="d-block text-dark text-decoration-none" href="{{ .RelPermalink }}">
<div class="p-3 py-4 mb-2 bg-light text-center rounded">
{{ if $.IsHome -}}
<svg class="bi" width="1em" height="1em" fill="currentColor">
<use xlink:href="bootstrap-icons.svg#{{ $filename }}"/>
</svg>
{{- else -}}
<i class="bi bi-{{ $filename }}"></i>
{{- end }}
</div>
<div class="name text-muted text-decoration-none text-center pt-1">{{ $filename }}</div>
</a>
</li>
{{ end -}}
{{- end }}
{{- end }}
</ul>
</div>
2 changes: 1 addition & 1 deletion docs/layouts/partials/scripts.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script src="/assets/js/bootstrap.min.js" async></script>
{{- if .IsHome }}
{{- if or .IsHome (eq .Page.Layout "font") }}
<script src="/assets/js/list.min.js"></script>
<script>
new List('icons-body', {
Expand Down
Loading

0 comments on commit a2e8bc7

Please sign in to comment.