mirror of
https://github.com/coder/coder.git
synced 2025-07-15 22:20:27 +00:00
docs: improve structure for example templates (#9842)
Co-authored-by: Kyle Carberry <kyle@carberry.com> Co-authored-by: Muhammad Atif Ali <atif@coder.com> Co-authored-by: Muhammad Atif Ali <me@matifali.dev>
This commit is contained in:
@ -67,7 +67,7 @@ func run() error {
|
||||
return xerrors.Errorf("parse example %q front matter: %w", exampleID, err)
|
||||
}
|
||||
|
||||
nameRaw, exists := frontMatter.FrontMatter["name"]
|
||||
nameRaw, exists := frontMatter.FrontMatter["display_name"]
|
||||
if !exists {
|
||||
return xerrors.Errorf("example %q front matter does not contain name", exampleID)
|
||||
}
|
||||
@ -110,6 +110,12 @@ func run() error {
|
||||
if !valid {
|
||||
return xerrors.Errorf("example %q icon isn't a string", exampleID)
|
||||
}
|
||||
icon, err = filepath.Rel("../site/static/", filepath.Join(examplesDir, name, icon))
|
||||
if err != nil {
|
||||
return xerrors.Errorf("example %q icon is not in site/static: %w", exampleID, err)
|
||||
}
|
||||
// The FE needs a static path!
|
||||
icon = "/" + icon
|
||||
}
|
||||
|
||||
examples = append(examples, codersdk.TemplateExample{
|
||||
|
Reference in New Issue
Block a user