enh: add BLOG_DOMAIN support to www project and github actions

This commit is contained in:
Ben Allfree 2023-10-11 05:25:47 -07:00
parent 677c374d4a
commit ff583270db
7 changed files with 28 additions and 5 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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.',

View File

@ -17,7 +17,7 @@
<!-- Twitter Meta Tags -->
<meta name="twitter:card" content="summary_large_image">
<meta property="twitter:domain" content="pockethost.io">
<meta property="twitter:domain" content="{{ env.BLOG_DOMAIN }}">
<meta property="twitter:url" content="{{ metadata.url + page.url }}">
<meta name="twitter:title" content="{{ title }} - PocketHost">
<meta name="twitter:description" content="{{ description or metadata.description }}">

View File

@ -15,7 +15,7 @@ numberOfLatestPostsToShow: 3
building <b class='text-green-600 dark:text-green-400'>new features</b> for your web app.
</p>
{{ 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") }}
</div>
<div class='w-full p-8 lg:w-1/2 lg:block hidden'>
@ -82,7 +82,7 @@ numberOfLatestPostsToShow: 3
<div class="container mx-auto md:bg-gradient-to-r md:from-zinc-900 md:to-zinc-800 bg-zinc-800 border-zinc-700 border-2 rounded-[75px] flex flex-wrap mb-12 shadow-xl overflow-hidden">
<div class='bg-zinc-900 md:w-1/2'>
{{ MainFeatureBlock("fa-laptop-code", "Up in 30 seconds", "Work Smarter, Not Harder", "A backend for your next app is as fast as signing up. No provisioning servers, no Docker fiddling, just B(ad)aaS productivity. Pick a unique project name and connect with our JS Client.", "Create Your New Backend", "https://app.pockethost.io/") }}
{{ MainFeatureBlock("fa-laptop-code", "Up in 30 seconds", "Work Smarter, Not Harder", "A backend for your next app is as fast as signing up. No provisioning servers, no Docker fiddling, just B(ad)aaS productivity. Pick a unique project name and connect with our JS Client.", "Create Your New Backend", env.APP_URL) }}
</div>
<div class='bg-zinc-800 md:w-1/2'>

View File

@ -6,7 +6,7 @@
"build": "npx @11ty/eleventy",
"build-ghpages": "npx @11ty/eleventy --pathprefix=/eleventy-base-blog/",
"start:tailwind": "tailwind -i ./public/css/index.css -o ./_site/css/index.css --watch",
"start": "npx @11ty/eleventy --serve --quiet",
"start": "source ../../.env && npx @11ty/eleventy --serve --quiet",
"debug": "DEBUG=Eleventy* npx @11ty/eleventy",
"debugstart": "DEBUG=Eleventy* npx @11ty/eleventy --serve --quiet",
"benchmark": "DEBUG=Eleventy:Benchmark* npx @11ty/eleventy",