From 5cf0e15e2d292f7d42781a225be3e425beb3c3f9 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Sun, 24 Dec 2023 23:09:12 -0500 Subject: [PATCH] feat: add db init --- docker-compose.yml | 8 ++++++- dummy/layouts/_default/sitemap-web3news.xml | 24 +++++++++++++++++++++ package.json | 1 + 3 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 dummy/layouts/_default/sitemap-web3news.xml diff --git a/docker-compose.yml b/docker-compose.yml index 2433eb7..40ec85d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -20,4 +20,10 @@ services: command: ["npm", "run", "melli-init"] volumes: - ./data/app.db:/app/prisma/dev.db - profiles: ["mellisearch_init"] + profiles: ["disabled"] + db_init: + build: . + command: ["npm", "run", "db-init"] + volumes: + - ./data/app.db:/app/prisma/dev.db + profiles: ["disabled"] diff --git a/dummy/layouts/_default/sitemap-web3news.xml b/dummy/layouts/_default/sitemap-web3news.xml new file mode 100644 index 0000000..4c6f028 --- /dev/null +++ b/dummy/layouts/_default/sitemap-web3news.xml @@ -0,0 +1,24 @@ +{{ printf "" | safeHTML }} + + {{ range .Data.Posts }} + {{- if .Permalink -}} + + {{ .Permalink }}{{ if not .Lastmod.IsZero }} + {{ safeHTML ( .Lastmod.Format "2006-01-02T15:04:05-07:00" ) }}{{ end }}{{ with .Sitemap.ChangeFreq }} + {{ . }}{{ end }}{{ if ge .Sitemap.Priority 0.0 }} + {{ .Sitemap.Priority }}{{ end }}{{ if .IsTranslated }}{{ range .Translations }} + {{ end }} + {{ end }} + + {{- end -}} + {{ end }} + diff --git a/package.json b/package.json index 9710ee3..5b5c900 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,7 @@ "typecheck": "tsc", "bridge": "bun run scripts/bridge.mts", "melli-init": "bun run scripts/melli-init.mts", + "db-init": "prisma db push", "postinstall": "patch-package" }, "dependencies": {