diff --git a/Makefile b/Makefile index 430e3997..b0058268 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: rss mastodon run +.PHONY: rss mastodon run update-socialstore-me rss: curl -k -u kevin https://rss.local.squirrels.dk/v1/export > data/links.xml @@ -7,14 +7,15 @@ run: hugo server --buildDrafts --buildFuture --minify socialstore-me: - git clone --depth=1 https://github.com/sudorandom/socialstore-me.git + git clone --depth=1 git@github.com:sudorandom/socialstore-me.git -mastodon: socialstore-me - cd socialstore-me; git pull origin main +update-socialstore-me: socialstore-me + cd socialstore-me; git fetch origin; git reset --hard origin/main + +mastodon: update-socialstore-me @mkdir -p assets/mastodon data/mastodon cp -r socialstore-me/media/* assets/mastodon/ cp -r socialstore-me/statuses/* data/mastodon/ - @rm -rf socialstore-me build: hugo --gc --minify --cleanDestinationDir --baseURL "https://kmcd.dev/" --destination=live diff --git a/scripts/pull-mastodon.sh b/scripts/pull-mastodon.sh deleted file mode 100644 index cb58f76d..00000000 --- a/scripts/pull-mastodon.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env bash - -source ./env - -git clone --depth=1 git@github.com:sudorandom/socialstore-me.git -pushd socialstore-me - # update socialstore - # go run main.go - - # if there are updates, push new change to github - if git status -s; then - echo "no new changes from mastodon" - else - git add . - git commit -m "Update database" - git push origin main - fi -popd diff --git a/scripts/rebuild.sh b/scripts/rebuild.sh deleted file mode 100755 index 7172ea2f..00000000 --- a/scripts/rebuild.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env bash - -make mastodon - -# Normal site -make build -if diff -q -r live live.old; then - echo "no changes detected, do nothing" -else - echo "changes detected!" - # npx wrangler --exclude=pagefind pages deploy --project-name=kmcd-dev ./live -fi -rm -rf live.old; cp -r live live.old - -# Future site -make build-future -if diff -q -r --exclude=pagefind future future.old; then - echo "no changes detected, do nothing" -else - echo "changes detected!" - # npx wrangler pages deploy --project-name=kmcd-dev-future ./future -fi -rm -rf future.old; cp -r future future.old diff --git a/wrangler.toml b/wrangler.toml new file mode 100644 index 00000000..44197f95 --- /dev/null +++ b/wrangler.toml @@ -0,0 +1 @@ +send_metrics = false