Add alternative way to add image alt text

master
Jan-Lukas Else 2020-07-21 20:31:50 +02:00
parent 7cbaf6ad31
commit 491ce51bd4
1 changed files with 5 additions and 0 deletions

View File

@ -240,6 +240,11 @@ func computeExtraSettings(entry *Entry) error {
for _, image := range strings.Split(strings.TrimPrefix(text, "images: "), ",") { for _, image := range strings.Split(strings.TrimPrefix(text, "images: "), ",") {
entry.images = append(entry.images, Image{url: image}) entry.images = append(entry.images, Image{url: image})
} }
} else if strings.HasPrefix(text, "image-alts: ") {
// Image alt
for i, alt := range strings.Split(strings.TrimPrefix(text, "image-alts: "), ",") {
entry.images[i].alt = alt
}
} else if strings.HasPrefix(text, "audio: ") { } else if strings.HasPrefix(text, "audio: ") {
// Audio // Audio
entry.audio = strings.TrimPrefix(text, "audio: ") entry.audio = strings.TrimPrefix(text, "audio: ")