Skip to content
Snippets Groups Projects

fix(deps): update github.com/piranha/gostatic commit hash to 0302df5

Merged renovate requested to merge renovate/github.com-piranha-gostatic-digest into master
5 files
+ 42
9
Compare changes
  • Side-by-side
  • Inline
Files
5
@@ -42,19 +42,50 @@ func (pm ProcessorMap) ProcessorSummary() {
@@ -42,19 +42,50 @@ func (pm ProcessorMap) ProcessorSummary() {
}
}
}
}
func (s *Site) ProcessCommand(page *Page, cmd *Command, pre bool) error {
func (cmd *Command) Name() string {
 
c := string(*cmd)
 
if strings.HasPrefix(c, ":") {
 
return "external"
 
} else {
 
return strings.SplitN(c, " ", 2)[0]
 
}
 
}
 
 
func (cmd *Command) Args() []string {
c := string(*cmd)
c := string(*cmd)
if strings.HasPrefix(c, ":") {
if strings.HasPrefix(c, ":") {
c = "external " + c[1:]
return strings.Split(c[1:], " ")
 
} else {
 
return strings.Split(c, " ")[1:]
}
}
bits := strings.Split(c, " ")
}
 
processor := s.Processors[bits[0]]
func (cmd *Command) Processor(s *Site) (Processor, error) {
 
name := cmd.Name()
 
processor := s.Processors[name]
if processor == nil {
if processor == nil {
return fmt.Errorf("processor '%s' not found", bits[0])
return nil, fmt.Errorf("processor '%s' not found", name)
 
}
 
return processor, nil
 
}
 
 
func (cmd *Command) IsPre(s *Site) (bool, error) {
 
processor, err := cmd.Processor(s)
 
if err != nil {
 
return false, err
 
}
 
return processor.Mode()&Pre != 0, nil
 
}
 
 
 
func (s *Site) ProcessCommand(page *Page, cmd *Command, pre bool) error {
 
processor, err := cmd.Processor(s)
 
if err != nil {
 
return err
}
}
if (processor.Mode()&Pre != 0) != pre {
if (processor.Mode()&Pre != 0) != pre {
return nil
return nil
}
}
return processor.Process(page, bits[1:])
return processor.Process(page, cmd.Args())
}
}
Loading