Skip to content

Commit 32c8c4d

Browse files
Add autogen warning to index file (#2493)
This pull request adds a Markdown comment containing an autogen warning to the _index.md file. It does so immediately inside the Hugo frontmatter. h/t to @iwahbe for pointing out Markdown will work fine here. Fixes #2485.
2 parents 7d17d64 + dda50da commit 32c8c4d

File tree

4 files changed

+6
-1
lines changed

4 files changed

+6
-1
lines changed

pkg/tfgen/installation_docs.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,9 @@ func writeFrontMatter(providerName string) string {
8282
// Capitalize the package name
8383
capitalize := cases.Title(language.English)
8484
title := capitalize.String(providerName)
85-
8685
return fmt.Sprintf(delimiter+
86+
"# *** WARNING: This file was auto-generated. "+
87+
"Do not edit by hand unless you're certain you know what you are doing! ***\n"+
8788
"title: %[1]s Provider\n"+
8889
"meta_desc: Provides an overview on how to configure the Pulumi %[1]s provider.\n"+
8990
"layout: package\n"+

pkg/tfgen/installation_docs_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,8 @@ func TestWriteFrontMatter(t *testing.T) {
272272
name: "Generates Front Matter for installation-configuration.md",
273273
providerName: "test",
274274
expected: delimiter +
275+
"# *** WARNING: This file was auto-generated. " +
276+
"Do not edit by hand unless you're certain you know what you are doing! ***\n" +
275277
"title: Test Provider\n" +
276278
"meta_desc: Provides an overview on how to configure the Pulumi Test provider.\n" +
277279
"layout: package\n" +

pkg/tfgen/test_data/convert-index-file-edit-rules/expected.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
---
2+
# *** WARNING: This file was auto-generated. Do not edit by hand unless you're certain you know what you are doing! ***
23
title: Libvirt Provider
34
meta_desc: Provides an overview on how to configure the Pulumi Libvirt provider.
45
layout: package

pkg/tfgen/test_data/convert-index-file/expected.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
---
2+
# *** WARNING: This file was auto-generated. Do not edit by hand unless you're certain you know what you are doing! ***
23
title: Libvirt Provider
34
meta_desc: Provides an overview on how to configure the Pulumi Libvirt provider.
45
layout: package

0 commit comments

Comments
 (0)