feat: add admin publishing workflow and yar theme

Add Go/Postgres admin APIs, Angular admin UI, manual build flow, asset uploads, markdown import/export, configurable slug generation, and the Yar reading theme. Exclude local docs and generated development artifacts from version control.
This commit is contained in:
yarnom 2026-06-01 15:48:04 +08:00
parent b78f4b39c9
commit f0b50d13ea
121 changed files with 27139 additions and 550 deletions

View file

@ -1,25 +1,19 @@
package cli
import "testing"
import (
"strings"
"testing"
)
func TestChangedConfigFields(t *testing.T) {
var a siteConfigFile
a.Meta.ConfigVersion = 1
a.Meta.UpdatedAt = "2026-05-28T12:00:00+08:00"
a.Site.Title = "A"
a.Content.PostsDir = "content/posts"
a.Build.OutputDir = "dist/site"
b := a
if fields := changedConfigFields(a, b); len(fields) != 0 {
t.Fatalf("unchanged config fields = %#v", fields)
func TestRunConfigReportsLocalOnly(t *testing.T) {
err := runConfig(t.TempDir(), nil)
if err == nil || !strings.Contains(err.Error(), "local-file-only") {
t.Fatalf("expected local-file-only error, got %v", err)
}
b.Site.Title = "B"
b.Build.OutputDir = "dist/other"
fields := changedConfigFields(a, b)
if len(fields) != 2 || fields[0] != "site.title" || fields[1] != "build.output_dir" {
t.Fatalf("changed fields = %#v", fields)
err = runConfig(t.TempDir(), []string{"sync"})
if err == nil || !strings.Contains(err.Error(), "unsupported subcommand \"sync\"") {
t.Fatalf("expected unsupported subcommand error, got %v", err)
}
}