Skip to content

Commit 53ac2e9

Browse files
authored
feat: improve website header layout (#425)
1 parent ac0efe4 commit 53ac2e9

File tree

4 files changed

+60
-64
lines changed

4 files changed

+60
-64
lines changed

config/_default/languages.cs.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ title = "Developer Portal"
88
isoCode = "cs"
99
rtl = false
1010
dateFormat = "2 January 2006"
11-
logo = "img/espressif_logo_contour.png"
12-
# secondaryLogo = "PATH"
1311
description = "The developer resources in just one place!"
1412
# copyright = "Copy, _right?_ :thinking_face:"
1513

@@ -25,4 +23,4 @@ title = "Developer Portal"
2523
{ facebook = "https://www.facebook.com/espressif/" },
2624
{ linkedin = "https://www.linkedin.com/company/espressif-systems/" },
2725
{ github = "https://github.com/espressif" },
28-
]
26+
]

config/_default/languages.en.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
languageCode = "en"
22
languageName = "English"
33
weight = 1
4-
title = "Espressif Developer Portal"
4+
title = "Developer Portal"
55

66
[params]
77
displayName = "EN"
88
isoCode = "en"
99
rtl = false
1010
dateFormat = "2 January 2006"
11-
logo = "img/espressif_logo_contour.png"
12-
# secondaryLogo = "PATH"
1311
description = "The developer resources in just one place!"
1412
# copyright = "Copy, _right?_ :thinking_face:"
1513

config/_default/params.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ mainSections = ["blog"]
1717

1818
disableImageOptimization = false
1919
disableTextInHeader = false
20+
logo = "img/espressif_logo_contour.png"
2021

2122
# defaultBackgroundImage = "/img/ocean.jpg"
2223
# defaultFeaturedImage = "/img/ocean.jpg"

layouts/partials/header/basic.html

Lines changed: 57 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<div style="padding-left:0;padding-right:0;padding-top:2px;padding-bottom:3px"
2-
class="main-menu flex items-center justify-between px-4 py-6 sm:px-6 md:justify-start space-x-3">
2+
class="main-menu flex flex-wrap items-center justify-between px-4 py-6 sm:px-6 md:justify-start space-x-3">
3+
34
{{ if .Site.Params.Logo }}
45
{{ $logo := resources.Get .Site.Params.Logo }}
56
{{ if $logo }}
@@ -18,7 +19,8 @@
1819
</div>
1920
{{ end }}
2021
{{- end }}
21-
<div class="flex flex-1 items-center justify-between">
22+
23+
<div class="flex flex-1 items-center justify-between w-full md:w-auto">
2224
<nav class="flex space-x-3">
2325

2426
{{ if not .Site.Params.disableTextInHeader | default true }}
@@ -62,9 +64,10 @@
6264
{{ end }}
6365

6466
</nav>
65-
<div class="flex md:hidden items-center space-x-5 md:ml-12">
67+
</div>
6668

67-
<span></span>
69+
<div class="w-full flex flex-wrap justify-between md:hidden mt-2 space-y-2">
70+
<div class="flex items-center space-x-5 ml-auto">
6871

6972
{{ partial "translations.html" . }}
7073

@@ -87,63 +90,59 @@
8790
</button>
8891
{{ end }}
8992

90-
</div>
91-
</div>
92-
<div class="-my-2 -mr-2 md:hidden">
93-
94-
<label id="menu-button" class="block">
95-
{{ if .Site.Menus.main }}
96-
<div class="cursor-pointer hover:text-primary-600 dark:hover:text-primary-400">
97-
{{ partial "icon.html" "bars" }}
98-
</div>
99-
<div id="menu-wrapper" style="padding-top:5px;"
100-
class="fixed inset-0 z-30 invisible w-screen h-screen m-0 overflow-auto transition-opacity opacity-0 cursor-default bg-neutral-100/50 backdrop-blur-sm dark:bg-neutral-900/50">
101-
<ul
102-
class="flex space-y-2 mt-3 flex-col items-end w-full px-6 py-6 mx-auto overflow-visible list-none ltr:text-right rtl:text-left max-w-7xl menu-ul">
103-
104-
<li id="menu-close-button">
105-
<span
106-
class="cursor-pointer inline-block align-text-bottom hover:text-primary-600 dark:hover:text-primary-400 menu-close">{{
107-
partial
108-
"icon.html"
109-
"xmark" }}</span>
110-
</li>
111-
112-
{{ range .Site.Menus.main }}
113-
114-
{{ partial "header/header-mobile-option.html" . }}
115-
116-
{{ end }}
117-
118-
</ul>
119-
{{ if .Site.Menus.subnavigation }}
120-
<hr>
121-
<ul
122-
class="flex mt-4 flex-col items-end w-full px-6 py-6 mx-auto overflow-visible list-none ltr:text-right rtl:text-left max-w-7xl">
123-
124-
125-
{{ range .Site.Menus.subnavigation }}
126-
<li class="mb-1">
127-
<a href="{{ .URL }}" {{ if or (strings.HasPrefix .URL "http:" ) (strings.HasPrefix .URL "https:"
128-
) }} target="_blank" {{ end }} class="flex items-center">
129-
{{ if .Pre }}
130-
<span {{ if and .Pre .Name}} class="mr-3" {{ end }}>
131-
{{ partial "icon.html" .Pre }}
93+
<label id="menu-button" class="block">
94+
{{ if .Site.Menus.main }}
95+
<div class="cursor-pointer hover:text-primary-600 dark:hover:text-primary-400">
96+
{{ partial "icon.html" "bars" }}
97+
</div>
98+
<div id="menu-wrapper" style="padding-top:5px;"
99+
class="fixed inset-0 z-30 invisible w-screen h-screen m-0 overflow-auto transition-opacity opacity-0 cursor-default bg-neutral-100/50 backdrop-blur-sm dark:bg-neutral-900/50">
100+
<ul
101+
class="flex space-y-2 mt-3 flex-col items-end w-full px-6 py-6 mx-auto overflow-visible list-none ltr:text-right rtl:text-left max-w-7xl menu-ul">
102+
103+
<li id="menu-close-button">
104+
<span
105+
class="cursor-pointer inline-block align-text-bottom hover:text-primary-600 dark:hover:text-primary-400 menu-close">{{
106+
partial "icon.html" "xmark" }}
132107
</span>
133-
{{ end }}
134-
<p class="text-sm font-sm text-gray-500 hover:text-gray-900" title="{{ .Title }}">
135-
{{ .Name | markdownify | emojify }}
136-
</p>
137-
</a>
138-
</li>
108+
</li>
109+
110+
{{ range .Site.Menus.main }}
111+
112+
{{ partial "header/header-mobile-option.html" . }}
113+
114+
{{ end }}
115+
116+
</ul>
117+
{{ if .Site.Menus.subnavigation }}
118+
<hr>
119+
<ul
120+
class="flex mt-4 flex-col items-end w-full px-6 py-6 mx-auto overflow-visible list-none ltr:text-right rtl:text-left max-w-7xl">
121+
122+
123+
{{ range .Site.Menus.subnavigation }}
124+
<li class="mb-1">
125+
<a href="{{ .URL }}" {{ if or (strings.HasPrefix .URL "http:" ) (strings.HasPrefix .URL "https:"
126+
) }} target="_blank" {{ end }} class="flex items-center">
127+
{{ if .Pre }}
128+
<span {{ if and .Pre .Name}} class="mr-3" {{ end }}>
129+
{{ partial "icon.html" .Pre }}
130+
</span>
131+
{{ end }}
132+
<p class="text-sm font-sm text-gray-500 hover:text-gray-900" title="{{ .Title }}">
133+
{{ .Name | markdownify | emojify }}
134+
</p>
135+
</a>
136+
</li>
137+
{{ end }}
138+
139+
</ul>
140+
{{ end }}
139141
{{ end }}
140142

141-
</ul>
142-
{{ end }}
143-
{{ end }}
144-
145-
</div>
146-
</label>
143+
</div>
144+
</label>
145+
</div>
147146
</div>
148147
</div>
149148

0 commit comments

Comments
 (0)