Skip to content

Commit

Permalink
feat: support of Hugo 0.22+ matcornic#51 matcornic#48 matcornic#11 ma…
Browse files Browse the repository at this point in the history
  • Loading branch information
matcornic committed Aug 20, 2017
1 parent 59c435a commit 6b17b66
Show file tree
Hide file tree
Showing 23 changed files with 498 additions and 388 deletions.
13 changes: 7 additions & 6 deletions archetypes/chapter.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
---
title: "Some Chapter title"
weight: 0
icon: "<b>X. </b>" # HTML code as prefix in the menu
title: "{{ replace .TranslationBaseName "-" " " | title }}"
date: {{ .Date }}
weight: 5
pre: "<b>X. </b>" # HTML code as prefix in the menu
draft: true
---

### Chapter X

# Some Chapter title

Lorem ipsum
Lorem Ipsum.
Notice `draft` is set to true.
8 changes: 5 additions & 3 deletions archetypes/default.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
---
title: "Some Title"
title: "{{ replace .TranslationBaseName "-" " " | title }}"
date: {{ .Date }}
weight: 5
toc: true
draft: true
---

Lorem Ipsum
Lorem Ipsum.
Notice `draft` is set to true.
32 changes: 32 additions & 0 deletions i18n/en.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[Search-placeholder]
other = "Search..."

[Clear-History]
other = "Clear History"

[Page]
other = "Page"

[Next-Pages]
other = "Next Pages"

[Previous-Pages]
other = "Previous Pages"

[pagination-on]
other = "on"

[Attachments-label]
other = "Attachments"

[title-404]
other = "Error"

[message-404]
other = "Woops. Looks like this page doesn't exist."

[Go-to-homepage]
other = "Go to homepage"

[Edit-this-page]
other = "Edit page"
32 changes: 32 additions & 0 deletions i18n/fr.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[Search-placeholder]
other = "Rechercher..."

[Clear-History]
other = "Supprimer l'historique"

[Page]
other = "Page"

[Next-Pages]
other = "Pages suivantes"

[Previous-Pages]
other = "Pages précédentes"

[pagination-on]
other = "sur"

[Attachments-label]
other = "Documents joints"

[title-404]
other = "Erreur"

[message-404]
other = "Oups. On dirait que cette page n'existe pas "

[Go-to-homepage]
other = "Vers la page d'accueil"

[Edit-this-page]
other = "Modifier la page"
32 changes: 32 additions & 0 deletions i18n/nb.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[Search-placeholder]
other = "Søk..."

[Clear-History]
other = "Fjern historikk"

[Page]
other = "Side"

[Next-Pages]
other = "Neste"

[Previous-Pages]
other = "Forrige"

[pagination-on]
other = "av"

[Attachments-label]
other = "Vedlegg"

[title-404]
other = "Feil"

[message-404]
other = "Ups... Ser ikke ut som denne siden eksisterer."

[Go-to-homepage]
other = "Gå til hovedsiden"

[Edit-this-page]
other = "Editer"
21 changes: 11 additions & 10 deletions layouts/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@
<meta charset="utf-8"> {{ partial "meta.html" . }} {{ partial "favicon.html" . }} {{ .Scratch.Add "title" "" }}{{ if eq .Site.Data.titles .Title }}{{ .Scratch.Set "title" (index .Site.Data.titles .Title).title }}{{ else }}{{ .Scratch.Set "title" .Title}}{{end}}
<title>{{ .Scratch.Get "title" }}</title>
{{ partial "style.html" . }}
<link href="{{ .Site.BaseURL }}/css/nucleus.css" rel="stylesheet">
<link href="{{ .Site.BaseURL }}/css/font-awesome.min.css" rel="stylesheet">
<link href="{{ .Site.BaseURL }}/css/hybrid.css" rel="stylesheet">
<link href="{{ .Site.BaseURL }}/css/featherlight.min.css" rel="stylesheet">
<link href="{{ .Site.BaseURL }}/css/perfect-scrollbar.min.css" rel="stylesheet">
<link href="{{ .Site.BaseURL }}/css/theme.css" rel="stylesheet">
<link href="{{ .Site.BaseURL }}/css/hugo-theme.css" rel="stylesheet">

<link href="{{"css/nucleus.css" | relLangURL}}" rel="stylesheet">
<link href="{{"css/font-awesome.min.css" | relLangURL}}" rel="stylesheet">
<link href="{{"css/hybrid.css" | relLangURL}}" rel="stylesheet">
<link href="{{"css/featherlight.min.css" | relLangURL}}" rel="stylesheet">
<link href="{{"css/perfect-scrollbar.min.css" | relLangURL}}" rel="stylesheet">
<link href="{{"css/theme.css" | relLangURL}}" rel="stylesheet">
<link href="{{"css/hugo-theme.css" | relLangURL}}" rel="stylesheet">
<style type="text/css">
:root #header + #content > #left > #rlblock_left {
display: none !important;
Expand All @@ -37,12 +38,12 @@
<div id="overlay"></div>
<div id="chapter">
<div id="body-inner">
<h1>Error </h1>
<h1>{{T "title-404"}}</h1>
<p>
</p>
<p>Woops. Looks like this page doesn't exist.</p>
<p>{{T "message-404"}}</p>
<p></p>
<p><a href="{{.Site.BaseURL}}">Go to homepage</a></p>
<p><a href="{{.Site.BaseURL}}">{{T "Go-to-homepage"}}</a></p>
<p><img src="{{ .Site.BaseURL }}/images/gopher-404.jpg" style="width:50%"></img></p>
</div>
</div>
Expand Down
38 changes: 27 additions & 11 deletions layouts/_default/list.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,29 @@
{{ if .Content }}
{{ partial "header.html" . }}

{{ .Content }}
{{ partial "footer.html" . }}
{{ else }}
{{ with (index (index .Site.Sections .Section) 0) }}
{{ with .Page }}
{{ partial "header.html" . }}
{{ .Content }}
{{ partial "footer.html" . }}
{{ end }}
{{ end }}
{{ end }}

<footer class=" footline" >
{{with .Params.LastModifierDisplayName}}
<i class='fa fa-user'></i> <a href="mailto:{{ $.Params.LastModifierEmail }}">{{ . }}</a> {{with $.Date}} <i class='fa fa-calendar'></i> {{ .Format "02/01/2006" }}{{end}}
</div>
{{end}}
</footer>


{{if not .Content }}
{{ $paginator := .Paginator }}

<div class="extra-pagination inner">
{{ partial "pagination.html" $paginator }}
</div>

{{ range $index, $page := $paginator.Pages }}
{{ .Render "li" }}
{{ end }}

<div style="margin-bottom:2rem"></div>

{{ partial "pagination.html" $paginator }}
{{end}}

{{ partial "footer.html" . }}
10 changes: 10 additions & 0 deletions layouts/_default/single.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
{{ partial "header.html" . }}

{{ .Content }}

<footer class=" footline" >
{{with .Params.LastModifierDisplayName}}
<i class='fa fa-user'></i> <a href="mailto:{{ $.Params.LastModifierEmail }}">{{ . }}</a> {{with $.Date}} <i class='fa fa-calendar'></i> {{ .Format "02/01/2006" }}{{end}}
</div>
{{end}}
</footer>


{{ partial "footer.html" . }}
80 changes: 29 additions & 51 deletions layouts/index.html
Original file line number Diff line number Diff line change
@@ -1,52 +1,30 @@
<!DOCTYPE html>
<html lang="en" class="js csstransforms3d">
<head>
<meta charset="utf-8">
{{ partial "meta.html" . }}
{{ partial "favicon.html" . }}
{{ .Scratch.Add "title" "" }}{{ if isset .Site.Data.titles .Title }}{{ .Scratch.Set "title" (index .Site.Data.titles .Title).title }}{{ else }}{{ .Scratch.Set "title" .Title}}{{end}}
<title>{{ .Scratch.Get "title" }}</title>
{{ partial "style.html" . }}
<link href="{{ .Site.BaseURL }}/css/nucleus.css" rel="stylesheet">
<link href="{{ .Site.BaseURL }}/css/font-awesome.min.css" rel="stylesheet">
<link href="{{ .Site.BaseURL }}/css/hybrid.css" rel="stylesheet">
<link href="{{ .Site.BaseURL }}/css/featherlight.min.css" rel="stylesheet">
<link href="{{ .Site.BaseURL }}/css/perfect-scrollbar.min.css" rel="stylesheet">
<link href="{{ .Site.BaseURL }}/css/theme.css" rel="stylesheet">
<link href="{{ .Site.BaseURL }}/css/hugo-theme.css" rel="stylesheet">
<style type="text/css">
:root #header + #content > #left > #rlblock_left {
display:none !important;
}
{{ partial "header.html" . }}
<span id="sidebar-toggle-span">
<a href="#" id="sidebar-toggle" data-sidebar-toggle=""><i class="fa fa-bars"></i> navigation</a>
</span>

p,li,ul {
text-align: center
}

ul
{
list-style-type: none;
}
</style>
</head>
<body>
<body class="" data-url="/">

<section id="body" style="margin-left:0px;">
<div id="overlay"></div>

<div class="padding highlightable">
<h1>Customize your own home page</h1>
<p>
The site is working, change the URL in your browser to get to any custom page. But, don't forget to <a href="https://gohugo.io/themes/customizing/">overwrite this index.html</a> with your own. You typically have 3 choices :
</p>
<ul>
<li><b>1. </b> Create an overview page for your project</li>
<li><b>2. </b> Create an empty html page with this code in the head tag to redirect to one of your documentation page : <code>&lt;meta http-equiv="refresh" content="0; url=http://example.com/"/&gt;</code> </li>
<li><b>3. </b> Configure your server to automatically redirect home page to one your documentation page</li>
</ul>
<p><i class="fa fa-heart fa-4x"></i></p>
</div>
</section>
</body>
</html>
{{if .Site.Home.Content }}
{{.Site.Home.Content}}
{{else}}
{{if eq .Site.Language.Lang "fr"}}
<h1>Personaliser la page d'accueil</h1>
<p>
Le site fonctionne. Ne pas oublier de personaliser cette page avec votre propre contenu. 2 façons de faire :
</p>
<ul>
<li><b>1. </b> Créer un fichier _index.md dans le dossier content</li>
<li><b>2. </b> Configurer le serveur http pour rediriger automatiquement la homepage vers la page de votre choix dans le site</li>
</ul>
{{else}}
<h1>Customize your own home page</h1>
<p>
The site is working. Don't forget to customize this homepage with your own. You typically have 2 choices :
</p>
<ul>
<li><b>1. </b> Create a _index.md document in content folder</li>
<li><b>2. </b> Configure your server to automatically redirect home page to one your documentation page</li>
</ul>
{{end}}
<p><i class="fa fa-heart fa-4x"></i></p>
{{ end }}
{{ partial "footer.html" . }}
12 changes: 12 additions & 0 deletions layouts/index.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[{{ range $index, $page := .Site.Pages }}
{{- if ne $page.Type "json" -}}
{{- if and $index (gt $index 0) -}},{{- end }}
{
"uri": "{{ $page.Permalink }}",
"title": "{{ htmlEscape $page.Title}}",
"tags": [{{ range $tindex, $tag := $page.Params.tags }}{{ if $tindex }}, {{ end }}"{{ $tag| htmlEscape }}"{{ end }}],
"description": "{{ htmlEscape .Description}}",
"content": {{$page.Plain | jsonify}}
}
{{- end -}}
{{- end -}}]
Loading

0 comments on commit 6b17b66

Please sign in to comment.