The MIT License (MIT)
-Copyright (c) 2014 zserge
-Copyright (c) 2023 Izuru Yakumo
+Copyright (c) 2014 Serge Zaitsev <hello@zserge.com>
+Copyright (c) 2023 Izuru Yakumo <yakumo.izuru@chaotic.ninja>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
-
-// $TheSupernovaDuo: marisa.chaotic.ninja/aya/cmd/aya, v0.6.7 2023-12-04 01:55:36+0000, yakumo_izuru Exp $
+// $TheSupernovaDuo: marisa.chaotic.ninja/aya/cmd/aya, v0.6.8 2023-12-04 15:43:44+0000, yakumo_izuru Exp $
package main
import (
// Render expanding aya plugins and variables
func render(s string, vars Vars) (string, error) {
- delim_open := "{{"
- delim_close := "}}"
+ delimOpen := "{{"
+ delimClose := "}}"
out := &bytes.Buffer{}
for {
- if from := strings.Index(s, delim_open); from == -1 {
+ if from := strings.Index(s, delimOpen); from == -1 {
out.WriteString(s)
return out.String(), nil
} else {
- if to := strings.Index(s, delim_close); to == -1 {
- return "", fmt.Errorf("Close delim not found")
+ if to := strings.Index(s, delimClose); to == -1 {
+ return "", fmt.Errorf("Closing delimiter not found")
} else {
out.WriteString(s[:from])
- cmd := s[from+len(delim_open) : to]
- s = s[to+len(delim_close):]
+ cmd := s[from+len(delimOpen) : to]
+ s = s[to+len(delimClose):]
m := strings.Fields(cmd)
if len(m) == 1 {
if v, ok := vars[m[0]]; ok {
ext := filepath.Ext(path)
if ext == ".md" || ext == ".mkd" || ext == ".markdown" {
return buildMarkdown(path, w, vars)
- } else if ext == ".html" || ext == ".xml" {
+ } else if ext == ".htm" || ext == ".html" || ext == ".xht" || ext == ".xhtml" {
return buildHTML(path, w, vars)
} else if ext == ".amber" {
return buildAmber(path, w, vars)
// This is a hard fork of git.mills.io/prologic/zs, which in turn is a fork of zserge's zs
// This one (re)incorporates the features removed in the former from the latter
-// Copyright (c) 2014 Serge Zaitsev
-// Copyright (c) 2023 Izuru Yakumo
+// Copyright (c) 2014 Serge Zaitsev <hello@zserge.com>
+// Copyright (c) 2023 Izuru Yakumo <yakumo.izuru@chaotic.ninja>
// Ayaya~
package aya