Initial Commit

This commit is contained in:
2023-10-28 18:10:17 -07:00
commit 71a09170c9
20 changed files with 4991 additions and 0 deletions

36
examples/replybot/main.go Normal file
View File

@@ -0,0 +1,36 @@
package main
import (
_ "embed"
"log"
"os"
"go.elara.ws/salix"
)
//go:embed replybot.salix.txt
var tmpl string
var matches = [][]string{
{"https://i.imgur.com/aaaaaaa.jpg", "aaaaaaa.jpg"},
{"https://imgur.com/a/bbbbbbb.jpg", "a/bbbbbbb.jpg"},
}
func main() {
vars := map[string]any{
"type": "post",
"matches": matches,
}
t, err := salix.New().
WithVarMap(vars).
ParseString("replybot.salix.txt", tmpl)
if err != nil {
log.Fatalln(err)
}
err = t.Execute(os.Stdout)
if err != nil {
log.Fatalln(err)
}
}

View File

@@ -0,0 +1,8 @@
#if(len(matches) > 1):Imgur links were#else:An Imgur link was#!if detected in your #(type). Here are links to the same #if(len(matches) > 1):locations#else:location#!if on alternative frontends that protect your privacy.
#for(i, match in matches):
#if(len(matches) > 1):Link #(i+1):#!if
- [imgur.artemislena.eu](https://imgur.artemislena.eu/#(match[1]))
- [rimgo.projectsegfau.lt](https://rimgo.projectsegfau.lt/#(match[1]))
- [imgin.voidnet.tech](https://imgin.voidnet.tech/#(match[1]))
#!for