diff --git a/.lando.yml b/.lando.yml index 9609c8c..761e4dc 100644 --- a/.lando.yml +++ b/.lando.yml @@ -6,12 +6,12 @@ services: appserver: overrides: volumes: - - ./:/app/web/wp-content/themes/sample-wp-block-theme + - ./sample-wp-block-theme/:/app/web/wp-content/themes/sample-wp-block-theme build: - wp --path=/app/web/ core download - wp --path=/app/web/ config create --skip-check --force --dbuser=wordpress --dbname=wordpress --dbpass=wordpress --dbhost=database - # - wp --path=/app/web/ core install --title="Dev Env" --admin_user=admin --admin_password=admin --admin_email=admin@example.com --skip-email --url=https://sample-block-theme.lndo.site/ - # - wp --path=/app/web/ theme activate sample-wp-block-theme events: pre-rebuild: - - rm -rf web/ + - 'find web -depth -regextype posix-extended -mindepth 1 ! -regex ".*sample-wp-block-theme.*" -delete || true' + post-destroy: + - 'find web -depth -regextype posix-extended -mindepth 1 ! -regex ".*sample-wp-block-theme.*" -delete || true' diff --git a/.wp-env.json b/.wp-env.json index 21cb4d0..cfc9782 100644 --- a/.wp-env.json +++ b/.wp-env.json @@ -1,4 +1,4 @@ { "core": null, - "themes": [ "." ] + "themes": [ "./sample-wp-block-theme" ] } diff --git a/README.md b/README.md index 8991411..1ec7ced 100644 --- a/README.md +++ b/README.md @@ -14,11 +14,16 @@ Repo for practice task for Autonomic front-end recruitment. ## Running the site locally +**Note** With all methods, you'll see a white screen when you visit the local +instance, because this theme is blank! You can check things are working by +visiting the local URL before the `theme activate` step, or just go straight to +the dashboard at `/wp-admin` and start hacking. + ### `wp-env` -**Note** this will only work with newer versions of Docker, if `docker compose` -gives `'compose' is not a docker command.` then either upgrade Docker or use -another method. +**Note** The latest `wp-env` requires "Docker Compose V2"; if `docker compose` +gives `'compose' is not a docker command.` then run `npm -g i +@wordpress/env@8.13.0` instead of the first command. You can launch an instance of WordPress pre-installed with this theme using the `wp-env` tool. @@ -26,6 +31,7 @@ You can launch an instance of WordPress pre-installed with this theme using the $ npm -g i @wordpress/env $ cd /path/to/theme/Repo $ wp-env start +$ wp-env run cli wp theme activate sample-wp-block-theme ``` This will launch a WordPress local instance at http://localhost:8888. You can log into the dashboard at http://localhost:8888/wp-admin with `admin` as the username and `password` as the password. diff --git a/docker-compose.yml b/docker-compose.yml index 4428fec..e959aad 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -9,7 +9,7 @@ services: dns: 4.2.2.4 volumes: - "./entrypoint.sh:/usr/local/bin/entrypoint.sh:z" - - ".:/var/www/html/wp-content/themes/sample-wp-block-theme:z" + - "./sample-wp-block-theme/:/var/www/html/wp-content/themes/sample-wp-block-theme:z" entrypoint: ["/usr/local/bin/entrypoint.sh"] networks: - backend diff --git a/assets/fonts/inter_normal_100.ttf b/sample-wp-block-theme/assets/fonts/inter_normal_100.ttf similarity index 100% rename from assets/fonts/inter_normal_100.ttf rename to sample-wp-block-theme/assets/fonts/inter_normal_100.ttf diff --git a/assets/fonts/inter_normal_200.ttf b/sample-wp-block-theme/assets/fonts/inter_normal_200.ttf similarity index 100% rename from assets/fonts/inter_normal_200.ttf rename to sample-wp-block-theme/assets/fonts/inter_normal_200.ttf diff --git a/assets/fonts/inter_normal_300.ttf b/sample-wp-block-theme/assets/fonts/inter_normal_300.ttf similarity index 100% rename from assets/fonts/inter_normal_300.ttf rename to sample-wp-block-theme/assets/fonts/inter_normal_300.ttf diff --git a/assets/fonts/inter_normal_400.ttf b/sample-wp-block-theme/assets/fonts/inter_normal_400.ttf similarity index 100% rename from assets/fonts/inter_normal_400.ttf rename to sample-wp-block-theme/assets/fonts/inter_normal_400.ttf diff --git a/assets/fonts/inter_normal_500.ttf b/sample-wp-block-theme/assets/fonts/inter_normal_500.ttf similarity index 100% rename from assets/fonts/inter_normal_500.ttf rename to sample-wp-block-theme/assets/fonts/inter_normal_500.ttf diff --git a/assets/fonts/inter_normal_600.ttf b/sample-wp-block-theme/assets/fonts/inter_normal_600.ttf similarity index 100% rename from assets/fonts/inter_normal_600.ttf rename to sample-wp-block-theme/assets/fonts/inter_normal_600.ttf diff --git a/assets/fonts/inter_normal_700.ttf b/sample-wp-block-theme/assets/fonts/inter_normal_700.ttf similarity index 100% rename from assets/fonts/inter_normal_700.ttf rename to sample-wp-block-theme/assets/fonts/inter_normal_700.ttf diff --git a/assets/fonts/inter_normal_800.ttf b/sample-wp-block-theme/assets/fonts/inter_normal_800.ttf similarity index 100% rename from assets/fonts/inter_normal_800.ttf rename to sample-wp-block-theme/assets/fonts/inter_normal_800.ttf diff --git a/assets/fonts/inter_normal_900.ttf b/sample-wp-block-theme/assets/fonts/inter_normal_900.ttf similarity index 100% rename from assets/fonts/inter_normal_900.ttf rename to sample-wp-block-theme/assets/fonts/inter_normal_900.ttf diff --git a/functions.php b/sample-wp-block-theme/functions.php similarity index 100% rename from functions.php rename to sample-wp-block-theme/functions.php diff --git a/style.css b/sample-wp-block-theme/style.css similarity index 100% rename from style.css rename to sample-wp-block-theme/style.css diff --git a/templates/index.html b/sample-wp-block-theme/templates/index.html similarity index 100% rename from templates/index.html rename to sample-wp-block-theme/templates/index.html diff --git a/theme.json b/sample-wp-block-theme/theme.json similarity index 100% rename from theme.json rename to sample-wp-block-theme/theme.json