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 %} - - - - - - {% endif %} - - -
- {% include topnav.html %} - - {% include news_banner.html onlanding=false %} -
-
- {% unless page.hide_sidebar %} -
-
- {% include sidebar.html %} -
-
- {{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 %} - - - - - - - - - - - - diff --git a/_layouts/none.html b/_layouts/none.html deleted file mode 100644 index 60887a9201d..00000000000 --- a/_layouts/none.html +++ /dev/null @@ -1,3 +0,0 @@ ---- ---- -{{content}} \ No newline at end of file diff --git a/_layouts/page.html b/_layouts/page.html deleted file mode 100644 index 8b4a3236023..00000000000 --- a/_layouts/page.html +++ /dev/null @@ -1,106 +0,0 @@ ---- -layout: default ---- - -
-

{{ page.title }}

-
- -{% if page.simple_map == true %} - - - -{% include custom/{{page.map_name}}.html %} - -{% elsif page.complex_map == true %} - - - -{% include custom/{{page.map_name}}.html %} - -{% endif %} - -
- - {% if page.summary %} -
- - {{ page.summary | markdownify | remove: '

' | remove: '

' }} -
- {% endif %} - -
-
- {% unless page.toc == false %} - - {% endunless %} -
- -
- {% unless page.editme == false %} - - {% endunless %} -
-
- - {{content}} - - {% if page.tags != null %} -
- Tags: - {% assign projectTags = site.data.tags.allowed-tags %} - {% for tag in page.tags %} - {% if projectTags contains tag %} - {{page.tagName}}{{tag}} - {% endif %} - {% endfor %} -
- {% 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 ---- -
-

{{ page.title }}

-
- -
- - {% 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 }} + + + Redirecting… + + + + + + +

Redirecting…

+ Click here if you are not redirected. + +{{- else }} + + {{ partial "head.html" . }} + + +
+ {{ partial "topnav.html" . }} + {{ partial "news_banner.html" (dict "page" . "onlanding" .IsHome) }} +
+ + {{- $isLanding := or .IsHome (eq .Layout "landing_page") -}} + {{- if $isLanding }} +
+ {{ block "main" . }}{{ end }} +
+ {{- else }} + {{- $hideSidebar := eq (.Param "hide_sidebar") true -}} +
+ {{ 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" . }} + + + + + diff --git a/layouts/_default/list.html b/layouts/_default/list.html new file mode 100644 index 00000000000..bb2fa24b893 --- /dev/null +++ b/layouts/_default/list.html @@ -0,0 +1,34 @@ +{{ define "main" }} +
+
+

{{ .Title }}

+
+ + {{ with .Params.summary }} +
{{ . | markdownify }}
+ {{ end }} + +
+
+ {{ partial "toc.html" . }} +
+
+ {{ partial "edit_metadata.html" . }} +
+
+ + {{ partial "compat_content.html" . }} + + {{ $pages := .RegularPages }} + {{ if $pages }} +
+ {{ range $pages.ByTitle }} +
+

{{ .Title }}

+ {{ 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" }} +
+
+

{{ .Title }}

+
+ + {{ with .Params.summary }} +
{{ . | markdownify }}
+ {{ end }} + +
+
+ {{ partial "toc.html" . }} +
+
+ {{ partial "edit_metadata.html" . }} +
+
+ + {{ partial "compat_content.html" . }} + + {{ with .Params.tags }} +
+ Tags: + {{ range . }} + {{ . }} + {{ end }} +
+ {{ 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" . }} + + + + + diff --git a/layouts/_default/single.html b/layouts/_default/single.html new file mode 100644 index 00000000000..05a74ee498c --- /dev/null +++ b/layouts/_default/single.html @@ -0,0 +1,32 @@ +{{ define "main" }} +
+
+

{{ .Title }}

+
+ + {{ with .Params.summary }} +
{{ . | markdownify }}
+ {{ end }} + +
+
+ {{ partial "toc.html" . }} +
+
+ {{ partial "edit_metadata.html" . }} +
+
+ + {{ partial "compat_content.html" . }} + + {{ with .Params.tags }} +
+ Tags: + {{ range . }} + {{ . }} + {{ end }} +
+ {{ 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 -}}