Skip to content

Commit d4f11fc

Browse files
authored
[infra] Use Docsy feature to display blog out-of-date banner (open-telemetry#6278)
1 parent e383aca commit d4f11fc

File tree

7 files changed

+22
-45
lines changed

7 files changed

+22
-45
lines changed

.gitmodules

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
[submodule "themes/docsy"]
33
path = themes/docsy
44
url = https://github.com/google/docsy.git
5-
docsy-pin = v0.11.0-39-g9e685592
5+
docsy-pin = v0.11.0-44-gcbc714be
66
docsy-note = "2024-04-01 Switching to google/docsy.git from cncf/docsy.git since we don't have any CNCF customizations."
77
docsy-reminder = "Ensure that any tag referenced by `docsy-pin` is present in the remote repo (url), otherwise add (push) the tags to the repo."
88
[submodule "content-modules/opentelemetry-specification"]

layouts/blog/content.html

-35
This file was deleted.
+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{{ if .Date.Before (now.AddDate -1 0 0) -}}
2+
<div class="pageinfo pageinfo-warning">
3+
<p>
4+
<i class="fa-solid fa-triangle-exclamation"></i>
5+
Blog posts are not updated after publication. This post is more
6+
than a year old, so its content may be outdated, and some links may be
7+
invalid. Cross-verify any information before relying on it.
8+
</p>
9+
</div>
10+
{{ end -}}

layouts/docs/baseof.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<!doctype html>
55
<html itemscope itemtype="http://schema.org/WebPage"
66
{{- with .Site.Language.LanguageDirection }} dir="{{ . }}" {{- end -}}
7-
{{ with .Site.Language.Lang }} lang="{{ $lang }}" {{- end }} {{/**/ -}}
7+
{{ with .Site.Language.Lang }} lang="{{ $lang.Lang }}" {{- end }} {{/**/ -}}
88
class="no-js">
99
<head>
1010
{{ partial "head.html" . }}

layouts/partials/i18n/lang.html

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1+
{{/* Returns the language object of this page, taking fallback pages into
2+
consideration. */ -}}
3+
14
{{ $fallbackPage := partial "i18n/fallback-page.html" . -}}
2-
{{ $lang := .Site.Language.Lang -}}
5+
{{ $lang := .Site.Language -}}
36
{{ with $fallbackPage -}}
4-
{{ $lang = .Language.Lang -}}
7+
{{ $lang = .Language -}}
58
{{ end -}}
69
{{ return $lang -}}

layouts/partials/translate-scripts.html

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
{{/* cSpell:ignore goog
2-
<!-- prettier-ignore -->
3-
*/ -}}
4-
{{ $pageProseLang := partial "i18n/lang.html" . -}}
1+
{{/* cSpell:ignore goog */ -}}
2+
{{ $pageProseLang := (partial "i18n/lang.html" .).Lang -}}
53
{{ $siteLang := .Site.Language.Lang -}}
6-
{{- if ne $siteLang $pageProseLang -}}
4+
5+
{{ if ne $siteLang $pageProseLang -}}
76

87
<script type="text/javascript">
98
const infoToConsole = false;

0 commit comments

Comments
 (0)