Skip to content
Snippets Groups Projects
Unverified Commit 51968412 authored by Lars Bilke's avatar Lars Bilke Committed by GitHub
Browse files

Merge pull request #2620 from bilke/web-benchmarks

[web] Links to latest updated benchmark pages on homepage
parents 19194ec4 e41b4051
No related branches found
No related tags found
No related merge requests found
Showing
with 132 additions and 43 deletions
......@@ -18,14 +18,16 @@ function newsEntry(element, i) {
return string;
}
$.getJSON(announcementsurl, function(data) {
data.topics.slice(0,3).forEach(function (element, i) {
$("#news").append(newsEntry(element, i));
if(location.pathname == "/") {
$.getJSON(announcementsurl, function(data) {
data.topics.slice(0,3).forEach(function (element, i) {
$("#news").append(newsEntry(element, i));
});
});
});
$.getJSON(usabilityurl, function(data) {
data.topics.slice(0,3).forEach(function (element, i) {
$("#discussions").append(newsEntry(element, i));
$.getJSON(usabilityurl, function(data) {
data.topics.slice(0,3).forEach(function (element, i) {
$("#discussions").append(newsEntry(element, i));
});
});
});
}
// When the user scrolls the page, execute myFunction
window.onscroll = function() {myFunction()};
// Get the header
var header = document.getElementById("theHeader");
// Get the offset position of the navbar
var sticky = header.offsetTop;
// Add the sticky class to the header when you reach its scroll position. Remove "sticky" when you leave the scroll position
function myFunction() {
if (window.pageYOffset > sticky) {
header.classList.add("sticky");
} else {
header.classList.remove("sticky");
}
}
import vtkURLExtract from 'vtk.js/Sources/Common/Core/URLExtract';
import vis from './vis';
import vis from '.';
const userParams = vtkURLExtract.extractURLParameters();
......
......@@ -135,6 +135,30 @@ cite::before {
}
}
ol.breadcrumb {
@apply py-2;
}
ol.breadcrumb li {
display: inline;
}
ol.breadcrumb li+li:before {
@apply px-1;
content: "/\00a0";
}
ol.breadcrumb li.active a {
color: theme('mycolors.text-accent');
}
/* The sticky class is added to the header with JS when it reaches its scroll position */
#theHeader.sticky {
position: fixed;
top: 0;
background-color: white;
}
/* -- Table of contents -- */
#TableOfContents {
@apply .text-sm;
......
......@@ -3,25 +3,25 @@ title = "Documentation"
[[sections]]
name = "User Guide"
url = "/docs/userguide"
url = "/docs/userguide/basics/introduction/"
text = "Download, install and run an OGS benchmark in 5 minutes! No development setup required."
icon = "fal fa-users"
[[sections]]
name = "Developer Guide"
url = "/docs/devguide"
url = "/docs/devguide/getting-started/introduction/"
text = "You want to contribute to the OpenGeoSys project or implement a custom feature? In the Developer Guide you will find everything to get you started into OpenGeoSys development. Experienced developers will find a comprehensive list of advanced development topics."
icon = "fal fa-laptop-code"
[[sections]]
name = "Selected Benchmarks"
url = "/docs/benchmarks"
name = "Benchmarks"
url = "/docs/benchmarks/elliptic/elliptic-dirichlet/"
text = "Basic benchmarks are explained and input files are provided to get you started in using OGS."
icon = "fal fa-rabbit-fast"
[[sections]]
name = "Tools & Workflows"
url = "/docs/tools"
url = "/docs/tools/getting-started/overview/"
text = "Helpful tools for pre- and postprocessing as well as complete model setup workflows."
icon = "fal fa-tools"
......
+++
title = "Benchmarks"
+++
......@@ -5,8 +5,6 @@ project = "Elliptic/square_1x1_GroundWaterFlow/square_1e2_volumetricsourceterm.p
author = "Tom Fischer"
weight = 102
aliases = [ "/docs/benchmarks/" ] # First benchmark page
[menu]
[menu.benchmarks]
parent = "elliptic"
......
......@@ -5,8 +5,6 @@ project = "Elliptic/square_1x1_GroundWaterFlow/square_1e2.prj"
author = "Dmitri Naumov"
weight = 102
aliases = [ "/docs/benchmarks/" ] # First benchmark page
[menu]
[menu.benchmarks]
parent = "elliptic"
......
......@@ -5,8 +5,6 @@ project = "Elliptic/square_1x1_GroundWaterFlow_Python/square_1e3_poisson_sin_x_s
author = "Tom Fischer"
weight = 102
aliases = [ "/docs/benchmarks/" ] # First benchmark page
[menu]
[menu.benchmarks]
parent = "elliptic"
......
+++
title = "Developer Guide"
os_selector = true
+++
......@@ -4,8 +4,6 @@ title = "Welcome!"
author = "Lars Bilke"
weight = 1001
aliases = [ "/docs/devguide/" ] # First devguide page
[menu]
[menu.devguide]
parent = "getting-started"
......
+++
title = "Tools"
+++
......@@ -4,8 +4,6 @@ title = "Introduction"
author = "Lars Bilke"
weight = 100
aliases = [ "/docs/tools/" ]
[menu]
[menu.tools]
parent = "getting-started"
......
+++
title = "User Guide"
first = "basics/introduction"
os_selector = true
+++
......@@ -3,14 +3,6 @@
<nav class="w-1/4">
{{ $segments := split .RelPermalink "/" }}
{{ $subsection := index $segments 2 }}
<div class="text-xs">
<a href="/docs/">Docs</a> / <span class="text-orange">
{{ if eq $subsection "devguide"}}Developer Guide{{ end }}
{{ if eq $subsection "benchmarks"}}Benchmarks{{ end }}
{{ if eq $subsection "userguide"}}User Guide{{ end }}
{{ if eq $subsection "tools"}}Tools{{ end }}
</span>
</div>
<ul class="text-sm">
{{ $currentPage := . }}
{{ $currentMenu := index .Site.Menus $subsection }}
......@@ -26,7 +18,8 @@
</nav>
<div class="w-3/4 ml-4">
<h1>{{ .Title }}</h1>
{{ if or (eq $subsection "devguide") (eq $subsection "userguide") }}
{{ if .CurrentSection.Params.os_selector }}
<div class="invisible mb-4" id="os-selector">Select OS:
<a class="btn mx-1" id="btn-win"><i class="fab fa-windows"></i> Windows</a>
<a class="btn mx-1" id="btn-linux"><i class="fab fa-linux"></i> Linux</a>
......
{{ define "main" }}
{{ partial "components/hero" .Params.hero }}
<!-- {{ partial "components/quicklinks" .Params.hero }} -->
{{ partial "components/news" }}
{{ partial "components/news" . }}
{{ range .Params.features }}
{{ partial "components/feature" (dict "page" $ "feature" .) }}
{{ end }}
......
<ol class="breadcrumb">
{{ template "breadcrumbnav" (dict "p1" . "p2" .) }}
</ol>
{{ define "breadcrumbnav" }}
{{ if .p1.Parent }}
{{ template "breadcrumbnav" (dict "p1" .p1.Parent "p2" .p2 ) }}
{{ else if not .p1.IsHome }}
{{ template "breadcrumbnav" (dict "p1" .p1.Site.Home "p2" .p2 ) }}
{{ end }}
<li{{ if eq .p1 .p2 }} class="active"{{ end }}>
<a href="{{ .p1.Permalink }}">
{{ if .p1.IsHome }}
<i class="fas fa-home"></i>
{{ else }}
{{ .p1.Title }}
{{ end }}
</a>
</li>
{{ end }}
<div class="container">
<div class="flex flex-wrap">
<div class="w-full md:w-1/2 px-4 md:px-2">
<h2 class="mt-0">Latest News</h2>
<h2 class="mt-0">News</h2>
<div class="py-0 lg:px-4">
<ul id="news">
</ul>
......@@ -9,11 +9,37 @@
</div>
<div class="w-full md:w-1/2 px-4 md:px-2">
<h2 class="mt-0">Latest Discussions</h2>
<h2 class="mt-0">Discussions</h2>
<div class="py-0 lg:px-4">
<ul id="discussions">
</ul>
</div>
</div>
<div class="w-full px-4 md:px-2">
<h2 class="mt-0">Latest Benchmarks</h2>
<div class="py-0 lg:px-4">
{{ template "latest-pages" .}}
</div>
</div>
</div>
</div>
{{ define "latest-pages" }}
<ul>
{{ range first 8 (where .Site.RegularPages "CurrentSection.RelPermalink" "/docs/benchmarks/").ByLastmod.Reverse }}
<li>
<!-- Two weeks -->
<a href="{{ .Permalink }}">
<span class="fa-layers fa-fw{{if gt (sub now.Unix .Lastmod.Unix) 1209600}} invisible{{end}}">
<i class="fas fa-certificate"></i>
<span class="fa-layers-text fa-inverse" data-fa-transform="shrink-11.5 rotate--30" style="font-weight:900">NEW</span>
</span>
{{ .Title }}
</a>
</li>
{{ end }}
</ul>
{{ end }}
......@@ -6,12 +6,7 @@
<script src="//cdnjs.cloudflare.com/ajax/libs/fancybox/3.3.5/jquery.fancybox.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/slick-carousel@1.8.1/slick/slick.min.js"></script>
{{ if .IsHome }}
{{ $scripts_news := resources.Get "js/discourse-news.js" | minify | fingerprint }}
<script type="text/javascript" src="{{ $scripts_news.Permalink }}" integrity="{{ $scripts_news.Data.Integrity }}" media="screen"></script>
{{ end }}
{{ $scripts := slice (resources.Get "js/header-anchor.js") (resources.Get "js/osselector.js") (resources.Get "js/sitesearch.js") (resources.Get "js/fancybox.js") | resources.Concat "bundle.js" | minify | fingerprint }}
{{ $scripts := resources.Match "js/*.js" | resources.Concat "bundle.js" | minify | fingerprint }}
<script type="text/javascript" src="{{ $scripts.Permalink }}" integrity="{{ $scripts.Data.Integrity }}" media="screen"></script>
</body>
</html>
......@@ -28,7 +28,7 @@
<script async
src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<link rel="stylesheet" href="https://pro.fontawesome.com/releases/v5.6.3/css/all.css" integrity="sha384-LRlmVvLKVApDVGuspQFnRQJjkv0P7/YFrw84YYQtmYG4nK8c+M+NlmYDCv0rKWpG" crossorigin="anonymous">
<script src="https://kit.fontawesome.com/92e08dbd1e.js"></script>
</head>
......@@ -60,5 +60,12 @@
</div>
{{ end }}
</div>
<div class="container {{if .IsHome}} hidden{{end}}">
<div class="w-auto">
<div class="text-xs header w-full" id="theHeader">
{{ partial "breadcrumb" . }}
</div>
</div>
</div>
</header>
<div class="py-2">
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment