Skip to content

Commit aa834e5

Browse files
authored
Merge branch 'release' into add-rss-atom-feed-autodiscovery
2 parents 2d2cfc0 + 3655fe9 commit aa834e5

File tree

23 files changed

+356
-183
lines changed

23 files changed

+356
-183
lines changed

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66

77
Check out the demo site [https://lotusdocs.dev/docs/](https://lotusdocs.dev/docs/) (also doubles as the documentation guide for Lotus Docs 📖)
88

9-
🚧 **WARNING** 🚧 - **Lotus Docs is currently in pre-release development and thus not recommended for use in production at this time. But please do try it out 😊. Pull requests and feedback are most welcome.**
10-
119
## Features
1210

1311
* [x] Modern documentation layout
@@ -41,7 +39,7 @@ Check out the demo site [https://lotusdocs.dev/docs/](https://lotusdocs.dev/docs
4139

4240
### Requirements
4341

44-
- Hugo **Extended** (minimum version: 0.117.0)
42+
- Hugo **Extended** (minimum version: 0.120.0)
4543
- git
4644
- Go (minimum version v1.20)
4745

Lines changed: 1 addition & 0 deletions
Loading

assets/scss/custom/components/_backgrounds.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ $value in $theme-colors {
77
.bg-#{$name} {
88
background-color: rgba($value, 0.04) !important;
99
}
10+
.bg-hard-#{$name} {
11+
background-color: rgba($value, 1) !important;
12+
}
1013
.bg-soft-#{$name} {
1114
background-color: rgba($value, 0.1) !important;
1215
border: 1px solid rgba($value, 0.1) !important;

assets/scss/custom/structure/_general.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ body {
55
color: $body-color;
66
background-color: $body-bg;
77
}
8+
@media (max-width: 1199px) {
9+
html {
10+
scroll-padding-top: 80px;
11+
}
12+
}
813
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
914
font-family: $font-family-base;
1015
line-height: 1.4;

assets/scss/style.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,6 @@ $font-family-monospace: {{ .Site.Params.mono_font | default "SFMono-Regular, Me
4646
@import "custom/pages/features";
4747
@import "custom/pages/helper";
4848
@import "custom/pages/hero";
49-
{{ if .Site.Data.landing.image_compare.enable }}@import "custom/pages/image-compare-viewer";{{ end }}
49+
{{ if ($.Scratch.Get "image_compare_enabled") }}@import "custom/pages/image-compare-viewer";{{ end }}
5050

5151
// @import "custom/pages/simplebar";

config.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[module]
22
[module.hugoVersion]
33
extended = true
4-
min = "0.100.0"
4+
min = "0.120.0"
55
[[module.imports]]
66
path = "github.com/gohugoio/hugo-mod-bootstrap-scss/v5"
77
disable = false

data/landing.yaml

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,19 @@
44
hero:
55
enable: true
66
weight: 10
7+
template: hero
78

89
backgroundImage:
910
path: "images/templates/hero"
1011
filename:
1112
desktop: "gradient-desktop.webp"
1213
mobile: "gradient-mobile.webp"
1314

14-
# badge:
15-
# text: v0.0.2
16-
# color: primary # primary, secondary, success, danger, warning, info, light, dark
17-
# pill: false # boolean
18-
# soft: true # boolean
15+
badge:
16+
text: v0.1.0
17+
color: primary # primary, secondary, success, danger, warning, info, light, dark
18+
pill: false # boolean
19+
soft: true # boolean
1920

2021
# titleLogo:
2122
# path: "images/logos"
@@ -44,10 +45,11 @@ hero:
4445

4546
info: "**Open Source** MIT Licensed."
4647

47-
# Features Grid
48-
features:
48+
# Feature Grid
49+
featureGrid:
4950
enable: true
5051
weight: 20
52+
template: feature grid
5153

5254
title: Why choose Lotus Docs?
5355
subtitle: Lotus Docs is a highly configurable Hugo documentation theme. Yet, with the default configuration you can deploy and publish your documentation site in a matter of minutes. Check out some core features below.
@@ -79,7 +81,7 @@ features:
7981

8082
- title: Search by DocSearch
8183
icon: search
82-
description: Search your docs with DocSearch. A powerful, efficient and accessible search solution built on Algolia Crawler & Autocomplete. TBC.
84+
description: Search your docs with DocSearch. A powerful, efficient and accessible search solution built on Algolia Crawler & Autocomplete.
8385

8486
- title: Multilingual Support
8587
icon: translate
@@ -90,9 +92,10 @@ features:
9092
description: Built on Bootstrap 5, Lotus Docs allows for a familiar, flexible, and intuitive developer experience. Easily customise your site via SCSS variables and files.
9193

9294
# Image compare
93-
image_compare:
95+
imageCompare:
9496
enable: true
9597
weight: 30
98+
template: image compare
9699

97100
title: Customise The Lotus Docs Appearance
98101
subtitle: Much of Lotus Docs' appearance can be customised. Dark mode is optional (enabled by default) and you can choose a Google font that suites you via the config parameters.

exampleSite/data/landing.yaml

Lines changed: 72 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,19 @@
44
hero:
55
enable: true
66
weight: 10
7+
template: hero
78

89
backgroundImage:
910
path: "images/templates/hero"
1011
filename:
1112
desktop: "gradient-desktop.webp"
1213
mobile: "gradient-mobile.webp"
1314

14-
# badge:
15-
# text: v0.0.2
16-
# color: primary # primary, secondary, success, danger, warning, info, light, dark
17-
# pill: false # boolean
18-
# soft: true # boolean
15+
badge:
16+
text: v0.1.0
17+
color: primary # primary, secondary, success, danger, warning, info, light, dark
18+
pill: false # boolean
19+
soft: true # boolean
1920

2021
# titleLogo:
2122
# path: "images/logos"
@@ -36,18 +37,19 @@ hero:
3637
ctaButton:
3738
icon: rocket_launch
3839
btnText: "Get Started"
39-
url: "/docs/quickstart/"
40+
url: "/docs/quickstart/#create-a-new-lotus-docs-site"
4041
cta2Button:
4142
icon: construction
4243
btnText: "In Development"
4344
url: "https://github.com/colinwilson/lotusdocs"
4445

4546
info: "**Open Source** MIT Licensed."
4647

47-
# Features Grid
48-
features:
48+
# Feature Grid
49+
featureGrid:
4950
enable: true
5051
weight: 20
52+
template: feature grid
5153

5254
title: Why choose Lotus Docs?
5355
subtitle: Lotus Docs is a highly configurable Hugo documentation theme. Yet, with the default configuration you can deploy and publish your documentation site in a matter of minutes. Check out some core features below.
@@ -56,43 +58,102 @@ features:
5658
- title: Fast
5759
icon: speed
5860
description: 4 x 100's score on Google Lighthouse by default. Lotus Docs removes unused CSS, prefetches asset links, and lazy loads content images.
61+
ctaLink:
62+
text: learn more
63+
url: /docs/
5964

6065
- title: SEO Friendly
6166
icon: trending_up
6267
description: Data is automatically structured to be SEO friendly. Includes Meta tags, Opengraph, and Twitter cards. Choose the settings that best suit you.
68+
ctaLink:
69+
text: learn more
70+
url: /docs/
6371

6472
- title: Secure by default
6573
icon: lock
6674
description: Lotus Docs' default configuration scores A+ on Mozilla Observatory. You can update the default Security Headers to suit your requirements.
75+
ctaLink:
76+
text: learn more
77+
url: /docs/
6778

6879
- title: Optional Features
6980
icon: settings
7081
description: Many Lotus Docs features are configurable via optional parameters. Require DocSearch for your site? Then enable it via a single setting.
82+
ctaLink:
83+
text: learn more
84+
url: /docs/
7185

7286
- title: Deploy to Vercel
7387
icon: change_history
7488
description: Deploy to Vercel in seconds. Vercel Functions, Vercel Redirects/Rewrites, and Vercel Headers are all configurable for an enriched experience.
89+
ctaLink:
90+
text: learn more
91+
url: /docs/
7592

7693
- title: Dark Mode
7794
icon: dark_mode
78-
description: "Prefer not to be blasted by the sun while reading? Switch to a low-light UI with the click of a button. Modify colour variables to match your branding."
95+
description: Prefer not to be blasted by the sun while reading? Switch to a low-light UI with the click of a button. Modify colour variables to match your branding.
96+
ctaLink:
97+
text: learn more
98+
url: /docs/
7999

80100
- title: Search by DocSearch
81101
icon: search
82-
description: Search your docs with DocSearch. A powerful, efficient and accessible search solution built on Algolia Crawler & Autocomplete.
102+
description: Search your docs with DocSearch. A powerful, efficient and accessible search solution built on Algolia Crawler & Autocomplete. TBC.
103+
ctaLink:
104+
text: learn more
105+
url: /docs/
83106

84107
- title: Multilingual Support
85108
icon: translate
86109
description: Lotus Docs supports Hugo's Multilingual Mode. Create documentation in multiple languages side by side with i18n support.
110+
ctaLink:
111+
text: learn more
112+
url: /docs/
87113

88114
- title: Bootstrap v5
89115
icon: palette
90116
description: Built on Bootstrap 5, Lotus Docs allows for a familiar, flexible, and intuitive developer experience. Easily customise your site via SCSS variables and files.
117+
ctaLink:
118+
text: learn more
119+
url: /docs/
120+
121+
imageText:
122+
enable: true
123+
weight: 25
124+
template: image text
125+
126+
title: Built with performance and accessability in mind. Top scores on Google's Lighthouse
127+
subtitle: A default Lotus Docs deployment is capable of achieving 4 x 100 scores on Google's Lighthouse performance analysis tool.
128+
129+
list:
130+
- text: Blazing fast page loads
131+
icon: speed
132+
133+
- text: Sensible default SEO friendly settings
134+
icon: area_chart
135+
136+
- text: Designed to be accessible
137+
icon: accessibility
138+
139+
image:
140+
path: "images/templates/single"
141+
filename: "google_lighthouse_circle_v1.0.svg"
142+
alt: "Google LightHouse 100% Illustration" # Optional but recommended
143+
144+
imgOrder:
145+
desktop: 2
146+
mobile: 1
147+
148+
ctaButton:
149+
text: Learn more
150+
url: "/docs/"
91151

92152
# Image compare
93-
image_compare:
153+
imageCompare:
94154
enable: true
95155
weight: 30
156+
template: image compare
96157

97158
title: Customise The Lotus Docs Appearance
98159
subtitle: Much of Lotus Docs' appearance can be customised. Dark mode is optional (enabled by default) and you can choose a Google font that suites you via the config parameters.

exampleSite/hugo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@ defaultContentLanguage = 'en'
109109

110110
# Link behaviour
111111
intLinkTooltip = true # Enable a tooltip for internal links that displays info about the destination? default false
112-
# extLinkNewTab = false # Open external links in a new Tab? default true
112+
# extLinkNewTab = false # Open external links in a new Tab? default true
113+
# logoLinkURL = "" # Set a custom URL destination for the top header logo link.
113114

114115
[params.flexsearch] # Parameters for FlexSearch
115116
enabled = true

layouts/_default/baseof.html

Lines changed: 32 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,25 @@
88
{{ end }}
99
{{ end }}
1010

11+
<!--
12+
Is an image_compare landing page template enabled?
13+
If so, collect and consolidate the items config from each enabled instance
14+
-->
15+
{{ $ic := newScratch }}
16+
{{ range $value := .Site.Data.landing }}
17+
{{ $template := string (replaceRE `( |-{1,})` "_" $value.template) }}
18+
{{ if eq $template "image_compare" }}
19+
{{ if $value.enable }}
20+
{{ $ic.Add "enabled" (slice $value.enable) }}
21+
{{ range $value.items }}
22+
{{ $ic.Add "config" (slice (.config | jsonify | safeJS)) }}
23+
{{ end }}
24+
{{ end }}
25+
{{- end }}
26+
{{ end }}
27+
28+
{{ $.Scratch.Set "image_compare_enabled" (in ($ic.Get "enabled") true) }}
29+
1130
<html lang="{{ site.LanguageCode }}" dir="ltr">
1231
{{- partial "head.html" . -}}
1332
<body>
@@ -28,21 +47,19 @@
2847
{{- $js := (slice $app) | resources.Concat "/js/bundle.js" }}
2948
<script type="text/javascript" src="{{ $js.Permalink }}" {{ if hugo.IsProduction }}integrity="{{ $js.Data.Integrity }}"{{ end }}></script>
3049
{{- end }}
31-
{{ if .Site.Data.landing.image_compare.enable }}
32-
<script>
33-
// Image Compare Viewer
34-
const viewers = document.querySelectorAll(".image-compare");
35-
let configs = [
36-
{{ range .Site.Data.landing.image_compare.items }}
37-
{{ if .config }}
38-
{{ .config | jsonify | safeJS }},
39-
{{ end }}
40-
{{ end }}
41-
];
42-
viewers.forEach((element, i) => {
50+
51+
<!-- Image Compare Viewer Config -->
52+
{{ if ($.Scratch.Get "image_compare_enabled") }}
53+
<script>
54+
const viewers = document.querySelectorAll(".image-compare");
55+
let configs = [
56+
{{ (delimit ($ic.Get `config`) `,`) | safeJS }}
57+
];
58+
viewers.forEach((element, i) => {
4359
let view = new ImageCompare(element, configs[i]).mount();
44-
});
45-
</script>
46-
{{- end }}
60+
});
61+
</script>
62+
{{ end }}
63+
4764
</body>
4865
</html>

0 commit comments

Comments
 (0)