From 621cc4a0651f0dc0ac3054f7117133d6c47b7098 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sat, 20 Jul 2024 12:26:52 +0300 Subject: [PATCH] docs: Get rid of domain in output folder --- docs-new/.env | 3 +++ docs-new/prepare.sh | 9 ++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/docs-new/.env b/docs-new/.env index fa85707e4..e1182ce1a 100644 --- a/docs-new/.env +++ b/docs-new/.env @@ -1 +1,4 @@ +SHARE_PROTOCOL=https +SHARE_HOST=notes.eliandoran.me +ROOT_NOTE_ID=4yYHqKbLovVX SHARE_URL=https://notes.eliandoran.me/share/4yYHqKbLovVX \ No newline at end of file diff --git a/docs-new/prepare.sh b/docs-new/prepare.sh index 735af9818..bc579ad28 100755 --- a/docs-new/prepare.sh +++ b/docs-new/prepare.sh @@ -8,4 +8,11 @@ rm -rf "$output_dir" mkdir -p "$output_dir" source ./.env -wget -rp -e robots=off "$SHARE_URL" -P "$output_dir" \ No newline at end of file + +# Download everything in output/notes.example.com/share/... +share_url="$SHARE_PROTOCOL://$SHARE_HOST/share/$ROOT_NOTE_ID" +wget -rp -e robots=off "$share_url" -P "$output_dir" + +# Get rid of the domain in the output folder +mv "$output_dir/$SHARE_HOST"/* "$output_dir/" +rmdir "$output_dir/$SHARE_HOST" \ No newline at end of file