diff --git a/app/src/main.go b/app/src/main.go index 2d95ab6..c5746c5 100644 --- a/app/src/main.go +++ b/app/src/main.go @@ -6,6 +6,7 @@ package main import ( "embed" "log" + "mime" "net/http" "os" ) @@ -15,6 +16,10 @@ import ( var web embed.FS func main() { + // Decap CMS requires config.yml served as a YAML content type (it checks the header). + _ = mime.AddExtensionType(".yml", "application/yaml") + _ = mime.AddExtensionType(".yaml", "application/yaml") + root := os.Getenv("KONTRA_CONTENT") if root == "" { root = "content" diff --git a/app/src/web/admin/config.yml b/app/src/web/admin/config.yml index 310d370..00c817b 100644 --- a/app/src/web/admin/config.yml +++ b/app/src/web/admin/config.yml @@ -1,23 +1,22 @@ # Kontra Admin — Decap CMS # Serves the same content repo that the Go binary renders. -# Editor saves -> git commit -> Gitea push -> 30s timer on .13 pulls -> site live. +# Editor saves -> git commit -> Gitea push -> 30s pull loop in the site container -> live. backend: - name: git-gateway + name: gitea + repo: sam/kontra-content # Gitea repo (org/user + name) branch: main - # Uses the "Decap CMS" OAuth / git-gateway app on Gitea. - # Swap to name: github / gitlab / gitea and a token if you prefer PAT-based. - -local_backend: false + app_id: ffe1375f-1a1b-40d2-9602-27b0f5b470fe # from Gitea OAuth application + base_url: https://gitea.lab.audasmedia.com.au + api_root: https://gitea.lab.audasmedia.com.au/api/v1 + auth_endpoint: login/oauth/authorize + clear_credentials_before_refresh: false # Media goes to Garage S3 via shortcode at render time; Decap just stores the # object key inside the .md. If you instead want files committed to the repo, # point media_folder at content/media and public_folder at /media. media_folder: "" # no local uploads by default public_folder: "" -media_library: - name: "" - config: {} # ------------------------------------------------------------------ # Collections @@ -26,7 +25,7 @@ collections: - name: articles label: Articles label_singular: Article - folder: content/subjects + folder: subjects create: true slug: "{{slug}}" path: "{{slug}}/{{slug}}" @@ -48,7 +47,7 @@ collections: - name: subjects label: Subjects label_singular: Subject - folder: content/subjects + folder: subjects create: true slug: "{{slug}}" path: "{{slug}}/_subject" @@ -61,7 +60,7 @@ collections: - name: pages label: Pages label_singular: Page - folder: content/pages + folder: ../pages create: true slug: "{{slug}}" fields: @@ -78,6 +77,3 @@ editor: preview: false frame: false -publish_mode: editorial_workflow - -show_preview_links: false \ No newline at end of file diff --git a/app/src/web/admin/index.html b/app/src/web/admin/index.html index 5fc9f9c..746144f 100644 --- a/app/src/web/admin/index.html +++ b/app/src/web/admin/index.html @@ -4,14 +4,10 @@ Kontra — Admin - - - + + \ No newline at end of file