aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFélix Sipma <felix.sipma@no-log.org>2018-02-07 11:36:34 +0100
committerFélix Sipma <felix.sipma@no-log.org>2018-02-07 11:36:34 +0100
commit26da1156056601453c0202cb2f210687950e8916 (patch)
tree0e0357caa7965f5afbf256717516d90683f4d498
parente195067999bea6aa49d3bd532d6c9e72a51e1ef3 (diff)
modify base template
-rw-r--r--layouts/_default/baseof.html22
-rw-r--r--layouts/_default/single.html3
-rw-r--r--layouts/index.html19
-rw-r--r--layouts/partials/footer.html2
-rw-r--r--layouts/partials/header.html10
-rw-r--r--layouts/partials/menu.html16
-rw-r--r--static/css/fournil.css40
7 files changed, 86 insertions, 26 deletions
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html
index a3091e2..b8f7b33 100644
--- a/layouts/_default/baseof.html
+++ b/layouts/_default/baseof.html
@@ -4,10 +4,28 @@
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1">
<title>{{ block "title" . }}{{ .Site.Title }} - {{ .Title }}{{ end }}</title>
- <link href="css/bootstrap.min.css" rel="stylesheet" type="text/css">
- <link href="css/fournil.css" rel="stylesheet" type="text/css">
+ <link href="{{ .Site.BaseURL }}css/bootstrap.min.css" rel="stylesheet" type="text/css">
+ <link href="{{ .Site.BaseURL }}css/fournil.css" rel="stylesheet" type="text/css">
</head>
<body>
+ {{ block "header" . }}
+<div class="header">
+ <div class="logo">
+ <img class="logo-img" src="{{ .Site.BaseURL }}img/logo_pain_transparent.png" alt="logo">
+ <address>
+ <span class="title">{{ .Site.Title }}</span>
+ {{ range $address := .Site.Params.Address }}
+ <span class="address">{{ $address }}</span>
+ {{ end }}
+ <span class="phone">{{ .Site.Params.Phone }}</span>
+ <span class="email">
+ <a href="mailto:{{ .Site.Params.Email }}">{{ .Site.Params.Email }}</a>
+ </span>
+ </address>
+ </div>
+</div>
+{{ partial "menu.html" . }}
+ {{ end }}
{{ block "main" . }}
{{ end }}
{{ block "footer" . }}
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
new file mode 100644
index 0000000..9983b08
--- /dev/null
+++ b/layouts/_default/single.html
@@ -0,0 +1,3 @@
+{{ define "main" }}
+{{ .Content }}
+{{ end }}
diff --git a/layouts/index.html b/layouts/index.html
index ef838a0..2085ea5 100644
--- a/layouts/index.html
+++ b/layouts/index.html
@@ -1,3 +1,22 @@
+{{ define "header" }}
+<div class="header">
+ <div class="logo">
+ <img class="logo-img" src="{{ .Site.BaseURL }}img/logo_pain_transparent.png" alt="logo">
+ <address>
+ <span class="title">{{ .Site.Title }}</span>
+ {{ range $address := .Site.Params.Address }}
+ <span class="address">{{ $address }}</span>
+ {{ end }}
+ <span class="phone">{{ .Site.Params.Phone }}</span>
+ <span class="email">
+ <a href="mailto:{{ .Site.Params.Email }}">{{ .Site.Params.Email }}</a>
+ </span>
+ </address>
+ </div>
+</div>
+{{ partial "menu.html" . }}
+{{ end}}
+
{{ define "main" }}
<div class="container-fluid">
<div class="vertical-align">
diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html
deleted file mode 100644
index b605728..0000000
--- a/layouts/partials/footer.html
+++ /dev/null
@@ -1,2 +0,0 @@
- </body>
-</html>
diff --git a/layouts/partials/header.html b/layouts/partials/header.html
deleted file mode 100644
index 1dd19bc..0000000
--- a/layouts/partials/header.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<!DOCTYPE html>
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr-fr">
- <head>
- <meta http-equiv="content-type" content="text/html; charset=utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1">
- <title>Fournil Sipma</title>
- <link href="css/bootstrap.min.css" rel="stylesheet" type="text/css">
- <link href="css/fournil.css" rel="stylesheet" type="text/css">
- </head>
- <body>
diff --git a/layouts/partials/menu.html b/layouts/partials/menu.html
new file mode 100644
index 0000000..0e2f5cc
--- /dev/null
+++ b/layouts/partials/menu.html
@@ -0,0 +1,16 @@
+<nav class="navbar navbar-expand-lg navbar-light bg-light navbar-sticky">
+ <a class="navbar-brand" href={{ .Site.BaseURL }}>{{ .Site.Title }}</a>
+ <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNavDropdown" aria-controls="navbarNavDropdown" aria-expanded="false" aria-label="Afficher/Cacher le menu">
+ <span class="navbar-toggler-icon"></span>
+ </button>
+ <div class="collapse navbar-collapse" id="navbarNavDropdown">
+ <ul class="navbar-nav">
+ {{ $currentPage := . }}
+ {{ range .Site.Menus.main }}
+ <li class="nav-item{{if or ($currentPage.IsMenuCurrent "main" .) ($currentPage.HasMenuCurrent "main" .) }} active{{end}}">
+ <a class="nav-link" href="{{ .URL }}" title="{{ .Name }}">{{ .Name }}</a>
+ </li>
+ {{ end }}
+ </ul>
+ </div>
+</nav>
diff --git a/static/css/fournil.css b/static/css/fournil.css
index c9f8db5..2fafe55 100644
--- a/static/css/fournil.css
+++ b/static/css/fournil.css
@@ -1,31 +1,47 @@
html, body {
- height: 100%;
- width: 100%;
}
body {
- background-image: url("../img/travaux.jpg");
- background-size: cover;
- background-color: #cccccc;
}
.container-fluid {
}
.vertical-align {
+}
+
+.banner {
+}
+
+.header {
display: flex;
align-items: center;
- min-height: 100vh;
+ background: #f4f4f4 url(../img/farine.jpg) top center;
+ background-size: cover;
text-align: center;
+ width: 100%;
+ min-height: 400px
}
-.banner {
- text-align: center;
- color: black;
- background-color: white;
+.logo {
width: 100%;
}
-h1 {
- font-size: 60px;
+.logo-img {
+ vertical-align: middle;
+ display: block;
+ width: 400px;
+ overflow: hidden;
+ margin: 0 auto;
+}
+
+.logo address span {
+ font-size: 20px;
+}
+
+.logo address span {
+ display: block;
+}
+
+.header nav {
}