diff --git a/assets/css/main.css b/assets/css/main.css new file mode 100644 index 0000000..e69de29 diff --git a/hugo.toml b/hugo.toml index e961499..ff3d83d 100644 --- a/hugo.toml +++ b/hugo.toml @@ -2,3 +2,28 @@ baseURL = 'https://adlc.dawl.fr/' languageCode = 'fr' title = 'Les amis de la chapelle Victoria' 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 diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 8153aca..b1a364b 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -1,7 +1,20 @@ - - + + + {{ partial "head.html" . }} + - {{ block "main" . }}{{ end }} +
+ {{ partial "header.html" . }} +
+
+ {{ block "main" . }}{{ end }} +
+ diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html new file mode 100644 index 0000000..a7cd916 --- /dev/null +++ b/layouts/partials/footer.html @@ -0,0 +1 @@ +

Copyright {{ now.Year }}. All rights reserved.

diff --git a/layouts/partials/head.html b/layouts/partials/head.html new file mode 100644 index 0000000..6915617 --- /dev/null +++ b/layouts/partials/head.html @@ -0,0 +1,10 @@ + + + + {{ if .IsHome }} + {{ site.Title }} + {{ else }} + {{ printf "%s | %s" .Title site.Title }} + {{ end }} + +{{ partialCached "head/css.html" . }} diff --git a/layouts/partials/head/css.html b/layouts/partials/head/css.html new file mode 100644 index 0000000..9efb248 --- /dev/null +++ b/layouts/partials/head/css.html @@ -0,0 +1,14 @@ +{{- with resources.Get "css/main.css" }} + {{- if eq hugo.Environment "development" }} + + {{- else }} + {{- with . | minify | fingerprint }} + + {{- end }} + {{- end }} +{{- end }} diff --git a/layouts/partials/header.html b/layouts/partials/header.html new file mode 100644 index 0000000..7980a00 --- /dev/null +++ b/layouts/partials/header.html @@ -0,0 +1,2 @@ +

{{ site.Title }}

+{{ partial "menu.html" (dict "menuID" "main" "page" .) }} diff --git a/layouts/partials/menu.html b/layouts/partials/menu.html new file mode 100644 index 0000000..aa1a94f --- /dev/null +++ b/layouts/partials/menu.html @@ -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 }} + +{{- 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 }} +
  • + {{ $name }} + {{- with .Children }} + + {{- end }} +
  • + {{- end }} +{{- end }}