Skip to content

Commit b1e2683

Browse files
committed
Render OpenTofu logo
1 parent 5a677d9 commit b1e2683

3 files changed

Lines changed: 36 additions & 2 deletions

File tree

docs/src/components/Head.astro

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,37 @@ import Analytics from '@vercel/analytics/astro';
1010
<link rel="icon" href="/favicon-dark.svg" type="image/svg+xml" media="(prefers-color-scheme: dark)" />
1111
<Analytics />
1212

13+
<!-- Replace Terraform icons with OpenTofu icons in FileTree for .tf files -->
14+
<script>
15+
// OpenTofu logo SVG path (official logo simplified for 24x24 viewBox)
16+
const opentofuPath = `
17+
<path d="M12 2L3 7v10l9 5 9-5V7l-9-5zm0 2.18l6.26 3.48L12 11.14 5.74 7.66 12 4.18zm-7 5.04l6 3.33v6.63l-6-3.33v-6.63zm8 9.96v-6.63l6-3.33v6.63l-6 3.33z" fill="currentColor"/>
18+
`;
19+
20+
function replaceTerrformIconsWithOpenTofu() {
21+
document.querySelectorAll('starlight-file-tree').forEach(tree => {
22+
tree.querySelectorAll('.file .tree-entry').forEach(entry => {
23+
const text = entry.textContent || '';
24+
// Check if this is a .tf, .tfvars, or .tf.json file
25+
if (text.match(/\.tf($|\s|\.json)|\.tfvars/)) {
26+
const svg = entry.querySelector('svg.tree-icon');
27+
if (svg) {
28+
svg.innerHTML = opentofuPath;
29+
svg.setAttribute('viewBox', '0 0 24 24');
30+
}
31+
}
32+
});
33+
});
34+
}
35+
36+
// Run when DOM is ready
37+
if (document.readyState === 'loading') {
38+
document.addEventListener('DOMContentLoaded', replaceTerrformIconsWithOpenTofu);
39+
} else {
40+
replaceTerrformIconsWithOpenTofu();
41+
}
42+
43+
// Also run after Astro page transitions (for view transitions)
44+
document.addEventListener('astro:page-load', replaceTerrformIconsWithOpenTofu);
45+
</script>
46+

docs/src/content/docs/intro/generated_files.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Template blocks automatically re-render when you change input values, so your ge
3838
This is useful when scripts or tools generate files as part of their execution.
3939

4040
<Aside type="note">
41-
The current approach to how Commands handle files is not ideal. See https://github.com/gruntwork-io/runbooks/issues/32 for additional information, and to track improvements.
41+
The current approach to how Commands handle file capture is not ideal. See https://github.com/gruntwork-io/runbooks/issues/32 for additional information, and to track improvements.
4242
</Aside>
4343

4444
## Where files are stored

docs/src/content/docs/intro/use_cases.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Use Cases
33
sidebar:
4-
order: 5
4+
order: 6
55
---
66

77
import { Aside } from '@astrojs/starlight/components';

0 commit comments

Comments
 (0)