diff --git a/.env-template b/.env-template index 41a6eeef..13838b3b 100644 --- a/.env-template +++ b/.env-template @@ -1,12 +1,18 @@ # This is the porject root (where the .env file lives) ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +# Do this so these actually export as environment variables, not just shell variables +set -a + # https or http, as you wish PUBLIC_HTTP_PROTOCOL=https # The domain name the dashboard app PUBLIC_APP_DOMAIN=app.pockethost.lvh.me +# The domain name for the marketing/blog domain +PUBLIC_BLOG_DOMAIN=pockethost.lvh.me + # The name of the central PocketHost database. This is both a subdomain and a file name. PUBLIC_APP_DB=pockethost-central @@ -52,3 +58,5 @@ PH_BIN_CACHE=$ROOT/.pbincache PH_FTP_PASV_IP=0.0.0.0 PH_FTP_PASV_PORT_MIN=10000 PH_FTP_PASV_PORT_MAX=20000 + +set +a \ No newline at end of file diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 7b8ae0aa..aa24d8eb 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -7,6 +7,10 @@ jobs: contents: read deployments: write name: Publish to Cloudflare Pages + env: + PUBLIC_HTTP_PROTOCOL: 'https' + PUBLIC_BLOG_DOMAIN: 'pockethost.io' + PUBLIC_APP_DOMAIN: 'app.pockethost.io' steps: - name: Checkout uses: actions/checkout@v3 diff --git a/packages/www/_data/env.js b/packages/www/_data/env.js new file mode 100644 index 00000000..5a66e672 --- /dev/null +++ b/packages/www/_data/env.js @@ -0,0 +1,9 @@ +const env = { + HTTP_PROTOCOL: process.env.PUBLIC_HTTP_PROTOCOL || 'https', + BLOG_DOMAIN: process.env.PUBLIC_BLOG_DOMAIN || 'pockethost.lvh.me', + APP_DOMAIN: process.env.PUBLIC_APP_DOMAIN || 'app.pockethost.lvh.me', +} +env.APP_URL = `${env.HTTP_PROTOCOL}://${env.APP_DOMAIN}` +env.BLOG_URL = `${env.HTTP_PROTOCOL}://${env.BLOG_DOMAIN}` + +module.exports = env diff --git a/packages/www/_data/metadata.js b/packages/www/_data/metadata.js index 09fb2e4a..62895062 100644 --- a/packages/www/_data/metadata.js +++ b/packages/www/_data/metadata.js @@ -1,6 +1,8 @@ +const { BLOG_URL } = require('./env') + module.exports = { title: 'PocketHost', - url: 'https://pockethost.io/', + url: BLOG_URL, language: 'en', description: 'Get a PocketBase backend for your next app in under 10 seconds.', diff --git a/packages/www/_includes/layouts/base.njk b/packages/www/_includes/layouts/base.njk index 869e8d86..ec5bb8ed 100644 --- a/packages/www/_includes/layouts/base.njk +++ b/packages/www/_includes/layouts/base.njk @@ -17,7 +17,7 @@ - + diff --git a/packages/www/content/index.njk b/packages/www/content/index.njk index 9677143c..cfda3094 100644 --- a/packages/www/content/index.njk +++ b/packages/www/content/index.njk @@ -15,7 +15,7 @@ numberOfLatestPostsToShow: 3 building new features for your web app.

- {{ Buttons.PrimaryButton("Get Started", "https://app.pockethost.io/", "fa-solid fa-arrow-right") }} + {{ Buttons.PrimaryButton("Get Started", env.APP_URL, "fa-solid fa-arrow-right") }}