Skip to content

Commit bfc050d

Browse files
committed
fix: landing page is not modified after [email protected] upgrade
ref: colinwilson/lotusdocs#148
1 parent 4eb89bb commit bfc050d

File tree

3 files changed

+42
-3
lines changed

3 files changed

+42
-3
lines changed

data/landing.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
hero:
55
enable: true
66
weight: 10
7+
template: 'hero'
78

89
# backgroundImage:
910
# path: 'images/templates/hero'
@@ -45,9 +46,10 @@ hero:
4546
# info: '**Open Source** MIT Licensed.'
4647

4748
# Features Grid
48-
features:
49+
featureGrid:
4950
enable: true
5051
weight: 20
52+
template: 'feature_grid'
5153

5254
title: 스꾸딩의 스터디는 어떻게 진행되나요?
5355
subtitle: 신입 팀원들은 프로젝트에 참여하기 전, 한 학기 동안 스터디를 진행해요. 프로젝트에 필요한 기술을 익히고, 실제 프로젝트에 적용해보는 시간을 가질 수 있어요.
@@ -78,9 +80,10 @@ features:
7880
description: 스터디 중에 궁금한 점이 생기면, Teams 채널에 자유롭게 질문해주세요. 멘토들이 최대한 도와드릴 거예요!
7981

8082
# Image compare
81-
image_compare:
83+
imageCompare:
8284
enable: false
83-
# weight: 30
85+
weight: 30
86+
template: 'image_compare'
8487

8588
# title: Customise The Lotus Docs Appearance
8689
# 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.

hugo.toml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,17 @@ url = "/docs/frontend/"
4646
identifier = "community"
4747
weight = 30
4848

49+
[[menu.primary]]
50+
name = "Plan"
51+
url = "/docs/plan/"
52+
identifier = "plan"
53+
weight = 40
54+
55+
[[menu.primary]]
56+
name = "Design"
57+
url = "/docs/design/"
58+
identifier = "design"
59+
weight = 50
60+
4961
[markup.goldmark.renderer]
5062
unsafe = true # raw HTML support

layouts/index.html

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{{ define "main" }}
2+
{{ $landingData := .Site.Data.landing }}
3+
{{ $map := newScratch }}
4+
5+
{{ range $key, $value := $landingData }}
6+
{{ $sectionTitle := (index $key) }}
7+
{{ $weight := string ($value.weight) }}
8+
{{ $template := string (replaceRE `( |-{1,})` "_" $value.template) }}
9+
{{ with and $template $weight }}
10+
{{ $map.SetInMap "wgtTpl" $sectionTitle (dict
11+
"weight" $weight
12+
"template" $template
13+
"sectionTitle" $sectionTitle
14+
)}}
15+
{{ end }}
16+
{{ end }}
17+
18+
{{ range sort ($map.Get "wgtTpl") ".weight" }}
19+
{{ $.Scratch.Set "sectionTitle" .sectionTitle }}
20+
{{ $path := printf "landing/%s.html" .template }}
21+
{{ partial $path $.Page }}
22+
{{ end }}
23+
{{/* printf "%s" (sort ($map.Get "wgtTpl") ".weight" ) */}}
24+
{{ end }}

0 commit comments

Comments
 (0)