Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@ _site/
.jekyll-cache
_pdf
.DS_Store
.idea
.idea/
vendor/
.bundle/
Gemfile.lock
Gemfile.lock
.hugo_build.lock
/public/
/public-pdf/
/pdf/docs.pdf
/resources/
node_modules/
81 changes: 81 additions & 0 deletions layouts/_default/baseof.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
<!DOCTYPE html>
<html lang="en">
{{- with .Params.redirect_to }}
<head>
<meta charset="utf-8">
<title>Redirecting&hellip;</title>
<link rel="canonical" href="{{ . | safeURL }}">
<script>location="{{ . | safeJS }}"</script>
<meta http-equiv="refresh" content="0; url={{ . | safeURL }}">
<meta name="robots" content="noindex">
</head>
<body>
<h1>Redirecting&hellip;</h1>
<a href="{{ . | safeURL }}">Click here if you are not redirected.</a>
</body>
{{- else }}
<head>
{{ partial "head.html" . }}
</head>
<body{{ if .IsHome }} class="landing-page"{{ end }}>
<header>
{{ partial "topnav.html" . }}
{{ partial "news_banner.html" (dict "page" . "onlanding" .IsHome) }}
</header>

{{- $isLanding := or .IsHome (eq .Layout "landing_page") -}}
{{- if $isLanding }}
<main>
{{ block "main" . }}{{ end }}
</main>
{{- else }}
{{- $hideSidebar := eq (.Param "hide_sidebar") true -}}
<div class="container page-content mb-5">
{{ if $hideSidebar }}
<main id="tg-sb-content">
{{ block "main" . }}{{ end }}
</main>
{{ else }}
<div class="row">
<aside class="col-md-3 mb-4 mb-md-0" id="tg-sb-sidebar">
{{ block "sidebar" . }}{{ partial "sidebar.html" . }}{{ end }}
</aside>
<main class="col-md-9" id="tg-sb-content">
{{ block "main" . }}{{ end }}
</main>
</div>
{{ end }}
</div>
{{- end }}

{{ partial "footer.html" . }}
{{ partial "scroll_to_top.html" . }}
{{ partial "google_analytics.html" . }}
Comment thread
MakisH marked this conversation as resolved.
Outdated

<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/js/bootstrap.bundle.min.js" integrity="sha384-FKyoEForCGlyvwx9Hj09JcYn3nv7wiPVlz7YYwJrWVcXK/BmnVDxM+D2scQbITxI" crossorigin="anonymous"></script>
<script src="{{ "js/customscripts.js" | relURL }}"></script>
{{ if .IsHome }}
<script src="{{ "js/github-queries.js" | relURL }}"></script>
<script src="{{ "js/news-collect.js" | relURL }}"></script>
{{ end }}
<script>
document.addEventListener("DOMContentLoaded", function () {
document.querySelectorAll("table").forEach(function (table) {
table.classList.add("table", "table-striped", "table-hover", "table-bordered", "w-100");
var tableHead = table.querySelector("thead");
if (tableHead) {
tableHead.classList.add("table-primary");
}
if (table.parentElement && table.parentElement.classList.contains("table-responsive")) {
return;
}
var wrapper = document.createElement("div");
wrapper.className = "table-responsive w-100";
table.parentNode.insertBefore(wrapper, table);
wrapper.appendChild(table);
});
});
</script>
</body>
{{- end }}
</html>
13 changes: 13 additions & 0 deletions layouts/_default/default_print.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
{{ partial "head_print.html" . }}
</head>
<body class="{{ with .Params.type }}{{ . }} {{ end }}print">
<div class="container print-container">
<main class="print-content">
{{ .Content }}
</main>
</div>
</body>
</html>
34 changes: 34 additions & 0 deletions layouts/_default/list.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{{ define "main" }}
<section class="post-content">
<header class="post-header">
<h1 class="post-title-main">{{ .Title }}</h1>
</header>

{{ with .Params.summary }}
<div class="summary">{{ . | markdownify }}</div>
{{ end }}

<div class="row">
<div class="col-md-9">
{{ partial "toc.html" . }}
</div>
<div class="col-md-3">
{{ partial "edit_metadata.html" . }}
</div>
</div>

{{ partial "compat_content.html" . }}

{{ $pages := .RegularPages }}
{{ if $pages }}
<div class="list-pages mt-4">
{{ range $pages.ByTitle }}
<article class="mb-3">
<h2 class="h4"><a href="{{ .RelPermalink }}">{{ .Title }}</a></h2>
{{ with .Params.summary }}<p>{{ . | markdownify }}</p>{{ end }}
</article>
{{ end }}
</div>
{{ end }}
</section>
{{ end }}
1 change: 1 addition & 0 deletions layouts/_default/none.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{ partial "compat_content.html" . }}
32 changes: 32 additions & 0 deletions layouts/_default/page.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{{ define "main" }}
<article class="post-content">
<header class="post-header">
<h1 class="post-title-main">{{ .Title }}</h1>
</header>

{{ with .Params.summary }}
<div class="summary">{{ . | markdownify }}</div>
{{ end }}

<div class="row">
<div class="col-md-9">
{{ partial "toc.html" . }}
</div>
<div class="col-md-3">
{{ partial "edit_metadata.html" . }}
</div>
</div>

{{ partial "compat_content.html" . }}

{{ with .Params.tags }}
<div class="tags mt-4">
<b>Tags: </b>
{{ range . }}
<a href="{{ printf "tag_%s.html" . | relURL }}" class="btn btn-outline-secondary cursorNorm" role="button">{{ . }}</a>
{{ end }}
</div>
{{ end }}
{{ partial "breadcrumb.html" . }}
</article>
{{ end }}
21 changes: 21 additions & 0 deletions layouts/_default/page_print.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!DOCTYPE html>
<html lang="en">
<head>
{{ partial "head_print.html" . }}
</head>
<body class="{{ with .Params.type }}{{ . }} {{ end }}print">
<div class="container print-container">
<main class="print-content">
<div class="post-header">
<h1 class="post-title-main" id="{{ .RelPermalink | replaceRE "[^A-Za-z0-9_-]" "" }}">{{ .Title }}</h1>
</div>
<div class="post-content">
{{ with .Params.summary }}
<div class="summary">{{ . | markdownify }}</div>
{{ end }}
{{ .Content }}
</div>
</main>
</div>
</body>
</html>
32 changes: 32 additions & 0 deletions layouts/_default/single.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{{ define "main" }}
<article class="post-content">
<header class="post-header">
<h1 class="post-title-main">{{ .Title }}</h1>
</header>

{{ with .Params.summary }}
<div class="summary">{{ . | markdownify }}</div>
{{ end }}

<div class="row">
<div class="col-md-9">
{{ partial "toc.html" . }}
</div>
<div class="col-md-3">
{{ partial "edit_metadata.html" . }}
</div>
</div>

{{ partial "compat_content.html" . }}

{{ with .Params.tags }}
<div class="tags mt-4">
<b>Tags: </b>
{{ range . }}
<a href="{{ printf "tag_%s.html" . | relURL }}" class="btn btn-outline-secondary cursorNorm" role="button">{{ . }}</a>
{{ end }}
</div>
{{ end }}
{{ partial "breadcrumb.html" . }}
</article>
{{ end }}
25 changes: 25 additions & 0 deletions layouts/partials/compat_content.html
Comment thread
MakisH marked this conversation as resolved.
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{{- $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. */ -}}
Comment thread
MakisH marked this conversation as resolved.
{{- $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 -}}
Loading