From d3f3390ce5695c5b50a9ef96b72cfa1c6a645f48 Mon Sep 17 00:00:00 2001 From: morre Date: Mon, 23 Oct 2023 10:48:24 +0200 Subject: [PATCH] docs: add healthz documentation (#48) This also fixes the RSS feed dates and includes all pages in the root RSS feed. --- content/de/search.md | 1 + content/en/docs/Reference/api/healthz.md | 16 +++++++ content/en/search.md | 1 + hugo.yaml | 5 ++ layouts/index.rss.xml | 61 ++++++++++++++++++++++++ 5 files changed, 84 insertions(+) create mode 100644 content/en/docs/Reference/api/healthz.md create mode 100644 layouts/index.rss.xml diff --git a/content/de/search.md b/content/de/search.md index fb18af6..2819ed3 100644 --- a/content/de/search.md +++ b/content/de/search.md @@ -1,4 +1,5 @@ --- title: Suchergebnisse layout: search +noRss: true --- diff --git a/content/en/docs/Reference/api/healthz.md b/content/en/docs/Reference/api/healthz.md new file mode 100644 index 0000000..84c3d85 --- /dev/null +++ b/content/en/docs/Reference/api/healthz.md @@ -0,0 +1,16 @@ +--- +title: "Healthchecks" +description: > + This document describes the /healthz endpoint +date: +--- + +The backend exposes a healthcheck endpoint at `/healthz` in version `v3.3.0` and newer. + +It returns + +- HTTP 204 for success +- HTTP 500 with an error message when there is an error + +Use this endpoint for health checks run by e.g. your monitoring, the Kubernetes liveness and readiness probes or +the docker compose health checks. diff --git a/content/en/search.md b/content/en/search.md index 394feea..dd88da3 100644 --- a/content/en/search.md +++ b/content/en/search.md @@ -1,4 +1,5 @@ --- title: Search Results layout: search +noRss: true --- diff --git a/hugo.yaml b/hugo.yaml index 05dfd9c..f2448ec 100644 --- a/hugo.yaml +++ b/hugo.yaml @@ -83,3 +83,8 @@ module: disable: false disableKinds: - taxonomy + +frontmatter: + date: + # Set the date to the git file date + - :git diff --git a/layouts/index.rss.xml b/layouts/index.rss.xml new file mode 100644 index 0000000..c17a0b3 --- /dev/null +++ b/layouts/index.rss.xml @@ -0,0 +1,61 @@ +{{- /* Deprecate site.Author.email in favor of site.Params.author.email */}} +{{- $authorEmail := "" }} +{{- with site.Params.author.email }} + {{- $authorEmail = . }} +{{- else }} + {{- with site.Author.email }} + {{- $authorEmail = . }} + {{- warnf "The author key in site configuration is deprecated. Use params.author.email instead." }} + {{- end }} +{{- end }} + +{{- /* Deprecate site.Author.name in favor of site.Params.author.name */}} +{{- $authorName := "" }} +{{- with site.Params.author.name }} + {{- $authorName = . }} +{{- else }} + {{- with site.Author.name }} + {{- $authorName = . }} + {{- warnf "The author key in site configuration is deprecated. Use params.author.name instead." }} + {{- end }} +{{- end }} + +{{- $pctx := . }} +{{- if .IsHome }}{{ $pctx = .Site }}{{ end }} +{{- $pages := slice }} +{{- if or $.IsHome $.IsSection }} +{{- $pages = $pctx.RegularPages }} +{{- else }} +{{- $pages = $pctx.Pages }} +{{- end }} +{{- $limit := .Site.Config.Services.RSS.Limit }} +{{- if ge $limit 1 }} +{{- $pages = $pages | first $limit }} +{{- end }} +{{- printf "" | safeHTML }} + + + {{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{ . }} on {{ end }}{{ .Site.Title }}{{ end }} + {{ .Permalink }} + Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{ . }} {{ end }}{{ end }}on {{ .Site.Title }} + Hugo -- gohugo.io + {{ site.Language.LanguageCode }}{{ with $authorEmail }} + {{.}}{{ with $authorName }} ({{ . }}){{ end }}{{ end }}{{ with $authorEmail }} + {{ . }}{{ with $authorName }} ({{ . }}){{ end }}{{ end }}{{ with .Site.Copyright }} + {{ . }}{{ end }}{{ if not .Date.IsZero }} + {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}{{ end }} + {{- with .OutputFormats.Get "RSS" }} + {{ printf "" .Permalink .MediaType | safeHTML }} + {{- end }} + {{- range where .Site.Pages "Params.noRss" "==" nil }} + + {{ .Title }} + {{ .Permalink }} + {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }} + {{- with $authorEmail }}{{ . }}{{ with $authorName }} ({{ . }}){{ end }}{{ end }} + {{ .Permalink }} + {{ .Summary | html }} + + {{- end }} + +