Parcourir la source

Merge branch 'baseof-refactor' of https://github.com/rhewett/hugo-academic into rhewett-baseof-refactor

George Cushen il y a 6 ans
Parent
commit
dcd3c05abd

+ 4 - 4
layouts/404.html

@@ -1,5 +1,5 @@
-{{ partial "header.html" . }}
-{{ partial "navbar.html" . }}
+{{- define "main" -}}
+
 <div class="universal-wrapper pt-3">
 
   <h1>{{ i18n "page_not_found" }}</h1>
@@ -27,5 +27,5 @@
   {{ end }}
 
 </div>
-{{ partial "footer_container.html" . }}
-{{ partial "footer.html" . }}
+
+{{- end -}}

+ 24 - 0
layouts/_default/baseof.html

@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<html lang="{{ site.LanguageCode | default "en-us" }}">
+
+{{ partial "site_head.html" . }}
+
+<body id="top" data-spy="scroll" data-target="{{ if or .IsHome (eq .Type "widget_page") }}#navbar-main{{else}}#TableOfContents{{end}}" data-offset="71" {{ if not (.Scratch.Get "light") }}class="dark"{{end}}>
+
+  {{ partial "search" . }}
+
+  {{ partial "navbar.html" . }}
+
+  {{ block "main" . }}{{ end }}
+
+  {{ partial "site_js.html" . }}
+
+  <div class="container">
+    {{ partial "site_footer.html" . }}
+  </div>
+
+  {{ partial "citation.html" . }}
+
+</body>
+
+</html>

+ 3 - 4
layouts/_default/list.html

@@ -1,5 +1,4 @@
-{{ partial "header.html" . }}
-{{ partial "navbar.html" . }}
+{{- define "main" -}}
 
 {{ partial "page_header.html" . }}
 
@@ -26,5 +25,5 @@
 
   {{ partial "pagination" . }}
 </div>
-{{ partial "footer_container.html" . }}
-{{ partial "footer.html" . }}
+
+{{- end -}}

+ 2 - 4
layouts/_default/single.html

@@ -1,5 +1,4 @@
-{{ partial "header.html" . }}
-{{ partial "navbar.html" . }}
+{{- define "main" -}}
 
 <article class="article" itemscope itemtype="http://schema.org/Article">
 
@@ -40,5 +39,4 @@
   </div>
 </article>
 
-{{ partial "footer_container.html" . }}
-{{ partial "footer.html" . }}
+{{- end -}}

+ 2 - 4
layouts/authors/list.html

@@ -1,7 +1,6 @@
 {{/* Author profile page. */}}
 
-{{ partial "header.html" . }}
-{{ partial "navbar.html" . }}
+{{- define "main" -}}
 
 {{/* If an account has not been created for this user, just display their name as the title. */}}
 {{ if not .File }}
@@ -38,5 +37,4 @@
   {{ end }}
 </section>
 
-{{ partial "footer_container.html" . }}
-{{ partial "footer.html" . }}
+{{- end -}}

+ 3 - 4
layouts/authors/terms.html

@@ -1,7 +1,6 @@
 {{/* List of all authors. */}}
 
-{{ partial "header.html" . }}
-{{ partial "navbar.html" . }}
+{{- define "main" -}}
 
 {{ partial "page_header.html" . }}
 
@@ -20,5 +19,5 @@
 
   {{ partial "pagination" . }}
 </div>
-{{ partial "footer_container.html" . }}
-{{ partial "footer.html" . }}
+
+{{- end -}}

+ 19 - 1
layouts/docs/list.html

@@ -1 +1,19 @@
-{{ partial "docs_layout.html" . }}
+<!DOCTYPE html>
+<html lang="{{ site.LanguageCode | default "en-us" }}">
+
+{{ partial "site_head.html" . }}
+
+<body id="top" data-spy="scroll" data-target="{{ if or .IsHome (eq .Type "widget_page") }}#navbar-main{{else}}#TableOfContents{{end}}" data-offset="71" {{ if not (.Scratch.Get "light") }}class="dark"{{end}}>
+
+  {{ partial "search" . }}
+
+  {{ partial "navbar.html" . }}
+
+  {{ partial "docs_layout.html" . }}
+
+  {{ partial "site_js.html" . }}
+
+</body>
+
+</html>
+

+ 19 - 1
layouts/docs/single.html

@@ -1 +1,19 @@
-{{ partial "docs_layout.html" . }}
+<!DOCTYPE html>
+<html lang="{{ site.LanguageCode | default "en-us" }}">
+
+{{ partial "site_head.html" . }}
+
+<body id="top" data-spy="scroll" data-target="{{ if or .IsHome (eq .Type "widget_page") }}#navbar-main{{else}}#TableOfContents{{end}}" data-offset="71" {{ if not (.Scratch.Get "light") }}class="dark"{{end}}>
+
+  {{ partial "search" . }}
+
+  {{ partial "navbar.html" . }}
+
+  {{ partial "docs_layout.html" . }}
+
+  {{ partial "site_js.html" . }}
+
+</body>
+
+</html>
+

+ 5 - 0
layouts/index.html

@@ -1,4 +1,9 @@
+{{- define "main" -}}
+
 {{ if not (isset site.Params "color_theme") }}
   {{ errorf "Please complete the installation of Academic by following the steps at https://sourcethemes.com/academic/docs/install/" }}
 {{ end }}
+
 {{ partial "widget_page.html" . }}
+
+{{- end -}}

+ 1 - 5
layouts/partials/footer_container.html → layouts/partials/citation.html

@@ -1,7 +1,3 @@
-<div class="container">
-  {{ partial "footer_section.html" . }}
-</div>
-
 <!-- Citation modal -->
 <div id="modal" class="modal fade" role="dialog">
   <div class="modal-dialog">
@@ -26,4 +22,4 @@
       </div>
     </div>
   </div>
-</div>
+</div>

+ 4 - 0
layouts/partials/custom_head.html

@@ -0,0 +1,4 @@
+{{/* No changes should be made to this file. */}}
+{{/* Instead, create or modify your sites layout/partials/custom_head.html. */}}
+
+{{/* This partial is included in themes/academic/layout/partials/site_head.html. */}}

+ 4 - 0
layouts/partials/custom_js.html

@@ -0,0 +1,4 @@
+{{/* No changes should be made to this file. */}}
+{{/* Instead, create or modify your sites layout/partials/custom_js.html. */}}
+
+{{/* This partial is included in themes/academic/layout/partials/site_js.html. */}}

+ 1 - 5
layouts/partials/docs_layout.html

@@ -1,5 +1,3 @@
-{{ partial "header.html" . }}
-{{ partial "navbar.html" . }}
 {{ $current_page := . }}
 
 <div class="container-fluid docs">
@@ -46,10 +44,8 @@
 
       </article>
 
-      {{ partial "footer_section.html" . }}
+      {{ partial "site_footer.html" . }}
 
     </main>
   </div>
 </div>
-
-{{ partial "footer.html" . }}

+ 0 - 0
layouts/partials/head_custom.html


+ 1 - 0
layouts/partials/footer_section.html → layouts/partials/site_footer.html

@@ -23,3 +23,4 @@
     {{ end }}
   </p>
 </footer>
+

+ 2 - 5
layouts/partials/header.html → layouts/partials/site_head.html

@@ -1,5 +1,3 @@
-<!DOCTYPE html>
-<html lang="{{ site.LanguageCode | default "en-us" }}">
 <head>
 
   <meta charset="utf-8">
@@ -183,10 +181,9 @@
   {{ end }}
 
   {{ partial "cookie_consent" . }}
-  {{ partial "head_custom" . }}
+
+  {{ partial "custom_head" . }}
 
   <title>{{ if not .IsHome }}{{ .Title }} | {{ end }}{{ site.Title }}</title>
 
 </head>
-<body id="top" data-spy="scroll" data-target="{{ if or .IsHome (eq .Type "widget_page") }}#navbar-main{{else}}#TableOfContents{{end}}" data-offset="71" {{ if not ($scr.Get "light") }}class="dark"{{end}}>
-  {{ partial "search" . }}

+ 1 - 2
layouts/partials/footer.html → layouts/partials/site_js.html

@@ -150,5 +150,4 @@
     {{ $js_bundle := slice $js_bundle_head $js_bundle | resources.Concat "js/academic.min.js" | fingerprint "md5" }}
     <script src="{{ $js_bundle.RelPermalink }}"></script>
 
-  </body>
-</html>
+    {{ partial "custom_js" . }}

+ 0 - 6
layouts/partials/widget_page.html

@@ -1,6 +1,3 @@
-{{ partial "header.html" . }}
-{{ partial "navbar.html" . }}
-
 {{/* Notify JS that this is a widget page */}}
 <span class="js-widget-page d-none"></span>
 
@@ -75,6 +72,3 @@
     {{if $use_container}}</div>{{end}}
   </section>
 {{ end }}
-
-{{ partial "footer_container.html" . }}
-{{ partial "footer.html" . }}

+ 2 - 4
layouts/project/single.html

@@ -1,5 +1,4 @@
-{{ partial "header.html" . }}
-{{ partial "navbar.html" . }}
+{{- define "main" -}}
 
 <article class="article article-project" itemscope itemtype="http://schema.org/Article">
 
@@ -73,5 +72,4 @@
 </div>
 {{ end }}
 
-{{ partial "footer_container.html" . }}
-{{ partial "footer.html" . }}
+{{- end -}}

+ 3 - 4
layouts/publication/single.html

@@ -1,5 +1,5 @@
-{{ partial "header.html" . }}
-{{ partial "navbar.html" . }}
+{{- define "main" -}}
+
 <div class="pub" itemscope itemtype="http://schema.org/CreativeWork">
 
   {{ partial "page_header.html" . }}
@@ -62,5 +62,4 @@
 </div>
 {{ end }}
 
-{{ partial "footer_container.html" . }}
-{{ partial "footer.html" . }}
+{{- end -}}

+ 2 - 4
layouts/section/docs.html

@@ -1,5 +1,4 @@
-{{ partial "header.html" . }}
-{{ partial "navbar.html" . }}
+{{- define "main" -}}
 
 {{ partial "page_header.html" . }}
 
@@ -16,5 +15,4 @@
   </ul>
 </div>
 
-{{ partial "footer_container.html" . }}
-{{ partial "footer.html" . }}
+{{- end -}}

+ 3 - 4
layouts/section/post.html

@@ -1,5 +1,4 @@
-{{ partial "header.html" . }}
-{{ partial "navbar.html" . }}
+{{- define "main" -}}
 
 {{ partial "page_header.html" . }}
 
@@ -23,5 +22,5 @@
   {{ partial "pagination" . }}
 
 </div>
-{{ partial "footer_container.html" . }}
-{{ partial "footer.html" . }}
+
+{{- end -}}

+ 3 - 4
layouts/section/publication.html

@@ -1,5 +1,4 @@
-{{ partial "header.html" . }}
-{{ partial "navbar.html" . }}
+{{- define "main" -}}
 
 {{ partial "page_header.html" . }}
 
@@ -75,5 +74,5 @@
     </div>
   </div>
 </div>
-{{ partial "footer_container.html" . }}
-{{ partial "footer.html" . }}
+
+{{- end -}}

+ 3 - 4
layouts/section/talk.html

@@ -1,5 +1,4 @@
-{{ partial "header.html" . }}
-{{ partial "navbar.html" . }}
+{{- define "main" -}}
 
 {{ partial "page_header.html" . }}
 
@@ -36,5 +35,5 @@
   </div>
 
 </div>
-{{ partial "footer_container.html" . }}
-{{ partial "footer.html" . }}
+
+{{- end -}}

+ 3 - 4
layouts/talk/single.html

@@ -1,5 +1,5 @@
-{{ partial "header.html" . }}
-{{ partial "navbar.html" . }}
+{{- define "main" -}}
+
 <div class="pub" itemscope itemtype="http://schema.org/Event">
 
   {{ partial "page_header.html" . }}
@@ -84,5 +84,4 @@
 </div>
 {{ end }}
 
-{{ partial "footer_container.html" . }}
-{{ partial "footer.html" . }}
+{{- end -}}

+ 4 - 0
layouts/widget_page/single.html

@@ -1 +1,5 @@
+{{- define "main" -}}
+
 {{ partial "widget_page.html" . }}
+
+{{- end -}}