diff --git a/.gitignore b/.gitignore
index d87a59686ac..f97bf8b86c8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,7 +4,13 @@ _site/
.jekyll-cache
_pdf
.DS_Store
-.idea
+.idea/
vendor/
.bundle/
-Gemfile.lock
\ No newline at end of file
+Gemfile.lock
+.hugo_build.lock
+/public/
+/public-pdf/
+/pdf/docs.pdf
+/resources/
+node_modules/
diff --git a/_layouts/default.html b/_layouts/default.html
deleted file mode 100644
index 897b496b2b3..00000000000
--- a/_layouts/default.html
+++ /dev/null
@@ -1,99 +0,0 @@
-
-
-
- {% include head.html %}
-
-
-
- {% if page.datatable == true %}
-
-
- {% unless page.hide_sidebar %}
-
-
-
- {{content}}
-
-
- {% else %}
-
- {{content}}
-
- {% endunless %}
-
- {% include footer.html %}
- {% include scroll_to_top.html %}
-
-{% if site.google_analytics %}
-{% include google_analytics.html %}
-{% endif %}
-
-
-
diff --git a/_layouts/default_print.html b/_layouts/default_print.html
deleted file mode 100644
index a0dce8a5355..00000000000
--- a/_layouts/default_print.html
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
- {% include head_print.html %}
-
-
-
-
-
-
-
-
-
- {% if page.summary %}
-
-
- {{ page.summary | markdownify | remove: '
' | remove: '
' }}
-
- {% endif %}
-
-
-
- {% unless page.toc == false %}
-
- {% endunless %}
-
-
-
- {% unless page.editme == false %}
-
- {% endunless %}
-
-
-
- {{content}}
-
- {% if page.tags != null %}
-
- {% endif %}
-
-{% comment %}
-{% include commento.html %}
-{% endcomment %}
-
-
-{% include breadcrumb.html %}
-
-
-
diff --git a/_layouts/page_print.html b/_layouts/page_print.html
deleted file mode 100644
index 48f68b952cd..00000000000
--- a/_layouts/page_print.html
+++ /dev/null
@@ -1,18 +0,0 @@
----
-layout: default_print
-comments: true
----
-
-
-
-
- {% if page.summary %}
-
-
- {{ page.summary | markdownify | remove: '
' | remove: '
' }}
-
- {% endif %}
- {{ content }}
-
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html
new file mode 100644
index 00000000000..6b6cb096961
--- /dev/null
+++ b/layouts/_default/baseof.html
@@ -0,0 +1,80 @@
+
+
+{{- with .Params.redirect_to }}
+
+
+ {{ if $hideSidebar }}
+
+ {{ block "main" . }}{{ end }}
+
+ {{ else }}
+
+
+
+ {{ block "main" . }}{{ end }}
+
+
+ {{ end }}
+
+ {{- end }}
+
+ {{ partial "footer.html" . }}
+ {{ partial "scroll_to_top.html" . }}
+
+
+
+ {{ if .IsHome }}
+
+
+ {{ end }}
+
+
+{{- end }}
+
diff --git a/layouts/_default/default_print.html b/layouts/_default/default_print.html
new file mode 100644
index 00000000000..99cb5c3df5a
--- /dev/null
+++ b/layouts/_default/default_print.html
@@ -0,0 +1,13 @@
+
+
+
+ {{ partial "head_print.html" . }}
+
+
+
+
+
+ {{ with .Params.summary }}
+ {{ . | markdownify }}
+ {{ end }}
+
+
+
+ {{ partial "toc.html" . }}
+
+
+ {{ partial "edit_metadata.html" . }}
+
+
+
+ {{ partial "compat_content.html" . }}
+
+ {{ $pages := .RegularPages }}
+ {{ if $pages }}
+
+ {{ range $pages.ByTitle }}
+
+
+ {{ with .Params.summary }}{{ . | markdownify }}
{{ end }}
+
+ {{ end }}
+
+ {{ end }}
+
+{{ end }}
diff --git a/layouts/_default/none.html b/layouts/_default/none.html
new file mode 100644
index 00000000000..28c1aa052bd
--- /dev/null
+++ b/layouts/_default/none.html
@@ -0,0 +1 @@
+{{ partial "compat_content.html" . }}
diff --git a/layouts/_default/page.html b/layouts/_default/page.html
new file mode 100644
index 00000000000..05a74ee498c
--- /dev/null
+++ b/layouts/_default/page.html
@@ -0,0 +1,32 @@
+{{ define "main" }}
+
+
+
+ {{ with .Params.summary }}
+ {{ . | markdownify }}
+ {{ end }}
+
+
+
+ {{ partial "toc.html" . }}
+
+
+ {{ partial "edit_metadata.html" . }}
+
+
+
+ {{ partial "compat_content.html" . }}
+
+ {{ with .Params.tags }}
+
+ {{ end }}
+ {{ partial "breadcrumb.html" . }}
+
+{{ end }}
diff --git a/layouts/_default/page_print.html b/layouts/_default/page_print.html
new file mode 100644
index 00000000000..d2c37886714
--- /dev/null
+++ b/layouts/_default/page_print.html
@@ -0,0 +1,21 @@
+
+
+
+ {{ partial "head_print.html" . }}
+
+
+
+
+
+ {{ with .Params.summary }}
+ {{ . | markdownify }}
+ {{ end }}
+
+
+
+ {{ partial "toc.html" . }}
+
+
+ {{ partial "edit_metadata.html" . }}
+
+
+
+ {{ partial "compat_content.html" . }}
+
+ {{ with .Params.tags }}
+
+ {{ end }}
+ {{ partial "breadcrumb.html" . }}
+
+{{ end }}
diff --git a/layouts/partials/compat_content.html b/layouts/partials/compat_content.html
new file mode 100644
index 00000000000..00b2e0454af
--- /dev/null
+++ b/layouts/partials/compat_content.html
@@ -0,0 +1,29 @@
+{{/*
+TODO: Remove this temporary compatibility layer once imported repositories use
+Hugo shortcodes directly instead of legacy Jekyll/Liquid syntax.
+*/}}
+{{- $rendered := .Content -}}
+{{- $raw := .RawContent -}}
+{{- if or (strings.Contains $raw "{%") (strings.Contains $raw "{{ site.") (strings.Contains $raw "{{site.") -}}
+ {{- $content := $raw -}}
+ {{- $blockTags := slice "disclaimer" "experimental" "important" "note" "tip" "version" "warning" -}}
+
+ {{- /* Translate the legacy Jekyll callouts into the existing Hugo shortcodes. */ -}}
+ {{- range $tag := $blockTags -}}
+ {{- $openPattern := printf `{%%[[:space:]]*%s[[:space:]]*%%}` $tag -}}
+ {{- $closePattern := printf `{%%[[:space:]]*end%s[[:space:]]*%%}` $tag -}}
+ {{- $content = replaceRE $openPattern (printf `{{< %s >}}` $tag) $content -}}
+ {{- $content = replaceRE $closePattern (printf `{{< /%s >}}` $tag) $content -}}
+ {{- end -}}
+
+ {{- /* The imported documentation uses only note and warning inline includes. */ -}}
+ {{- $content = replaceRE `{%[[:space:]]*include[[:space:]]+(note|warning)\.html[[:space:]]+content="([^"]*)"[[:space:]]*%}` `{{< ${1} >}}${2}{{< /${1} >}}` $content -}}
+ {{- $content = replaceRE `{{[[:space:]]*site\.([A-Za-z_][A-Za-z0-9_]*)[[:space:]]*}}` `{{< site_param "${1}" >}}` $content -}}
+
+ {{- if eq .RelPermalink "/docs/adapters/fenics/" -}}
+ {{- $content = replaceRE `(?s)## How to cite.*\z` `{{< fenics_publications >}}` $content -}}
+ {{- end -}}
+
+ {{- $rendered = .RenderString (dict "display" "block") $content -}}
+{{- end -}}
+{{- $rendered -}}