diff --git a/assets/docs/scss/custom/pages/_helper.scss b/assets/docs/scss/custom/pages/_helper.scss index a9240b8a..02cd33b0 100644 --- a/assets/docs/scss/custom/pages/_helper.scss +++ b/assets/docs/scss/custom/pages/_helper.scss @@ -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 { diff --git a/assets/docs/scss/custom/plugins/icons/_simple-icons.scss b/assets/docs/scss/custom/plugins/icons/_simple-icons.scss new file mode 100644 index 00000000..015838e0 --- /dev/null +++ b/assets/docs/scss/custom/plugins/icons/_simple-icons.scss @@ -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 */ +} \ No newline at end of file diff --git a/exampleSite/hugo.toml b/exampleSite/hugo.toml index 85e39f0a..58086e5d 100644 --- a/exampleSite/hugo.toml +++ b/exampleSite/hugo.toml @@ -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 @@ -173,4 +174,4 @@ defaultContentLanguage = 'en' # name = "Community" # url = "https://github.com/colinwilson/lotusdocs/discussions" # identifier = "community" -# weight = 30 \ No newline at end of file +# weight = 30 diff --git a/layouts/docs/_markup/render-image.html b/layouts/docs/_markup/render-image.html index 8f46d6b8..b87ed033 100644 --- a/layouts/docs/_markup/render-image.html +++ b/layouts/docs/_markup/render-image.html @@ -29,5 +29,7 @@ {{ else }} {{ $text }} {{ end }} + {{ else }} + {{ $text }} {{ end }} -{{ end }} \ No newline at end of file +{{ end }} diff --git a/layouts/docs/list.html b/layouts/docs/list.html index a19f9b1c..6debe589 100644 --- a/layouts/docs/list.html +++ b/layouts/docs/list.html @@ -5,7 +5,11 @@
+ {{ if eq .Params.icontype "simple" -}} + + {{ else -}} {{- .Params.icon | default "article" }} + {{ end -}} {{ if .Draft }}DRAFT{{ end }} {{ if .IsSection }}folder{{ end }} diff --git a/layouts/partials/docs/head.html b/layouts/partials/docs/head.html index fdef7401..45ee56b9 100644 --- a/layouts/partials/docs/head.html +++ b/layouts/partials/docs/head.html @@ -56,6 +56,12 @@ {{ end }} {{- partialCached "google-fonts" . }} + + + {{ if eq .Site.Params.docs.simpleIcons true -}} + + {{ end -}} + {{- $options := dict "enableSourceMap" true }} {{- if hugo.IsProduction}} diff --git a/layouts/partials/docs/sidebar.html b/layouts/partials/docs/sidebar.html index 7e8282d2..67579ca2 100644 --- a/layouts/partials/docs/sidebar.html +++ b/layouts/partials/docs/sidebar.html @@ -19,7 +19,11 @@
  • {{ if eq .Site.Params.docs.sidebarIcons true -}} - {{ .Params.icon }} + {{ if eq .Params.icontype "simple" -}} + + {{ else -}} + {{ .Params.icon }} + {{ end -}} {{ end }} {{ .Title }} diff --git a/layouts/partials/helpers/icon.html b/layouts/partials/helpers/icon.html new file mode 100644 index 00000000..de29eb4a --- /dev/null +++ b/layouts/partials/helpers/icon.html @@ -0,0 +1,12 @@ +{{ define "partials/icon.html" }} +{{- $iconName := .name -}} +{{- $type := .type | default "material" -}} +{{- $class := .class | default "" -}} +{{- $size := .size | default "" -}} + +{{- if eq $type "material" -}} +{{- $iconName -}} +{{- else if eq $type "simple" -}} + +{{- end -}} +{{ end }} \ No newline at end of file