From a83c52183cd71f4ece105288fe07caead1f883ac Mon Sep 17 00:00:00 2001 From: Jan Holthuis Date: Fri, 5 Jun 2020 19:34:08 +0200 Subject: [PATCH 1/5] Add netlify config --- netlify.toml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 netlify.toml diff --git a/netlify.toml b/netlify.toml new file mode 100644 index 000000000..4601c9b58 --- /dev/null +++ b/netlify.toml @@ -0,0 +1,14 @@ +# Settings in the [build] context are global and are applied to all contexts +# unless otherwise overridden by more specific contexts. +[build] + # Directory to change to before starting a build. + # This is where we will look for package.json/.nvmrc/etc. + base = "" + + # Default build command. + command = "cactus build && mv .build build" + + # Directory (relative to root of your repo) that contains the deploy-ready + # HTML files and assets generated by the build. If a base directory has + # been specified, include it in the publish directory path. + publish = "build/" From d5ed88587261ae20bc39ee8c37fe687dd2a46921 Mon Sep 17 00:00:00 2001 From: Jan Holthuis Date: Fri, 5 Jun 2020 21:02:49 +0200 Subject: [PATCH 2/5] Do not hardcode site-url in config.json --- config.de-DE.json | 2 +- config.de.json | 2 +- config.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/config.de-DE.json b/config.de-DE.json index dd9b484ad..285268d22 100644 --- a/config.de-DE.json +++ b/config.de-DE.json @@ -1,5 +1,5 @@ { "prettify": true, "locale": "de-de", - "site-url": "http://www.mixxx.org/de-DE/" + "site-url": "de-DE/" } diff --git a/config.de.json b/config.de.json index a6dd3f86d..3eec7724c 100644 --- a/config.de.json +++ b/config.de.json @@ -1,5 +1,5 @@ { "prettify": true, "locale": "de", - "site-url": "http://www.mixxx.org/de/" + "site-url": "de/" } diff --git a/config.json b/config.json index 0a06b77eb..a58d212d3 100644 --- a/config.json +++ b/config.json @@ -1,5 +1,5 @@ { "prettify": true, "locale": "en", - "site-url": "http://www.mixxx.org/" + "site-url": "" } From 06ac327608c5c2b7bb575a8d73ce28dc0f9821a0 Mon Sep 17 00:00:00 2001 From: Jan Holthuis Date: Fri, 5 Jun 2020 21:29:31 +0200 Subject: [PATCH 3/5] templates/footer: Add link to Netlify home page Required for Open-Source projects to qualify for the free plan: https://www.netlify.com/legal/open-source-policy/ --- templates/footer.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/templates/footer.html b/templates/footer.html index 1a64fe9ba..5759a86dc 100644 --- a/templates/footer.html +++ b/templates/footer.html @@ -54,7 +54,8 @@

About

© 2001-2020 Mixxx Development Team
- Logo by Paul Bloch + Logo by Paul Bloch
+ This site is powered by Netlify.
From 0c933485e4166763ed14d7e0e8f31f2dd0b793cd Mon Sep 17 00:00:00 2001 From: Jan Holthuis Date: Sat, 6 Jun 2020 17:58:45 +0200 Subject: [PATCH 4/5] Improve netlify build and add redirects --- _redirects | 2 ++ netlify.sh | 4 ++++ netlify.toml | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 _redirects create mode 100644 netlify.sh diff --git a/_redirects b/_redirects new file mode 100644 index 000000000..19c576aba --- /dev/null +++ b/_redirects @@ -0,0 +1,2 @@ +/manual/* https://holzhaus-mixxx-manual.netlify.app/:splat 302 +/* /error/ 404 diff --git a/netlify.sh b/netlify.sh new file mode 100644 index 000000000..87ce170f1 --- /dev/null +++ b/netlify.sh @@ -0,0 +1,4 @@ +#!/bin/sh +cactus build -v +mv .build build +cp _redirects build/ diff --git a/netlify.toml b/netlify.toml index 4601c9b58..fc4a93dfa 100644 --- a/netlify.toml +++ b/netlify.toml @@ -6,7 +6,7 @@ base = "" # Default build command. - command = "cactus build && mv .build build" + command = "sh netlify.sh" # Directory (relative to root of your repo) that contains the deploy-ready # HTML files and assets generated by the build. If a base directory has From b2cc5e9f2a24931a1ba1000f31db8f0ab21d5342 Mon Sep 17 00:00:00 2001 From: Jan Holthuis Date: Wed, 24 Jun 2020 16:22:47 +0200 Subject: [PATCH 5/5] netlify.sh: Add some comments --- netlify.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/netlify.sh b/netlify.sh index 87ce170f1..5436ff48a 100644 --- a/netlify.sh +++ b/netlify.sh @@ -1,4 +1,10 @@ #!/bin/sh +# Build the site (outputs into .build directory) cactus build -v + +# Rename the ".build" directory to "build" (Netlify seems to have problems with +# the leading dot in the name) mv .build build + +# Copy redirect configuration to build directory cp _redirects build/