🐕
Corgi
  • 🐕About Corgi
  • 🎓Learning Corgi
    • 📂File Structure
    • 🎉Getting Started
    • 🔟Code
    • 📄Arrow Blocks
    • 🪄If and Switch
    • ✏️Interpolation
    • 🔁For
    • 🤝Attributes
    • 🎭Expressions
    • 👮Security and Escaping
    • 💉Nonce Injection
    • ➡️Block Expansions
    • ➕Mixins
    • 📚Libraries
    • ✨The Standard Library
    • 💬Comments
    • ⛓️Filters
    • 🖨️Include
    • 👪Inheritance (Extending)
    • ⚡Breaking Changes
Powered by GitBook
On this page

Was this helpful?

  1. Learning Corgi

File Structure

Before we dive right into corgi's syntax, let's talk about where to put all your files.

Conventionally, corgi files live right in the package that they are used in. Do note, however, that this pattern isn't a fit-for-all and depending on your situation you may want to place your templates elsewhere. See this as guidance if you're unsure where to put your templates.

To generate functions from your templates, place a go:generate directive somewhere in the package that executes the corgi command on the template file.

//go:generate corgi my_template.corgi

You can install corgi with go install:

go install github.com/mavolin/corgi/cmd/corgi@latest
PreviousAbout CorgiNextGetting Started

Last updated 1 year ago

Was this helpful?

🎓
📂