Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>Go Template Static SyntaxNew to Visual Studio Code? Get it now.
Go Template Static Syntax

Go Template Static Syntax

samueldcorbin

|
5 installs
| (0) | Free
Syntax highlighting for .gohtml files with embedded CSS, JS, and TS in {{define "static-*"}} blocks
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Go Template Static Syntax

VS Code extension that adds syntax highlighting for .gohtml files, with full language support inside {{define "static-*"}} blocks.

Features

  • Go template syntax highlighting in .gohtml files
  • Embedded CSS highlighting in {{define "static-css-*"}} blocks
  • Embedded JavaScript highlighting in {{define "static-js-*"}} blocks
  • Embedded TypeScript highlighting in {{define "static-ts-*"}} blocks

Usage

Name your template definitions with the static-css-, static-js-, or static-ts- prefix to get full language support inside the block:

{{define "static-css-main"}}
<style>
  .container {
    display: flex;
    align-items: center;
  }
</style>
{{end}}

{{define "static-js-main"}}
<script>
  document.addEventListener("DOMContentLoaded", () => {
    console.log("loaded");
  });
</script>
{{end}}

Blocks without a static-* prefix are treated as standard Go template / HTML.

License

MIT

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft