-// $TheSupernovaDuo: cmd/aya/main.go,v 0.6.3 2023/09/27 22:46:30 yakumo_izuru Exp $
+// $TheSupernovaDuo: marisa.chaotic.ninja/aya/cmd/aya, v 1.0 2023-10-03 02:34:17, yakumo_izuru Exp $
package main
import (
"marisa.chaotic.ninja/aya"
)
+// Define global constants here
const (
AYADIR = ".aya"
PUBDIR = ".pub"
// Renders markdown with the given layout into html expanding all the macros
func buildMarkdown(path string, w io.Writer, vars Vars) error {
v, body, err := getVars(path, vars)
+ extensions := blackfriday.CommonExtensions|blackfriday.AutoHeadingIDs|blackfriday.Strikethrough|blackfriday.Footnotes
if err != nil {
return err
}
return err
}
v["content"] = string(blackfriday.Run([]byte(content),
- blackfriday.WithExtensions(blackfriday.CommonExtensions|blackfriday.AutoHeadingIDs|blackfriday.Strikethrough|blackfriday.Footnotes),
+ blackfriday.WithExtensions(extensions),
))
if w == nil {
out, err := os.Create(filepath.Join(PUBDIR, renameExt(path, "", ".html")))
}
// This function passes the files to build to their corresponding functions
+// As far as I'm aware, Markdown has three possible filename extensions,
+// but .md is the most common one known.
func build(path string, w io.Writer, vars Vars) error {
ext := filepath.Ext(path)
if ext == ".md" || ext == ".mkd" || ext == ".markdown" {
}
}
+// Build everything and store it on PUBDIR
+// If boolean watch is true, it keeps on going
+// every time you modify something.
func buildAll(watch bool) {
lastModified := time.Unix(0, 0)
modified := false
os.Exit(0)
}
+// Main loop
func main() {
if len(os.Args) == 1 {
printUsage()
-package aya
// Package aya is [...]
// Aya is the fastest static site generator
// 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
+
// Ayaya~
+package aya