Skip to content

Commit

Permalink
Merge pull request #80 from ripienaar/79
Browse files Browse the repository at this point in the history
(#79) Do not expose the lag metric as it is unreliable
  • Loading branch information
ripienaar committed Feb 16, 2023
2 parents 38587c7 + 9d58830 commit f6abd21
Show file tree
Hide file tree
Showing 104 changed files with 1,146 additions and 1,607 deletions.
1 change: 0 additions & 1 deletion docs/content/monitoring/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ We have extensive Prometheus Metrics about the operation of the system allowing
| `choria_stream_replicator_replicator_total_bytess` | The size of messages processed including ones that would be ignored |
| `choria_stream_replicator_replicator_handler_error_count` | The number of times the handler failed to process a message |
| `choria_stream_replicator_replicator_processing_time_seconds` | How long it took to process messages |
| `choria_stream_replicator_replicator_stream_lag_messages` | How many messages from the end of the stream the current processing point is |
| `choria_stream_replicator_replicator_stream_sequence` | The stream sequence of the last message received from the consumer |
| `choria_stream_replicator_replicator_too_old_messages` | How many messages were discarded for being too old |
| `choria_stream_replicator_replicator_copied_messages` | How many messages were copied |
Expand Down
1 change: 1 addition & 0 deletions docs/themes/hugo-theme-relearn/.grenrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ module.exports = {
],
ignoreTagsWith: [
"Relearn",
"x",
],
milestoneMatch: "{{tag_name}}",
onlyMilestones: true,
Expand Down
20 changes: 12 additions & 8 deletions docs/themes/hugo-theme-relearn/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

A theme for [Hugo](https://gohugo.io/) designed for documentation.

![Overview](https://github.com/McShelby/hugo-theme-relearn/raw/main/images/screenshot.png)
![Overview](https://github.com/McShelby/hugo-theme-relearn/raw/main/images/hero.png)

## Motivation

The theme is a fork of the great [Learn theme](https://github.com/matcornic/hugo-theme-learn) with the aim of fixing long outstanding bugs and adepting to latest Hugo features. As far as possible this theme tries to be a drop-in replacement for the Learn theme.

## Main features
## Features

- Usable offline, no external dependencies
- Usable without a HTTP server from the file system
Expand All @@ -20,26 +20,28 @@ The theme is a fork of the great [Learn theme](https://github.com/matcornic/hugo
- Dedicated search page
- Support for GFM (GitHub Flavored Markdown)
- Print whole chapters or even the complete site
- Multilingual mode for English, Arabic, Simplified Chinese, Traditional Chinese, Dutch, Finnish (Suomi), French, German, Hindi, Indonesian, Italian, Japanese, Korean, Polish, Portuguese, Russian, Spanish, Turkish, Vietnamese
- Multilingual mode for English, Arabic, Simplified Chinese, Traditional Chinese, Czech, Dutch, Finnish, French, German, Hindi, Indonesian, Italian, Japanese, Korean, Polish, Portuguese, Russian, Spanish, Turkish, Vietnamese
- Support for languages written right to left
- Unrestricted menu configuration relating to amount of items and level of nesting
- Font Awesome icons
- Tagging support
- Image resizing, shadow
- Image styling like sizing, shadow, border and alignment
- Syntax highlighting
- Customizable look and feel
- Predefined (light, dark) and customizable color variants
- Automatic switch for light/dark mode dependend on your OS settings
- Attachments files
- List child pages
- Math and chemical formulae using the MathJax library
- Mermaid diagrams for flowcharts, sequences, gantts, pie, etc.
- Swagger UI for OpenAPI Specifications
- Customizable look and feel
- Predefined (light, dark) and customizable color variants
- Badges
- Buttons
- Tip/Note/Info/Warning boxes
- Expand
- Tabs
- File inclusion

## Installation

Visit the [installation instructions](https://mcshelby.github.io/hugo-theme-relearn/basics/installation) to learn how to setup the theme in your Hugo installation.
Expand All @@ -50,11 +52,11 @@ Visit the [documentation](https://mcshelby.github.io/hugo-theme-relearn/) to lea

## Changelog

See the [changelog](https://mcshelby.github.io/hugo-theme-relearn/basics/history) for a complete list of releases.
See the [What's New](https://mcshelby.github.io/hugo-theme-relearn/basics/migration) page for release highlights or the [history](https://mcshelby.github.io/hugo-theme-relearn/basics/history) for a complete list of changes per release.

## Contribution

You are most welcome to contribute to the source code but please visit the [contribution guidelines](https://github.com/McShelby/hugo-theme-relearn/blob/main/.github/contributing.md) first.
You are most welcome to contribute bugfixes or even new features to the source code. Please visit the [contribution guidelines](https://mcshelby.github.io/hugo-theme-relearn/dev/contributing) first.

## License

Expand All @@ -67,3 +69,5 @@ Special thanks to [everyone who has contributed](https://github.com/McShelby/hug
Many thanks to [Mathieu Cornic](https://github.com/matcornic) for his work on porting the [Learn theme](https://github.com/matcornic/hugo-theme-learn) to Hugo.

Many thanks to [Andy Miller](https://github.com/rhukster) for initially creating the [Learn theme](https://github.com/getgrav/grav-theme-learn2) for Grav.

See the [credits](https://mcshelby.github.io/hugo-theme-relearn/more/credits) for a detailed list.
42 changes: 42 additions & 0 deletions docs/themes/hugo-theme-relearn/assets/css/theme-auto.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{{- $themevariants := slice | append (.Site.Params.themeVariant | default "auto") -}}
{{- $themevariantsauto := slice | append (.Site.Params.themeVariantAuto | default slice) -}}
{{- $i := 0 -}}
{{- if eq (int (len $themevariantsauto)) 0 -}}
{{- range $themevariants -}}
{{- $i = add $i 1 -}}
{{- if ne . "auto" -}}
{{- $themevariantsauto = $themevariantsauto | append . -}}
{{- break -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- if eq (int (len $themevariantsauto)) 0 -}}
{{- $themevariantsauto = $themevariantsauto | append "relearn-light" -}}
{{- end -}}
{{- if eq (int (len $themevariantsauto)) 1 -}}
{{- $poppedthemevariants := last (sub (len $themevariants) $i) $themevariants -}}
{{- range $poppedthemevariants -}}
{{- if ne . "auto" -}}
{{- $themevariantsauto = $themevariantsauto | append . -}}
{{- break -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- if eq (int (len $themevariantsauto)) 1 -}}
{{- $themevariantsauto = $themevariantsauto | append "relearn-dark" -}}
{{- end -}}
{{- $themevariantsauto = ($themevariantsauto | first 2) -}}
{{- with index $themevariantsauto 0 -}}
{{- if site.IsServer -}}
@import "{{(printf "css/theme-%s.css" .) | relURL}}" screen;
{{- else -}}
@import "{{(printf "theme-%s.css" .)}}" screen;
{{- end -}}
{{- end -}}
{{- with index $themevariantsauto 1 -}}
{{- if site.IsServer }}
@import "{{(printf "css/theme-%s.css" .) | relURL}}" screen and (prefers-color-scheme: dark);
{{- else }}
@import "{{(printf "theme-%s.css" .)}}" screen and (prefers-color-scheme: dark);
{{- end -}}
{{- end -}}
95 changes: 95 additions & 0 deletions docs/themes/hugo-theme-relearn/i18n/cs.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
[Reading-direction]
other = "ltr"

[Search]
other = "Hledat"

[Search-placeholder]
other = "Hledat..."

[No-results-found]
other = "Žádné výsledky pro \"{0}\""

[N-results-found]
other = "{1} výsledků pro \"{0}\""

[Clear-History]
other = "Vymazat historii"

[Attachments-label]
other = "Přílohy"

[title-404]
other = "Error 404"

[message-404]
other = "Ups. Zdá se, že tato stránka neexistuje ¯\\_(ツ)_/¯."

[Go-to-homepage]
other = "Přejít na domovskou stránku"

[Edit-this-page]
other = "Upravit"

[Print-this-chapter]
other = "Vytisknout kapitolu"

[Shortcuts-Title]
other = "Více"

[Expand-title]
other = "Rozbalit..."

[Navigation-toggle]
other = "Menu"

[Toc-toggle]
other = "Obsah"

[Byte-symbol]
other = "B"

[Kilobyte-symbol]
other = "KB"

[Megabyte-symbol]
other = "MB"

[note]
other = "Poznámka"

[info]
other = "Info"

[tip]
other = "Tip"

[warning]
other = "Varování"

[Copy-to-clipboard]
other = "Kopírovat"

[Copied-to-clipboard]
other = "Zkopírováno!"

[Copy-link-to-clipboard]
other = "Kopírovat odkaz"

[Link-copied-to-clipboard]
other = "Odkaz zkopírován!"

[Chapter]
other = "Kapitola {{.}}"

[Language]
other = "Jazyk"

[Theme]
other = "Motiv"

[Submenu]
other = "Podmenu {{.}}"

[Subsections]
other = "Podsekce {{.}}"
Binary file added docs/themes/hugo-theme-relearn/images/hero.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/themes/hugo-theme-relearn/images/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/themes/hugo-theme-relearn/images/tn.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/themes/hugo-theme-relearn/layouts/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<main id="body-inner" class="chapter" tabindex="-1">
<div class="flex-block-wrapper">
<article class="default">
<h1 id="{{ T "title-404" | urlize }}">{{ T "title-404" }}</h1>
<h1 id="{{ T "title-404" | anchorize }}">{{ T "title-404" }}</h1>
<p></p>
<p>{{ T "message-404" }}</p>
<p></p>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{{- partial "shortcodes/link.html" (dict
"context" .Page
"url" .Destination
"title" .Title
"content" .Text
) }}
5 changes: 0 additions & 5 deletions docs/themes/hugo-theme-relearn/layouts/_default/rss.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
{{- partialCached "page-meta.hugo" . .RelPermalink }}
{{- $pages := .Page.Pages }}
{{- if .Page.IsHome }}
{{- $pages = .Page.Sections }}
{{- else if .Page.Sections}}
{{- $pages = (.Page.Pages | union .Page.Sections) }}
{{- end }}
{{- $limit := .Site.Config.Services.RSS.Limit -}}
{{- if ge $limit 0 -}}
{{- $pages = $pages | first $limit -}}
Expand Down
32 changes: 18 additions & 14 deletions docs/themes/hugo-theme-relearn/layouts/_default/sitemap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,24 @@
{{- range .Data.Pages }}
{{- if and .Title (or (ne (.Scratch.Get "relearnIsHiddenStem") true) (ne .Site.Params.disableSeoHiddenPages true) ) }}
<url>
<loc>{{ partial "relLangPrettyUglyURL.hugo" (dict "to" . "abs" true) }}</loc>{{ if not .Lastmod.IsZero }}
<lastmod>{{ safeHTML ( .Lastmod.Format "2006-01-02T15:04:05-07:00" ) }}</lastmod>{{ end }}{{ with .Sitemap.ChangeFreq }}
<changefreq>{{ . }}</changefreq>{{ end }}{{ if ge .Sitemap.Priority 0.0 }}
<priority>{{ .Sitemap.Priority }}</priority>{{ end }}{{ if .IsTranslated }}{{ range .Translations }}
<xhtml:link
rel="alternate"
hreflang="{{ .Lang }}"
href="{{ partial "relLangPrettyUglyURL.hugo" (dict "to" . "abs" true) }}"
/>{{ end }}
<xhtml:link
rel="alternate"
hreflang="{{ .Lang }}"
href="{{ partial "relLangPrettyUglyURL.hugo" (dict "to" . "abs" true) }}"
/>{{ end }}
<loc>{{ partial "relLangPrettyUglyURL.hugo" (dict "to" . "abs" true) }}</loc>
{{- if not .Lastmod.IsZero }}
<lastmod>{{ safeHTML ( .Lastmod.Format "2006-01-02T15:04:05-07:00" ) }}</lastmod>
{{- end }}
{{- with .Sitemap.ChangeFreq }}
<changefreq>{{ . }}</changefreq>
{{- end }}
{{- if ge .Sitemap.Priority 0.0 }}
<priority>{{ .Sitemap.Priority }}</priority>
{{- end }}
{{- if .IsTranslated }}
{{- range $index, $trans := .AllTranslations }}
{{- if eq $index 0 }}
<xhtml:link rel="alternate" hreflang="x-default" href="{{ partial "relLangPrettyUglyURL.hugo" (dict "to" . "abs" true) }}" />
{{- end }}
<xhtml:link rel="alternate" hreflang="{{ .Language.Lang }}" href="{{ partial "relLangPrettyUglyURL.hugo" (dict "to" . "abs" true) }}" />
{{- end }}
{{- end }}
</url>
{{- end -}}
{{- end }}
Expand Down
14 changes: 13 additions & 1 deletion docs/themes/hugo-theme-relearn/layouts/alias.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,19 @@
<html>
<head>
{{- $url := replace (replace .Permalink site.BaseURL "/") "//" "/" }}
{{- $url = partial "relLangPrettyUglyURL.hugo" (dict "link" $url) }}
{{- with site.Home.GetPage $url }}
{{- $c := "" }}{{/* if defaultContentLanguageInSubdir=false we are ending here for home page of the default language */}}
{{- $url = partial "relLangPrettyUglyURL.hugo" (dict "to" .) }}
{{- else }}
{{- $url_alt := replaceRE "^/[^/]*(/.*)" "${1}" $url }}
{{- with site.Home.GetPage $url_alt }}
{{- $c := "" }}{{/* if defaultContentLanguageInSubdir=true we are ending here for home page */}}
{{- $url = partial "relLangPrettyUglyURL.hugo" (dict "to" .) }}
{{- else }}
{{- $c := "" }}{{/* for regular aliases we are ending here with no original page found */}}
{{- $url = partial "relLangPrettyUglyURL.hugo" (dict "link" $url) }}
{{- end }}
{{- end }}
<meta charset="utf-8">
<meta name="robots" content="noindex">
<meta http-equiv="refresh" content="0; url={{ $url }}">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
{{- $title = printf "%s %s " (.Data.Singular | humanize) (default "::" .Site.Params.titleSeparator) }}
{{- end }}
{{- $title = printf "%s%s" $title .Title }}
<h1 id="{{ $title | urlize }}">{{ $title }}</h1>
<h1 id="{{ $title | anchorize }}">{{ $title }}</h1>
<ul>
{{- range .Data.Terms.Alphabetical }}
{{- $len := 0 }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{{- with $page }}
<article class="chapter">
{{ partial "heading-pre.html" . }}<div class="article-subheading">{{ T "Chapter" .Params.Weight }}</div>
<h1 id="{{ .Title | urlize }}">{{ .Title }}</h1>{{ partial "heading-post.html" . }}
<h1 id="{{ .Title | anchorize }}">{{ .Title }}</h1>{{ partial "heading-post.html" . }}

{{ $content | safeHTML }}
<footer class="footline">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{{- $content := .content }}
{{- with $page }}
<article class="default">
{{ partial "heading-pre.html" . }}<h1 id="{{ .Title | urlize }}">{{ .Title }}</h1>{{ partial "heading-post.html" . }}
{{ partial "heading-pre.html" . }}<h1 id="{{ .Title | anchorize }}">{{ .Title }}</h1>{{ partial "heading-post.html" . }}

{{ $content | safeHTML }}
<footer class="footline">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{{- $content := .content }}
{{- with $page }}
<article class="home">
{{ partial "heading-pre.html" . }}<h1 id="{{ .Title | urlize }}">{{ .Title }}</h1>{{ partial "heading-post.html" . }}
{{ partial "heading-pre.html" . }}<h1 id="{{ .Title | anchorize }}">{{ .Title }}</h1>{{ partial "heading-post.html" . }}

{{ $content | safeHTML }}
<footer class="footline">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{- $title := T "Search" }}
<article class="default">
<h1 id="{{ $title | urlize }}">{{ $title }}</h1>
<h1 id="{{ $title | anchorize }}">{{ $title }}</h1>

<form action="javascript:triggerSearch()">
<div class="searchform">
Expand Down
11 changes: 9 additions & 2 deletions docs/themes/hugo-theme-relearn/layouts/partials/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
{{- partial "output-partial.hugo" (dict "base" "menu" "page" . "parameter" . "outputFormat" $outputFormat) }}
<script src="{{"js/clipboard.min.js" | relURL}}{{ if not .Site.Params.disableAssetsBusting }}?{{ now.Unix }}{{ end }}" defer></script>
<script src="{{"js/perfect-scrollbar.min.js" | relURL}}{{ if not .Site.Params.disableAssetsBusting }}?{{ now.Unix }}{{ end }}" defer></script>
<script src="{{"js/featherlight.min.js" | relURL}}{{ if not .Site.Params.disableAssetsBusting }}?{{ now.Unix }}{{ end }}" defer></script>
{{- $wantsMathJax := or (.Page.Store.Get "hasMathJax") (and (.Page.Store.Get (printf "%sIsNested" $outputFormat)) (.Page.Store.Get "nestedHasMathJax")) }}
{{- if $wantsMathJax }}
{{- if isset .Params "mathjaxinitialize" }}
Expand Down Expand Up @@ -54,7 +53,15 @@
{{- end }}
{{- $wantsMermaid := or (.Page.Store.Get "hasMermaid") (and (.Page.Store.Get (printf "%sIsNested" $outputFormat)) (.Page.Store.Get "nestedHasMermaid")) }}
{{- if $wantsMermaid }}
<script src="{{"js/jquery.svg.pan.zoom.js" | relURL}}{{ if not .Site.Params.disableAssetsBusting }}?{{ now.Unix }}{{ end }}" defer></script>
<script src="{{"js/d3/d3-color.min.js" | relURL}}{{ if not .Site.Params.disableAssetsBusting }}?{{ now.Unix }}{{ end }}" defer></script>
<script src="{{"js/d3/d3-dispatch.min.js" | relURL}}{{ if not .Site.Params.disableAssetsBusting }}?{{ now.Unix }}{{ end }}" defer></script>
<script src="{{"js/d3/d3-drag.min.js" | relURL}}{{ if not .Site.Params.disableAssetsBusting }}?{{ now.Unix }}{{ end }}" defer></script>
<script src="{{"js/d3/d3-ease.min.js" | relURL}}{{ if not .Site.Params.disableAssetsBusting }}?{{ now.Unix }}{{ end }}" defer></script>
<script src="{{"js/d3/d3-interpolate.min.js" | relURL}}{{ if not .Site.Params.disableAssetsBusting }}?{{ now.Unix }}{{ end }}" defer></script>
<script src="{{"js/d3/d3-selection.min.js" | relURL}}{{ if not .Site.Params.disableAssetsBusting }}?{{ now.Unix }}{{ end }}" defer></script>
<script src="{{"js/d3/d3-timer.min.js" | relURL}}{{ if not .Site.Params.disableAssetsBusting }}?{{ now.Unix }}{{ end }}" defer></script>
<script src="{{"js/d3/d3-transition.min.js" | relURL}}{{ if not .Site.Params.disableAssetsBusting }}?{{ now.Unix }}{{ end }}" defer></script>
<script src="{{"js/d3/d3-zoom.min.js" | relURL}}{{ if not .Site.Params.disableAssetsBusting }}?{{ now.Unix }}{{ end }}" defer></script>
{{- if isset .Params "custommermaidurl" }}
<script src="{{ .Params.customMermaidURL }}" defer></script>
{{- else if isset .Site.Params "custommermaidurl" }}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{{- /* https://discourse.gohugo.io/t/how-to-know-the-section-depth/37302/4 */ -}}
{{- $page := .page }}
{{- $depth := .depth | default 0 }}
{{- with $page.Parent }}
{{- $depth = add $depth 1 }}
{{- partial "get-page-depth.hugo" (dict "page" . "depth" $depth) }}
{{- else }}
{{- $depth }}
{{- end }}
Loading

0 comments on commit f6abd21

Please sign in to comment.