Add basic layout
This commit is contained in:
parent
4a087959fc
commit
110765ecc7
8 changed files with 120 additions and 3 deletions
0
assets/css/main.css
Normal file
0
assets/css/main.css
Normal file
25
hugo.toml
25
hugo.toml
|
|
@ -2,3 +2,28 @@ baseURL = 'https://adlc.dawl.fr/'
|
||||||
languageCode = 'fr'
|
languageCode = 'fr'
|
||||||
title = 'Les amis de la chapelle Victoria'
|
title = 'Les amis de la chapelle Victoria'
|
||||||
disableKinds = ['taxonomy', 'term']
|
disableKinds = ['taxonomy', 'term']
|
||||||
|
|
||||||
|
[menu]
|
||||||
|
[[menu.main]]
|
||||||
|
identifier = "concerts"
|
||||||
|
name = "Concerts"
|
||||||
|
url = "/"
|
||||||
|
weight = 1
|
||||||
|
|
||||||
|
[[menu.main]]
|
||||||
|
identifier = "galerie"
|
||||||
|
name = "Galerie"
|
||||||
|
url = "/galerie/"
|
||||||
|
weight = 5
|
||||||
|
|
||||||
|
[[menu.main]]
|
||||||
|
identifier = "apropos"
|
||||||
|
name = "A propos"
|
||||||
|
url = "/apropos/"
|
||||||
|
weight = 10
|
||||||
|
|
||||||
|
[[menu.main]]
|
||||||
|
identifier = "contact"
|
||||||
|
name = "Contact"
|
||||||
|
url = "/contact/"
|
||||||
|
weight = 10
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,20 @@
|
||||||
<!doctype html>
|
<!doctype html>
|
||||||
<html lang="fr" charset="utf-8">
|
<html
|
||||||
<head> </head>
|
lang="{{ site.Language.LanguageCode }}"
|
||||||
|
dir="{{ or site.Language.LanguageDirection `ltr` }}"
|
||||||
|
>
|
||||||
|
<head>
|
||||||
|
{{ partial "head.html" . }}
|
||||||
|
</head>
|
||||||
<body>
|
<body>
|
||||||
{{ block "main" . }}{{ end }}
|
<header>
|
||||||
|
{{ partial "header.html" . }}
|
||||||
|
</header>
|
||||||
|
<main>
|
||||||
|
{{ block "main" . }}{{ end }}
|
||||||
|
</main>
|
||||||
|
<footer>
|
||||||
|
{{ partial "footer.html" . }}
|
||||||
|
</footer>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
1
layouts/partials/footer.html
Normal file
1
layouts/partials/footer.html
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
<p>Copyright {{ now.Year }}. All rights reserved.</p>
|
||||||
10
layouts/partials/head.html
Normal file
10
layouts/partials/head.html
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<meta name="viewport" content="width=device-width" />
|
||||||
|
<title>
|
||||||
|
{{ if .IsHome }}
|
||||||
|
{{ site.Title }}
|
||||||
|
{{ else }}
|
||||||
|
{{ printf "%s | %s" .Title site.Title }}
|
||||||
|
{{ end }}
|
||||||
|
</title>
|
||||||
|
{{ partialCached "head/css.html" . }}
|
||||||
14
layouts/partials/head/css.html
Normal file
14
layouts/partials/head/css.html
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
{{- with resources.Get "css/main.css" }}
|
||||||
|
{{- if eq hugo.Environment "development" }}
|
||||||
|
<link rel="stylesheet" href="{{ .RelPermalink }}" />
|
||||||
|
{{- else }}
|
||||||
|
{{- with . | minify | fingerprint }}
|
||||||
|
<link
|
||||||
|
rel="stylesheet"
|
||||||
|
href="{{ .RelPermalink }}"
|
||||||
|
integrity="{{ .Data.Integrity }}"
|
||||||
|
crossorigin="anonymous"
|
||||||
|
/>
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
2
layouts/partials/header.html
Normal file
2
layouts/partials/header.html
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
<h1>{{ site.Title }}</h1>
|
||||||
|
{{ partial "menu.html" (dict "menuID" "main" "page" .) }}
|
||||||
52
layouts/partials/menu.html
Normal file
52
layouts/partials/menu.html
Normal file
|
|
@ -0,0 +1,52 @@
|
||||||
|
{{- /*
|
||||||
|
Renders a menu for the given menu ID.
|
||||||
|
|
||||||
|
@context {page} page The current page.
|
||||||
|
@context {string} menuID The menu ID.
|
||||||
|
|
||||||
|
@example: {{ partial "menu.html" (dict "menuID" "main" "page" .)
|
||||||
|
}}
|
||||||
|
*/}}
|
||||||
|
{{- $page := .page }}
|
||||||
|
{{- $menuID := .menuID }}
|
||||||
|
|
||||||
|
{{- with index site.Menus $menuID }}
|
||||||
|
<nav>
|
||||||
|
<ul>
|
||||||
|
{{- partial "inline/menu/walk.html" (dict "page" $page "menuEntries" .) }}
|
||||||
|
</ul>
|
||||||
|
</nav>
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{- define "partials/inline/menu/walk.html" }}
|
||||||
|
{{- $page := .page }}
|
||||||
|
{{- range .menuEntries }}
|
||||||
|
{{- $attrs := dict "href" .URL }}
|
||||||
|
{{- if $page.IsMenuCurrent .Menu . }}
|
||||||
|
{{- $attrs = merge $attrs (dict "class" "active" "aria-current" "page") }}
|
||||||
|
{{- else if $page.HasMenuCurrent .Menu . }}
|
||||||
|
{{- $attrs = merge $attrs (dict "class" "ancestor" "aria-current" "true") }}
|
||||||
|
{{- end }}
|
||||||
|
{{- $name := .Name }}
|
||||||
|
{{- with .Identifier }}
|
||||||
|
{{- with T . }}
|
||||||
|
{{- $name = . }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
<li>
|
||||||
|
<a
|
||||||
|
{{- range $k, $v := $attrs }}
|
||||||
|
{{- with $v }}
|
||||||
|
{{- printf " %s=%q" $k $v | safeHTMLAttr }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end -}}
|
||||||
|
>{{ $name }}</a
|
||||||
|
>
|
||||||
|
{{- with .Children }}
|
||||||
|
<ul>
|
||||||
|
{{- partial "inline/menu/walk.html" (dict "page" $page "menuEntries" .) }}
|
||||||
|
</ul>
|
||||||
|
{{- end }}
|
||||||
|
</li>
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue