Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
44 changes: 44 additions & 0 deletions layouts/partials/edit_metadata.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{{- if ne (.Param "editme") false -}}
{{- $filePath := "" -}}
{{- $sourcePath := "" -}}
{{- with .File -}}
{{- $filePath = .Path -}}
{{- $filename := replace .Filename "\\" "/" -}}
{{- $sourcePath = replaceRE `^.*/(content|imported)/` `$1/` $filename -}}
{{- $sourcePath = replaceRE `^.*/pkg/mod/(github\.com/[^/]+/[^/@]+)(@[^/]+)?/(.*)$` `$1/$3` $sourcePath -}}
{{- if eq $sourcePath $filename -}}
{{- $sourcePath = replaceRE `^.*/([^/]+\.[^/.]+)$` `$1` $filename -}}
{{- end -}}
{{- if eq $sourcePath "" -}}
{{- $sourcePath = $filePath -}}
{{- end -}}
{{- end -}}
{{- $editBase := site.Params.github_editme_path -}}
{{- $editPath := $sourcePath -}}

{{- range $prefix, $base := site.Params.github_editme_paths -}}
{{- if hasPrefix $sourcePath (printf "%s/" $prefix) -}}
{{- $editBase = $base -}}
{{- if ne $prefix "content" -}}
{{- $editPath = strings.TrimPrefix (printf "%s/" $prefix) $sourcePath -}}
{{- end -}}
{{- end -}}
{{- end -}}

{{- with .Params.github_editme_path -}}
{{- $editBase = . -}}
{{- end -}}

{{- if and $editBase $editPath -}}
<aside>
<div class="text-end">
<a target="_blank" rel="noopener" href="{{ printf "%s%s" $editBase $editPath | safeURL }}" class="btn btn-outline-secondary githubEditButton" role="button"><i class="fab fa-github fa-lg"></i> Edit me</a>
</div>
{{- if ne (.Lastmod.Format "2006") "0001" }}
<div class="text-end">
<small>Updated {{ .Lastmod.Format "02 Jan 06" }}</small>
</div>
{{- end }}
</aside>
{{- end -}}
{{- end -}}
25 changes: 25 additions & 0 deletions layouts/partials/funding.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<div class="row gy-3">
{{- range hugo.Data.funding }}
<div class="col-md-6 d-flex flex-column">
<div class="card h-100">
<div class="card-body">
<a href="{{ .url }}" target="_blank" rel="noopener" class="no-icon card-title">
<strong>{{ .title }}</strong>
</a>
<div class="row align-items-center">
<div class="col-sm-4">
<a href="{{ .url }}" target="_blank" rel="noopener" class="no-icon">
<img src="{{ .img | relURL }}" alt="{{ .alt | default "Logo" }}" class="img-fluid">
</a>
</div>
<div class="col-sm-8">
{{- with .description }}<p><small>{{ . }}</small></p>{{ end }}
{{- with .number }}<p>Funding number: {{ . }}</p>{{ end }}
{{- with .period }}<p>Years running: {{ . }}</p>{{ end }}
</div>
</div>
</div>
</div>
</div>
{{- end }}
</div>
3 changes: 3 additions & 0 deletions layouts/partials/inline_image.html
Comment thread
MakisH marked this conversation as resolved.
Outdated
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{{- $file := .file | default "" -}}
{{- $alt := .alt | default "" -}}
<img class="inline" src="{{ printf "/images/%s" $file | relURL }}" alt="{{ $alt }}">
16 changes: 16 additions & 0 deletions layouts/partials/links.html
Comment thread
MakisH marked this conversation as resolved.
Outdated
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{{- range $sidebarName := site.Params.sidebars -}}
{{- with (index hugo.Data.sidebars $sidebarName) -}}
{{- range .entries -}}
{{- range (.folders | default slice) -}}
{{- partial "links_entry.html" . -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- range hugo.Data.topnav.topnav -}}
{{- range .items -}}
{{- if and .url (not .external_url) -}}
[{{ .url | strings.TrimPrefix "/" | strings.TrimSuffix ".html" }}]: {{ .url | strings.TrimPrefix "/" }}
{{- end -}}
{{- end -}}
{{- end -}}
12 changes: 12 additions & 0 deletions layouts/partials/links_entry.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{{- with .url -}}
[{{ . | strings.TrimPrefix "/" | strings.TrimSuffix ".html" }}]: {{ . | strings.TrimPrefix "/" }}
{{ end -}}
{{- range (.folderitems | default slice) -}}
{{ partial "links_entry.html" . }}
{{- end -}}
{{- range (.subfolders | default slice) -}}
{{ partial "links_entry.html" . }}
{{- end -}}
{{- range (.subfolderitems | default slice) -}}
{{ partial "links_entry.html" . }}
{{- end -}}
18 changes: 18 additions & 0 deletions layouts/partials/news_banner.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{{/*
News banner template, disabled by default. To publish a banner, remove this
outer Hugo comment wrapper and edit only the announcement text and link below.
The base layout already calls this partial, and the existing classes should be
kept for consistent styling. To hide the banner from the front page, wrap the
uncommented block with `{{ if not .onlanding }}` and `{{ end }}`; without that
condition, it appears on every page.
Comment thread
MakisH marked this conversation as resolved.
Outdated

<aside role="banner" class="background-light banner-container">
<div class="container">
<div class="row m-0">
<div class="col-lg-12 news-banner">
<p class="m-0">This is a site-wide news banner. Learn more about preCICE on the <a href="{{ "about.html" | relURL }}">About page</a>.</p>
</div>
</div>
</div>
</aside>
*/}}
9 changes: 9 additions & 0 deletions layouts/partials/newsletter.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<script charset="utf-8" type="text/javascript" src="https://js.mailercloud.com/form/form.js"></script>
<script>
(function() {
mcform.create({
formId: "V3dEdUAzMTQ0NkAwMDAwMA==",
targetElement: "form_element_id"
})
})();
</script>
6 changes: 6 additions & 0 deletions layouts/partials/url.html
Comment thread
MakisH marked this conversation as resolved.
Outdated
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{{- $url := . -}}
{{- if hasPrefix $url "http" -}}
{{- $url -}}
{{- else -}}
{{- $url | relURL -}}
{{- end -}}
2 changes: 2 additions & 0 deletions layouts/partials/xmlreference.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{{- $raw := readFile "assets/xmlreference.md" -}}
{{- .RenderString $raw -}}
Loading