Compare commits
7 Commits
9e13af4ddb
...
main
Author | SHA1 | Date | |
---|---|---|---|
d87f29923d | |||
c7a8d980b3 | |||
7c613510bf | |||
43fd49bf40 | |||
82d741d690 | |||
2ef8c257ed | |||
292b43815d |
@ -6,12 +6,12 @@ services:
|
|||||||
appserver:
|
appserver:
|
||||||
overrides:
|
overrides:
|
||||||
volumes:
|
volumes:
|
||||||
- ./:/app/web/wp-content/themes/sample-wp-block-theme
|
- ./sample-wp-block-theme/:/app/web/wp-content/themes/sample-wp-block-theme
|
||||||
build:
|
build:
|
||||||
- wp --path=/app/web/ core download
|
- 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/ 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:
|
events:
|
||||||
pre-rebuild:
|
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'
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
{
|
{
|
||||||
"core": null,
|
"core": null,
|
||||||
"theme": [ "." ]
|
"themes": [ "./sample-wp-block-theme" ],
|
||||||
|
"plugins": [ "wp-dummy-content-generator" ]
|
||||||
}
|
}
|
14
README.md
14
README.md
@ -14,18 +14,30 @@ Repo for practice task for Autonomic front-end recruitment.
|
|||||||
|
|
||||||
## Running the site locally
|
## 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`
|
### `wp-env`
|
||||||
|
|
||||||
You can launch an instance of WordPress pre-loaded with this theme using the `wp-env` tool.
|
**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.
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
$ npm -g i @wordpress/env
|
$ npm -g i @wordpress/env
|
||||||
$ cd /path/to/theme/Repo
|
$ cd /path/to/theme/Repo
|
||||||
$ wp-env start
|
$ 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.
|
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.
|
||||||
|
|
||||||
|
**Note:** This method assumes you already have `docker` and `docker-compose` installed locally.
|
||||||
|
|
||||||
### Lando
|
### Lando
|
||||||
|
|
||||||
Install Lando, then:
|
Install Lando, then:
|
||||||
|
@ -9,7 +9,7 @@ services:
|
|||||||
dns: 4.2.2.4
|
dns: 4.2.2.4
|
||||||
volumes:
|
volumes:
|
||||||
- "./entrypoint.sh:/usr/local/bin/entrypoint.sh:z"
|
- "./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"]
|
entrypoint: ["/usr/local/bin/entrypoint.sh"]
|
||||||
networks:
|
networks:
|
||||||
- backend
|
- backend
|
||||||
|
@ -4,5 +4,7 @@ add_action('init', 'custom_stylesheet');
|
|||||||
|
|
||||||
function custom_stylesheet() {
|
function custom_stylesheet() {
|
||||||
wp_register_style( 'custom-styles', get_template_directory_uri() . '/style.css' );
|
wp_register_style( 'custom-styles', get_template_directory_uri() . '/style.css' );
|
||||||
}
|
|
||||||
wp_enqueue_style( 'custom-styles' );
|
wp_enqueue_style( 'custom-styles' );
|
||||||
|
}
|
||||||
|
|
||||||
|
add_action( 'wp_enqueue_scripts', 'custom_stylesheet' );
|
8
sample-wp-block-theme/theme.json
Normal file
8
sample-wp-block-theme/theme.json
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"version": 2,
|
||||||
|
"$schema": "https://schemas.wp.org/trunk/theme.json",
|
||||||
|
"settings": {
|
||||||
|
"useRootPaddingAwareAlignments": true,
|
||||||
|
"appearanceTools": true
|
||||||
|
}
|
||||||
|
}
|
@ -1,4 +0,0 @@
|
|||||||
{
|
|
||||||
"version": 2,
|
|
||||||
"$schema": "https://schemas.wp.org/trunk/theme.json"
|
|
||||||
}
|
|
Reference in New Issue
Block a user