summaryrefslogtreecommitdiff
path: root/indexers/pikdex/meta.go
diff options
context:
space:
mode:
authorewy <ewy0@protonmail.com>2026-04-14 16:37:17 +0200
committerewy <ewy0@protonmail.com>2026-04-14 16:37:17 +0200
commit45a297a8e526094e8fce6e2c5c0fd89b381d1765 (patch)
tree852ebc3a0112c94dc9726d0b27ab057bf6383660 /indexers/pikdex/meta.go
i have to commit at some point!
Diffstat (limited to 'indexers/pikdex/meta.go')
-rw-r--r--indexers/pikdex/meta.go27
1 files changed, 27 insertions, 0 deletions
diff --git a/indexers/pikdex/meta.go b/indexers/pikdex/meta.go
new file mode 100644
index 0000000..af1af93
--- /dev/null
+++ b/indexers/pikdex/meta.go
@@ -0,0 +1,27 @@
+package pikdex
+
+import (
+ "strings"
+)
+
+type MetaSetter func(s *SourceData, content string)
+
+var MetaFiles = map[string]MetaSetter{
+ ".alias": func(s *SourceData, content string) {
+ split := strings.Split(content, "\n")
+ s.Aliases = make([]string, 0, len(split))
+ for _, line := range split {
+ stripped := strip(line)
+ if stripped != "" {
+ s.Aliases = append(s.Aliases, stripped)
+ }
+ }
+ },
+ ".icon": func(s *SourceData, content string) {
+ s.Icon = string([]rune(strip(content))[0:2])
+ },
+}
+
+func strip(input string) string {
+ return strings.TrimSpace(input)
+}