Skip to content
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
27 changes: 27 additions & 0 deletions assets/docs/scss/custom/pages/_helper.scss
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,33 @@
font-feature-settings: 'liga';
}

// Simple icons
.si {
font-weight: normal;
font-style: normal;
font-size: 24px;
/* Preferred icon size */
display: inline-block;
line-height: 1;
text-transform: none;
letter-spacing: normal;
word-wrap: normal;
white-space: nowrap;
direction: ltr;
overflow: hidden;

/* Support for all WebKit browsers. */
-webkit-font-smoothing: antialiased;
/* Support for Safari and Chrome. */
text-rendering: optimizeLegibility;

/* Support for Firefox. */
-moz-osx-font-smoothing: grayscale;

/* Support for IE. */
font-feature-settings: 'liga';
}

/* Recommended icon sizes */
span,
i {
Expand Down
10 changes: 10 additions & 0 deletions assets/docs/scss/custom/plugins/icons/_simple-icons.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// Simple Icons

@font-face {
font-family: 'Simple Icons';
font-weight: 400;
font-display: block;
font-style: normal;
src: local('Simple Icons'), local('SimpleIcons'),
url('https://cdn.jsdelivr.net/npm/simple-icons-font@v14.12.3/font/simple-icons.min.css') format('woff2'), /* Super Modern Browsers */
}
3 changes: 2 additions & 1 deletion exampleSite/hugo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ defaultContentLanguage = 'en'
# pathName = "docs" # path name for documentation site | default "docs"

# themeColor = "cyan" # (optional) - Set theme accent colour. Options include: blue (default), green, red, yellow, emerald, cardinal, magenta, cyan
simpleIcons = true

darkMode = true # enable dark mode option? default false

Expand Down Expand Up @@ -173,4 +174,4 @@ defaultContentLanguage = 'en'
# name = "Community"
# url = "https://github.com/colinwilson/lotusdocs/discussions"
# identifier = "community"
# weight = 30
# weight = 30
4 changes: 3 additions & 1 deletion layouts/docs/_markup/render-image.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,7 @@
{{ else }}
<img src="{{ .RelPermalink | safeURL }}" alt="{{ $text }}" width="{{ .Width }}" height="{{ .Height }}" loading="lazy">
{{ end }}
{{ else }}
<img src="{{ .Destination | safeURL }}" alt="{{ $text }}" loading="lazy">
{{ end }}
{{ end }}
{{ end }}
4 changes: 4 additions & 0 deletions layouts/docs/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
<a class="text-decoration-none text-reset" href="{{ .Permalink }}">
<div class="card h-100 features feature-full-bg rounded p-4 position-relative overflow-hidden border-1">
<span class="icon-color d-flex my-3">
{{ if eq .Params.icontype "simple" -}}
<i class="si si-{{ .Params.icon }} align-middle"></i>
{{ else -}}
<i class="material-icons align-middle">{{- .Params.icon | default "article" }}</i>
{{ end -}}
{{ if .Draft }}<span class="badge bg-default ms-2 fs-6 align-middle">DRAFT</span>{{ end }}
{{ if .IsSection }}<i class="material-icons icon-faint align-middle ms-auto" title="Directory">folder</i>{{ end }}
</span>
Expand Down
6 changes: 6 additions & 0 deletions layouts/partials/docs/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@
{{ end }}
<!-- Google Fonts -->
{{- partialCached "google-fonts" . }}

<!-- Simple Icons -->
{{ if eq .Site.Params.docs.simpleIcons true -}}
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/simple-icons-font@v9/font/simple-icons.min.css">
{{ end -}}

<!-- Custom CSS -->
{{- $options := dict "enableSourceMap" true }}
{{- if hugo.IsProduction}}
Expand Down
12 changes: 10 additions & 2 deletions layouts/partials/docs/sidebar.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@
<li class="sidebar-dropdown {{ if eq .Site.Params.docs.sidebarIcons true -}}{{ else }}no-icon{{ end }} {{ if $active }}current active{{ end }}">
<button class="btn">
{{ if eq .Site.Params.docs.sidebarIcons true -}}
<i class="material-icons me-2">{{- .Params.icon | default "notes" }}</i>
{{ if eq .Params.icontype "simple" -}}
<i class="si si-{{ .Params.icon }} me-2"></i>
{{ else -}}
<i class="material-icons me-2">{{- .Params.icon | default "notes" }}</i>
{{ end -}}
{{ end }}
{{- .Title }}
</button>
Expand Down Expand Up @@ -94,7 +98,11 @@
<li class="{{ if $active }}current{{ end }}">
<a class="sidebar-root-link" href="{{ .Permalink }}">
{{ if eq .Site.Params.docs.sidebarIcons true -}}
<i class="material-icons me-2">{{ .Params.icon }}</i>
{{ if eq .Params.icontype "simple" -}}
<i class="si si-{{ .Params.icon }} me-2"></i>
{{ else -}}
<i class="material-icons me-2">{{ .Params.icon }}</i>
{{ end -}}
{{ end }}
{{ .Title }}
</a>
Expand Down
12 changes: 12 additions & 0 deletions layouts/partials/helpers/icon.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{{ define "partials/icon.html" }}
{{- $iconName := .name -}}
{{- $type := .type | default "material" -}}
{{- $class := .class | default "" -}}
{{- $size := .size | default "" -}}

{{- if eq $type "material" -}}
<i class="material-icons align-middle {{- with $size }} size-{{.}}{{- end }} {{- with $class }} {{.}}{{- end }}">{{- $iconName -}}</i>
{{- else if eq $type "simple" -}}
<i class="si si-{{- $iconName }} align-middle {{- with $size }} size-{{.}}{{- end }} {{- with $class }} {{.}}{{- end }}"></i>
{{- end -}}
{{ end }}