Skip to content

Commit b430165

Browse files
authored
Enable Markdown-format output (#9597)
1 parent 081d82b commit b430165

File tree

5 files changed

+24
-9
lines changed

5 files changed

+24
-9
lines changed

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
path = themes/docsy
44
url = https://github.com/google/docsy.git
55
# cSpell:disable-next-line
6-
docsy-pin = v0.14.3-34-g4db086c6
6+
docsy-pin = v0.14.3-36-gc0587d9b
77
docsy-note = "2024-04-01 Switching to google/docsy.git from cncf/docsy.git since we don't have any CNCF customizations."
88
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."
99
[submodule "content-modules/opentelemetry-specification"]

config/_default/hugo.yaml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,9 @@ outputFormats:
9696
notAlternative: true
9797

9898
outputs:
99-
home: &home-outputs [HTML, RSS]
100-
section: &section-outputs [HTML]
99+
home: [HTML, markdown, RSS]
100+
page: [HTML, markdown]
101+
section: [HTML, markdown]
101102

102103
services:
103104
rss: { limit: 20 }
@@ -108,16 +109,16 @@ cascade:
108109

109110
# Enable redirects for site root (and not locales)
110111
- outputs:
111-
# This must match the equivalent of [*home-outputs, redirects]
112-
[HTML, RSS, redirects]
112+
# This must match the equivalent of [outputs.home, redirects]
113+
[HTML, markdown, RSS, redirects]
113114
target:
114115
kind: home
115116
sites: { matrix: { languages: [en] } }
116117

117118
# Enable RSS for blog section
118119
- outputs:
119-
# This must match the equivalent of [*section-outputs, RSS]
120-
[HTML, RSS]
120+
# This must match the equivalent of [outputs.section, RSS]
121+
[HTML, markdown, RSS]
121122
target:
122123
kind: section
123124
path: '/blog'

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@
103103
"netlify-build:preview": "npm run seq -- build:preview diff:check",
104104
"netlify-build:production": "npm run seq -- build:production diff:check",
105105
"pin:submodule": "npm run _pin:submodule -- $PIN_SKIP",
106-
"post_hugo": "echo 'Temporarily rm Docsy favicons until https://github.com/google/docsy/issues/2595 is fixed'; cd public && rm -Rf favicons",
106+
"post_hugo": "scripts/strip-hugo-ctx.sh public; echo 'Temporarily rm Docsy favicons until https://github.com/google/docsy/issues/2595 is fixed'; cd public && rm -Rf favicons",
107107
"postfix:refcache:refresh": "npm run fix:refcache",
108108
"postfix:submodule": "git submodule",
109109
"postget:submodule": "git submodule && echo && scripts/update-semconv-mounts.pl",

scripts/strip-hugo-ctx.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/usr/bin/env bash
2+
3+
set -euo pipefail
4+
5+
target_dir="${1:-public}"
6+
7+
if [[ ! -d "$target_dir" ]]; then
8+
echo "Directory not found: $target_dir"
9+
exit 0
10+
fi
11+
12+
find -L "$target_dir" -type f -name '*.md' -exec perl -i -ne '
13+
print unless /^\{\{__hugo_ctx pid=\d+\}\}\s*$/;
14+
' {} +

0 commit comments

Comments
 (0)