• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mlange-42 / modo / 12999379643

27 Jan 2025 10:16PM CUT coverage: 65.591%. Remained the same
12999379643

push

github

web-flow
Use Hugo fork with Mojo lexer for docs (#132)

1098 of 1674 relevant lines covered (65.59%)

31.25 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

66.67
/format/hugo.go
1
package format
2

3
import (
4
        "fmt"
5
        "path"
6
        "strings"
7

8
        "github.com/mlange-42/modo/document"
9
)
10

11
type Hugo struct{}
12

13
func (f *Hugo) Accepts(files []string) error {
×
14
        return nil
×
15
}
×
16

17
func (f *Hugo) ProcessMarkdown(element any, text string, proc *document.Processor) (string, error) {
1✔
18
        b := strings.Builder{}
1✔
19
        err := proc.Template.ExecuteTemplate(&b, "hugo_front_matter.md", element)
1✔
20
        if err != nil {
1✔
21
                return "", err
×
22
        }
×
23
        b.WriteRune('\n')
1✔
24
        b.WriteString(text)
1✔
25
        return b.String(), nil
1✔
26
}
27

28
func (f *Hugo) WriteAuxiliary(p *document.Package, dir string, proc *document.Processor) error {
×
29
        return nil
×
30
}
×
31

32
func (f *Hugo) ToFilePath(p string, kind string) string {
6✔
33
        if kind == "package" || kind == "module" {
10✔
34
                return path.Join(p, "_index.md")
4✔
35
        }
4✔
36
        return p + ".md"
2✔
37
}
38

39
func (f *Hugo) ToLinkPath(p string, kind string) string {
3✔
40
        p = f.ToFilePath(p, kind)
3✔
41
        return fmt.Sprintf("{{< ref \"%s\" >}}", p)
3✔
42
}
3✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc