rm backslashes in hugo create guide
This commit is contained in:
parent
1eb8fcf815
commit
7255be4c82
@ -72,13 +72,13 @@ Dans le dossier `layouts` on créé l'arborescence suivante:
|
||||
??? note "**layouts/index.html**"
|
||||
=== "Contenu"
|
||||
```
|
||||
{\{define "main"}}
|
||||
{\{ partial "hero.html" }}
|
||||
{\{end}}
|
||||
{{define "main"}}
|
||||
{{ partial "hero.html" }}
|
||||
{{end}}
|
||||
```
|
||||
=== "Explication"
|
||||
Il s'agit d'un template spécifique à la page d'accueil.
|
||||
On appelle le template `layouts/default/baseof.html` avec la directive `{\{define main}}`.
|
||||
On appelle le template `layouts/default/baseof.html` avec la directive `{{define main}}`.
|
||||
On appelle aussi `partials/hero.html`, qui est en quelque sort le slogan de bannière du site.
|
||||
|
||||
??? note "**layouts/partials/hero.html**"
|
||||
@ -86,24 +86,24 @@ Dans le dossier `layouts` on créé l'arborescence suivante:
|
||||
```
|
||||
<main class="hero">
|
||||
<div class="hero__caption" >
|
||||
{\{ .Content }}
|
||||
{{ .Content }}
|
||||
</div>
|
||||
</main>
|
||||
```
|
||||
=== "Explication"
|
||||
La directive `{\{ .Content }}` récupère le contenu de `content/_index.md` après les balises de l'en-tête Toml.
|
||||
La directive `{{ .Content }}` récupère le contenu de `content/_index.md` après les balises de l'en-tête Toml.
|
||||
|
||||
??? note "**layouts/default/baseof.html**"
|
||||
=== "Contenu"
|
||||
```
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
{\{- partial "head.html" . -}}
|
||||
{{- partial "head.html" . -}}
|
||||
|
||||
<body>
|
||||
{\{- partial "header.html" . -}}
|
||||
{\{- block "main" . }}{\{- end }}
|
||||
{\{- partial "footer.html" . -}}
|
||||
{{- partial "header.html" . -}}
|
||||
{{- block "main" . }}{\{- end }}
|
||||
{{- partial "footer.html" . -}}
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@ -119,13 +119,13 @@ Dans le dossier `layouts` on créé l'arborescence suivante:
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="robots" content="index, follow" />
|
||||
<title>{\{ $.Site.Title }} - {\{ .Title }}</title>
|
||||
<link rel="icon" href="{\{ $.Site.BaseURL }}{\{ $.Site.Params.favicon }}" />
|
||||
<meta name="description" content="{\{ $.Site.Params.description }}" />
|
||||
<title>{{ $.Site.Title }} - {{ .Title }}</title>
|
||||
<link rel="icon" href="{{ $.Site.BaseURL }}{{ $.Site.Params.favicon }}" />
|
||||
<meta name="description" content="{{ $.Site.Params.description }}" />
|
||||
|
||||
{\{ hugo.Generator }}
|
||||
{{ hugo.Generator }}
|
||||
<!-- CSS -->
|
||||
{\{ partial "styles.html" . }}
|
||||
{{ partial "styles.html" . }}
|
||||
</head>
|
||||
```
|
||||
=== "Explication"
|
||||
@ -139,12 +139,12 @@ Dans le dossier `layouts` on créé l'arborescence suivante:
|
||||
```
|
||||
<header class="header">
|
||||
<div class="header__title">
|
||||
<a href="{\{ "/" | relLangURL }}" class="header__title__link" alt="Home">
|
||||
{\{ if $.Site.Params.logo }}
|
||||
<img src="{\{ $.Site.BaseURL }}{\{ $.Site.Params.logo }}" class="header__title__logo" alt="{\{ $.Site.Title }}">
|
||||
{\{ else }}
|
||||
{\{ $.Site.Title }}
|
||||
{\{ end }}
|
||||
<a href="{{ "/" | relLangURL }}" class="header__title__link" alt="Home">
|
||||
{{ if $.Site.Params.logo }}
|
||||
<img src="{{ $.Site.BaseURL }}{{ $.Site.Params.logo }}" class="header__title__logo" alt="{{ $.Site.Title }}">
|
||||
{{ else }}
|
||||
{{ $.Site.Title }}
|
||||
{{ end }}
|
||||
</a>
|
||||
</div>
|
||||
</header>
|
||||
@ -174,11 +174,11 @@ Dans le dossier `layouts` on créé l'arborescence suivante:
|
||||
??? note "**layouts/partials/styles.html**"
|
||||
=== "Contenu"
|
||||
```
|
||||
{\{ $style := resources.Get "css/style.css" }}
|
||||
{\{ $base := resources.Get "css/base.css" }}
|
||||
{\{ $bundle := slice $style $base | resources.Concat "css/bundle.css" }}
|
||||
{\{ $css := $bundle | resources.Minify }}
|
||||
<link rel="stylesheet" href="{\{ $css.Permalink }}">
|
||||
{{ $style := resources.Get "css/style.css" }}
|
||||
{{ $base := resources.Get "css/base.css" }}
|
||||
{{ $bundle := slice $style $base | resources.Concat "css/bundle.css" }}
|
||||
{{ $css := $bundle | resources.Minify }}
|
||||
<link rel="stylesheet" href="{{ $css.Permalink }}">
|
||||
=== "Explication"
|
||||
On appelle les fichiers `style.css` et `base.css` dans `assets/css/` et on les minimise, après les avoir concaténés.
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user