-
Notifications
You must be signed in to change notification settings - Fork 15
docs: update markdown template #571
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 10 commits
f7e701e
d7976f7
945538f
0663e99
514bf65
bdecde4
d7614b7
47dd1df
19dee62
e957195
ba7cbce
823416c
647f139
70cd2de
56eb505
78a6b70
54cf281
64093d4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| changelog: | ||
| - type: FIX | ||
| issueLink: https://github.com/solo-io/solo-projects/issues/6612 | ||
| resolvesIssue: false | ||
| description: >- | ||
| Update the markdown templates to fit new formatting guidelines. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -147,22 +147,37 @@ func (d *DocsGen) FileHeader(filename string) string { | |
| return ".. Code generated by solo-kit. DO NOT EDIT." | ||
| } | ||
| if d.DocsOptions.Output == options.Hugo { | ||
| name := filepath.Base(filename) | ||
| if strings.HasSuffix(name, d.protoSuffix()) { | ||
| name = name[:len(name)-len(d.protoSuffix())] | ||
| } | ||
| return fmt.Sprintf(` | ||
| return d.hugoFileHeader(filename) | ||
| } | ||
| return `<!-- Code generated by solo-kit. DO NOT EDIT. --> | ||
| ` | ||
| } | ||
|
|
||
| func (d *DocsGen) hugoFileHeader(filename string) string { | ||
| name := filepath.Base(filename) | ||
|
|
||
| var title string | ||
| if strings.HasSuffix(name, d.protoSuffix()) { | ||
| // Remove the "sk.md" extensions | ||
| name = name[:len(name)-len(d.protoSuffix())] | ||
|
|
||
| // Remove the ".proto" extension | ||
| extension := filepath.Ext(name) | ||
| title = strcase.ToCamel(name[0 : len(name)-len(extension)]) | ||
arianaw66 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
arianaw66 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
sam-heilbron marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| } else { | ||
| // Not a file for a proto file, leave the title to match the name of the file | ||
sam-heilbron marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| title = name | ||
| } | ||
|
|
||
| return fmt.Sprintf(` | ||
| --- | ||
| title: "%s" | ||
| weight: 5 | ||
| --- | ||
|
|
||
| <!-- Code generated by solo-kit. DO NOT EDIT. --> | ||
|
|
||
| `, name) | ||
| } | ||
| return `<!-- Code generated by solo-kit. DO NOT EDIT. --> | ||
| ` | ||
| `, title) | ||
| } | ||
|
|
||
| func (d *DocsGen) projectSuffix() string { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.