From 75b4ffd79d8fb07326ec1c608c81c901df4f6cd6 Mon Sep 17 00:00:00 2001 From: Jamie Sykes Date: Tue, 12 Aug 2025 15:12:12 +0100 Subject: [PATCH 1/7] Initial vitepress setup. --- .gitignore | 5 +++++ docs/.vitepress/.gitignore | 1 + docs/.vitepress/config.mts | 35 +++++++++++++++++++++++++++++++++++ package.json | 15 +++++++++++++++ 4 files changed, 56 insertions(+) create mode 100644 docs/.vitepress/.gitignore create mode 100644 docs/.vitepress/config.mts create mode 100644 package.json diff --git a/.gitignore b/.gitignore index de4a392..1041fa3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,7 @@ +# Composer Dependencies /vendor /composer.lock + +# Node Dependencies +/package-lock.json +node_modules \ No newline at end of file diff --git a/docs/.vitepress/.gitignore b/docs/.vitepress/.gitignore new file mode 100644 index 0000000..f8a91fd --- /dev/null +++ b/docs/.vitepress/.gitignore @@ -0,0 +1 @@ +cache/* \ No newline at end of file diff --git a/docs/.vitepress/config.mts b/docs/.vitepress/config.mts new file mode 100644 index 0000000..37be50e --- /dev/null +++ b/docs/.vitepress/config.mts @@ -0,0 +1,35 @@ +import { defineConfig } from 'vitepress' + +// https://vitepress.dev/reference/site-config +export default defineConfig({ + title: "WordPress Theme Framework - Documentation", + description: "Documentation for Creode's WordPress Theme Framework.", + themeConfig: { + // https://vitepress.dev/reference/default-theme-config + nav: [ + { text: 'Home', link: '/' }, + { text: 'Setup', link: '/introduction' } + ], + + sidebar: [ + { + text: 'Setup', + items: [ + { text: 'Introduction', link: '/introduction' }, + { text: 'Installation', link: '/installation' }, + { text: 'Migrating from Theme Core', link: '/migrating-from-theme-core' } + ] + }, + { + text: 'Commands', + items: [ + { text: 'Commands', link: '/commands' } + ] + } + ], + + socialLinks: [ + { icon: 'github', link: 'https://github.com/vuejs/vitepress' } + ] + } +}) diff --git a/package.json b/package.json new file mode 100644 index 0000000..a5e4695 --- /dev/null +++ b/package.json @@ -0,0 +1,15 @@ +{ + "name": "creode-wordpress-theme-framework", + "version": "1.0.0", + "description": "Creode's WordPress Theme Framework", + "author": "Creode", + "license": "MIT", + "devDependencies": { + "vitepress": "^1.6.4" + }, + "scripts": { + "docs:dev": "vitepress dev docs", + "docs:build": "vitepress build docs", + "docs:preview": "vitepress preview docs" + } +} From 38446020ec5b823aad9d01ae4a360ad6c15317d4 Mon Sep 17 00:00:00 2001 From: Jamie Sykes Date: Tue, 12 Aug 2025 15:12:24 +0100 Subject: [PATCH 2/7] Adds basic documentation to get us started. --- docs/commands.md | 8 ++++++++ docs/index.md | 17 +++++++++++++++++ docs/installation.md | 19 +++++++++++++++++++ docs/introduction.md | 6 ++++++ docs/migrating-from-theme-core.md | 29 +++++++++++++++++++++++++++++ 5 files changed, 79 insertions(+) create mode 100644 docs/commands.md create mode 100644 docs/index.md create mode 100644 docs/installation.md create mode 100644 docs/introduction.md create mode 100644 docs/migrating-from-theme-core.md diff --git a/docs/commands.md b/docs/commands.md new file mode 100644 index 0000000..086fd45 --- /dev/null +++ b/docs/commands.md @@ -0,0 +1,8 @@ +# Commands +This plugin comes with a number of commands to help you manage your theme. + +## `wp creode-theme:install` +Installs the Creode WordPress Framework files into your active theme (or a theme of your choice). + +## `wp creode-theme:build` +Builds the assets for all active themes (or a theme of your choice). \ No newline at end of file diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 0000000..d36791a --- /dev/null +++ b/docs/index.md @@ -0,0 +1,17 @@ +--- +# https://vitepress.dev/reference/default-theme-home-page +layout: home + +hero: + name: "WordPress Theme Framework" + text: "Creode" + tagline: Documentation for Creode's WordPress Theme Framework. + actions: + - theme: brand + text: Installation + link: /installation + - theme: alt + text: Instructions + link: /instructions +--- + diff --git a/docs/installation.md b/docs/installation.md new file mode 100644 index 0000000..1d3429d --- /dev/null +++ b/docs/installation.md @@ -0,0 +1,19 @@ +--- +outline: deep +--- + +# Installation + +## Composer (recommended) +Installing the plugin via composer will automatically create the loader for you and add to the mu-plugins directory of your WordPress installation. Ensure your composer paths are set correctly for your WordPress installation. + +```bash +composer require creode/wordpress-theme +``` + +## Manual + +1. Download the plugin from the [Creode WordPress Theme Framework GitHub repository](https://github.com/creode/wordpress-theme). +2. Upload the plugin to your WordPress mu-plugins directory. +3. Create the loader (steps to follow #TODO). +3. Activate the plugin. diff --git a/docs/introduction.md b/docs/introduction.md new file mode 100644 index 0000000..8765362 --- /dev/null +++ b/docs/introduction.md @@ -0,0 +1,6 @@ +--- +outline: deep +--- + +# Introduction +This project is a simple WordPress plugin containing the Creode WordPress Theme Framework. \ No newline at end of file diff --git a/docs/migrating-from-theme-core.md b/docs/migrating-from-theme-core.md new file mode 100644 index 0000000..4502fd3 --- /dev/null +++ b/docs/migrating-from-theme-core.md @@ -0,0 +1,29 @@ +--- +outline: deep +--- + +# Migrating from Theme Core + +This guide will help you migrate from Theme Core to the Creode WordPress Theme Framework. + +## Step 1: Install the Creode WordPress Theme Framework + +Follow the [installation guide](/installation) to install the Creode WordPress Theme Framework. + +## Step x: Remove Theme Core +Using composer, remove the theme core from your project. + +```bash +composer remove creode/theme-core +``` + +## Step x: Remove the requirement of the theme-core boot file +Remove it from your `TBC` file. + +## Step x: Adjust your PHP files within the theme to point to various locations. + +## Step x: Remove the theme core from your project. + +## Step x: Move your SCSS folder up a level + +## Step x: Migrate the component specific CSS files up to the component directory. From c18c60d7376385b1fe1421bbdebbe034a3b0cad3 Mon Sep 17 00:00:00 2001 From: Jamie Sykes Date: Tue, 12 Aug 2025 16:36:16 +0100 Subject: [PATCH 3/7] Writes an initial version of the documentation and guides for upgrading from the theme core project. --- docs/index.md | 5 +- docs/introduction.md | 13 ++- docs/migrating-from-theme-core.md | 183 ++++++++++++++++++++++++++++-- 3 files changed, 189 insertions(+), 12 deletions(-) diff --git a/docs/index.md b/docs/index.md index d36791a..fa476fa 100644 --- a/docs/index.md +++ b/docs/index.md @@ -11,7 +11,6 @@ hero: text: Installation link: /installation - theme: alt - text: Instructions - link: /instructions + text: Introduction + link: /introduction --- - diff --git a/docs/introduction.md b/docs/introduction.md index 8765362..03fff1a 100644 --- a/docs/introduction.md +++ b/docs/introduction.md @@ -3,4 +3,15 @@ outline: deep --- # Introduction -This project is a simple WordPress plugin containing the Creode WordPress Theme Framework. \ No newline at end of file +This project is a simple WordPress plugin containing the Creode WordPress Theme Framework. + +## Plugin Features +This plugin provides a simple way to install the Creode WordPress Theme Framework. It contains functionality that will allow for the simple compilation and handling of assets. It can facilitate the following: + +- Installation of the Creode WordPress Theme Framework +- Compilation of assets +- Providing a simple way to keep track of theme framework files and give a single location to manage SCSS and theme related files. +- Allow the sharing of new theme files and systems across multiple themes. + +## Commands +This plugin provides a number of commands. These are associated with the syncronisation of theme framework files and the compilation of assets. You can find more details on these commands in the [commands](/commands) section. \ No newline at end of file diff --git a/docs/migrating-from-theme-core.md b/docs/migrating-from-theme-core.md index 4502fd3..5335055 100644 --- a/docs/migrating-from-theme-core.md +++ b/docs/migrating-from-theme-core.md @@ -6,24 +6,191 @@ outline: deep This guide will help you migrate from Theme Core to the Creode WordPress Theme Framework. -## Step 1: Install the Creode WordPress Theme Framework +## Step 1: Ensure you have all composer packages updated +Run the following command to ensure you have all the latest packages installed. + +```bash +composer update +``` + +## Step 2: Install the Creode WordPress Theme Framework Follow the [installation guide](/installation) to install the Creode WordPress Theme Framework. -## Step x: Remove Theme Core +## Step 3: Remove the theme core from your project Using composer, remove the theme core from your project. ```bash composer remove creode/theme-core ``` -## Step x: Remove the requirement of the theme-core boot file -Remove it from your `TBC` file. +## Step 4: Remove the requirement of the theme-core boot file +Remove the following line from your `functions.php` file. + +```php +require_once get_template_directory() . '/core/boot.php'; // [!code --] +``` + +## Step 5: Replace class of register_vite_script function +The assets class from theme core has been removed and instead is now replaced with a function from the new theme framework. + +You will need to replace all occurrences and function calls: +```php +use Creode_Theme\Asset_Enqueue; // [!code ++] + +function [[THEME_NAME]]_enqueue_script() { + Assets::register_vite_script( 'header', 'src/components/header.js', array( 'jquery' ), true ); // [!code --] + + $asset_enqueue = Asset_Enqueue::get_instance(); // [!code ++] + $asset_enqueue->register_vite_script( 'header', 'src/components/header.js', array( 'jquery' ), true ); // [!code ++] + + // ... other required code ... +}; +add_action( 'wp_enqueue_scripts', '[[THEME_NAME]]_enqueue_script' ); +``` + +This will now ensure that all JS is loaded from Vite correctly. + +## Step 6: Remove hot reloading from your vite config file. +Hot reloading was a feature that was a little buggy on the theme core. It is therefore no longer supported in the new theme framework. There may be plans in future to reintroduce this feature. + +In order to remove hot reloading, you will need to remove the following line from your vite config file. + +```js +import { manageHotReloadFile } from './core/js/hot-reload.js'; // [!code --] + +export default defineConfig( + (command) => { + manageHotReloadFile(command.mode, DDEV_HOSTNAME, HOT_RELOAD_PORT); // [!code --] + + // ... other vite config code ... + } +); +``` + +## Step 7: Move your SCSS folder up a level +In the previous version of the theme core framework, the SCSS folder was located within the `src` folder. As part of this migration, you will need to move the SCSS folder up a level to the root of the project. The `SCSS` folder should now be located in the root of the theme. + +For example if you had a `src/scss` folder in the theme, it should now be moved to the root of the theme to `scss/`. + +## Step 8: Migrate the component specific CSS files up to the component directory +As part of the changes to how blocks are handled, the SCSS files for each block should now be moved to their relevant block folder. + +For example a header.scss component file will now be located in the following folder based on the theme root: `/blocks/header-block/assets/header.scss`. + +Each of these components should be moved to their relevant block folder. + +This is a change that will need to be done manually and can be quite tedious however it will ensure that all themes and blocks are kept consistent in the future. + +## Step 9: Remove individual components imports from the `admin.scss` and `main.scss` files +As part of the changes to how blocks are handled, the individual components `@use` and `@include` from the `admin.scss` and `main.scss` files are no longer required. These are now handled by the theme framework and will be automatically added to the theme in a new `blocks/_all.scss` file. + +This is a change that will need to be done manually and can be quite tedious however it will ensure that all themes and blocks are kept consistent in the future. + +You can recompile the assets to check over your changes periodically during this process by running the following WP CLI command: +```bash +wp creode-theme:build +``` + +## Step 10: Clean up scss import paths +After moving the SCSS files to their relevant block folder, you will need to clean up the `@use` paths for each of the SCSS files. Paths to scss files in vite can be absolute based on where the `vite.config.js` file is located. In this case it will be in the theme. -## Step x: Adjust your PHP files within the theme to point to various locations. +An example of this is demonstrated below with pulling the global file into the `header.scss` file: -## Step x: Remove the theme core from your project. +```scss +@use "../globals"; // [!code --] +@use "/scss/globals"; // [!code ++] +``` + +This change can be quite tedious to do manually however we want to ensure that all themes keep the same structure and paths so a change like this will help our projects stay consistent in the future. + +## Step 11: Run the script to install any framework files and compile assets +As part of the theme framework, there is a WordPress CLI command that will install any missing files and compile the assets. This ensures that the structure of the theme is kept consistent and that new files as part of the boilerplate can be added automatically to themes without having to keep track of them manually. + +## Step 12: Remove the admin and main js files from src +As part of the framework, the main.js and admin.js within the `src` folder are no longer required. These are now handled by the theme framework and will be automatically added to the theme in a new `vite-entry-points` folder. These files are no longer required and can be removed from the `src` folder, if there is more content to them, ensure this is now merged with the newly created equivalent files in the `vite-entry-points` folder. + +## Step 13: Update the vite config file to switch these entrypoints over +The `vite.config.js` file will need to be updated to switch these entrypoints over to the new `vite-entry-points` folder. + +```js +export default defineConfig( + (command) => { + return { + // ... other vite config code ... + build: { + rollupOptions: { + // overwrite default .html entry + input: { + main: resolve(__dirname, 'src/main.js'), // [!code --] + admin: resolve(__dirname, 'src/admin.js'), // [!code --] + main: resolve(__dirname, 'vite-entry-points/main.js'), // [!code ++] + admin: resolve(__dirname, 'vite-entry-points/admin.js'), // [!code ++] + // ... other vite config code ... + } + } + } + } + } +); +``` + + +## Step 14: Import the new `blocks/_all.scss` file into the main.scss file +Add the following to the top of the `main.scss` file: + +```scss +// Use base elements +@use 'base'; + +// Use blocks // [!code ++] +@use '/blocks/all' as blocks; // [!code ++] + +// ...other scss code... + +// Render base elements +@include base.render; + +// Render blocks // [!code ++] +@include blocks.render; // [!code ++] +``` -## Step x: Move your SCSS folder up a level +This will ensure that all blocks are loaded into the theme. -## Step x: Migrate the component specific CSS files up to the component directory. +## Step 15: Import the new `blocks/_all.scss` file into the admin.scss file +This process is very similar to the `main.scss` file however you will need to ensure that any admin specific mixins are handled manually using the new folder location. The new blocks all file only handle the render mixin and admin ones will need to be handled manually. See the below example for how this has changed: + +```scss +@use 'components/header'; // [!code --] +@use '/blocks/header-block/assets/_header' as header; // [!code ++] + +// ...other scss code... + +@include header.render; // [!code --] +@include header.admin; // [!code ++] +``` + +Add the following to the `admin.scss` file: + +```scss +// Use base elements +@use 'base'; + +// Use blocks +@use '/blocks/all' as blocks; // [!code ++] + +// ...other scss code... + +// Render base elements +@include base.render; + +// Render blocks // [!code ++] +@include blocks.render; // [!code ++] +``` + +## Step 16: Recompile the assets +Once these steps have been completed, you will need to recompile the assets. This can be done by running the following WP CLI command: + +```bash +wp creode-theme:build +``` From 1bea90a341fdf99a9e992bfa5dbf8c4e6379f588 Mon Sep 17 00:00:00 2001 From: Jamie Sykes Date: Tue, 12 Aug 2025 16:43:42 +0100 Subject: [PATCH 4/7] Add more oinformation and details about upgrading from theme core. --- docs/introduction.md | 9 +++++++- docs/migrating-from-theme-core.md | 37 +++++++++++++++++-------------- 2 files changed, 28 insertions(+), 18 deletions(-) diff --git a/docs/introduction.md b/docs/introduction.md index 03fff1a..f10f2f2 100644 --- a/docs/introduction.md +++ b/docs/introduction.md @@ -14,4 +14,11 @@ This plugin provides a simple way to install the Creode WordPress Theme Framewor - Allow the sharing of new theme files and systems across multiple themes. ## Commands -This plugin provides a number of commands. These are associated with the syncronisation of theme framework files and the compilation of assets. You can find more details on these commands in the [commands](/commands) section. \ No newline at end of file +This plugin provides a number of commands. These are associated with the syncronisation of theme framework files and the compilation of assets. You can find more details on these commands in the [commands](/commands) section. + +## Upgrades from Theme Core +The theme core was a small framework that initially handled the compilation of assets and the enqueueing of scripts and styles. It was a small framework that was not designed to be used as a base for themes. Details of this can be found in the [repository](https://github.com/creode/wordpress-theme-core). + +This package is designed to replace the theme core and provide a more robust framework for themes. + +A guide on upgrading your theme from the theme core to the new framework can be found in the [migrating from theme core](/migrating-from-theme-core) section. \ No newline at end of file diff --git a/docs/migrating-from-theme-core.md b/docs/migrating-from-theme-core.md index 5335055..16c5b82 100644 --- a/docs/migrating-from-theme-core.md +++ b/docs/migrating-from-theme-core.md @@ -4,34 +4,37 @@ outline: deep # Migrating from Theme Core -This guide will help you migrate from Theme Core to the Creode WordPress Theme Framework. +## Introduction +This guide will walk you through the process of migrating from the [theme core repository](https://github.com/creode/wordpress-theme-core) to the new framework. -## Step 1: Ensure you have all composer packages updated +## Upgrade Steps + +### 1: Ensure you have all composer packages updated Run the following command to ensure you have all the latest packages installed. ```bash composer update ``` -## Step 2: Install the Creode WordPress Theme Framework +### 2: Install the Creode WordPress Theme Framework Follow the [installation guide](/installation) to install the Creode WordPress Theme Framework. -## Step 3: Remove the theme core from your project +### 3: Remove the theme core from your project Using composer, remove the theme core from your project. ```bash composer remove creode/theme-core ``` -## Step 4: Remove the requirement of the theme-core boot file +### 4: Remove the requirement of the theme-core boot file Remove the following line from your `functions.php` file. ```php require_once get_template_directory() . '/core/boot.php'; // [!code --] ``` -## Step 5: Replace class of register_vite_script function +### 5: Replace class of register_vite_script function The assets class from theme core has been removed and instead is now replaced with a function from the new theme framework. You will need to replace all occurrences and function calls: @@ -51,7 +54,7 @@ add_action( 'wp_enqueue_scripts', '[[THEME_NAME]]_enqueue_script' ); This will now ensure that all JS is loaded from Vite correctly. -## Step 6: Remove hot reloading from your vite config file. +### 6: Remove hot reloading from your vite config file. Hot reloading was a feature that was a little buggy on the theme core. It is therefore no longer supported in the new theme framework. There may be plans in future to reintroduce this feature. In order to remove hot reloading, you will need to remove the following line from your vite config file. @@ -68,12 +71,12 @@ export default defineConfig( ); ``` -## Step 7: Move your SCSS folder up a level +### 7: Move your SCSS folder up a level In the previous version of the theme core framework, the SCSS folder was located within the `src` folder. As part of this migration, you will need to move the SCSS folder up a level to the root of the project. The `SCSS` folder should now be located in the root of the theme. For example if you had a `src/scss` folder in the theme, it should now be moved to the root of the theme to `scss/`. -## Step 8: Migrate the component specific CSS files up to the component directory +### 8: Migrate the component specific CSS files up to the component directory As part of the changes to how blocks are handled, the SCSS files for each block should now be moved to their relevant block folder. For example a header.scss component file will now be located in the following folder based on the theme root: `/blocks/header-block/assets/header.scss`. @@ -82,7 +85,7 @@ Each of these components should be moved to their relevant block folder. This is a change that will need to be done manually and can be quite tedious however it will ensure that all themes and blocks are kept consistent in the future. -## Step 9: Remove individual components imports from the `admin.scss` and `main.scss` files +### 9: Remove individual components imports from the `admin.scss` and `main.scss` files As part of the changes to how blocks are handled, the individual components `@use` and `@include` from the `admin.scss` and `main.scss` files are no longer required. These are now handled by the theme framework and will be automatically added to the theme in a new `blocks/_all.scss` file. This is a change that will need to be done manually and can be quite tedious however it will ensure that all themes and blocks are kept consistent in the future. @@ -92,7 +95,7 @@ You can recompile the assets to check over your changes periodically during this wp creode-theme:build ``` -## Step 10: Clean up scss import paths +### 10: Clean up scss import paths After moving the SCSS files to their relevant block folder, you will need to clean up the `@use` paths for each of the SCSS files. Paths to scss files in vite can be absolute based on where the `vite.config.js` file is located. In this case it will be in the theme. An example of this is demonstrated below with pulling the global file into the `header.scss` file: @@ -104,13 +107,13 @@ An example of this is demonstrated below with pulling the global file into the ` This change can be quite tedious to do manually however we want to ensure that all themes keep the same structure and paths so a change like this will help our projects stay consistent in the future. -## Step 11: Run the script to install any framework files and compile assets +### 11: Run the script to install any framework files and compile assets As part of the theme framework, there is a WordPress CLI command that will install any missing files and compile the assets. This ensures that the structure of the theme is kept consistent and that new files as part of the boilerplate can be added automatically to themes without having to keep track of them manually. -## Step 12: Remove the admin and main js files from src +### 12: Remove the admin and main js files from src As part of the framework, the main.js and admin.js within the `src` folder are no longer required. These are now handled by the theme framework and will be automatically added to the theme in a new `vite-entry-points` folder. These files are no longer required and can be removed from the `src` folder, if there is more content to them, ensure this is now merged with the newly created equivalent files in the `vite-entry-points` folder. -## Step 13: Update the vite config file to switch these entrypoints over +### 13: Update the vite config file to switch these entrypoints over The `vite.config.js` file will need to be updated to switch these entrypoints over to the new `vite-entry-points` folder. ```js @@ -136,7 +139,7 @@ export default defineConfig( ``` -## Step 14: Import the new `blocks/_all.scss` file into the main.scss file +### 14: Import the new `blocks/_all.scss` file into the main.scss file Add the following to the top of the `main.scss` file: ```scss @@ -157,7 +160,7 @@ Add the following to the top of the `main.scss` file: This will ensure that all blocks are loaded into the theme. -## Step 15: Import the new `blocks/_all.scss` file into the admin.scss file +### 15: Import the new `blocks/_all.scss` file into the admin.scss file This process is very similar to the `main.scss` file however you will need to ensure that any admin specific mixins are handled manually using the new folder location. The new blocks all file only handle the render mixin and admin ones will need to be handled manually. See the below example for how this has changed: ```scss @@ -188,7 +191,7 @@ Add the following to the `admin.scss` file: @include blocks.render; // [!code ++] ``` -## Step 16: Recompile the assets +### 16: Recompile the assets Once these steps have been completed, you will need to recompile the assets. This can be done by running the following WP CLI command: ```bash From a49613c6ad27367115677ac4017db47dcc28726d Mon Sep 17 00:00:00 2001 From: Jamie Sykes Date: Tue, 12 Aug 2025 16:47:11 +0100 Subject: [PATCH 5/7] Amends homepage and instead just uses the introduction page. --- docs/.vitepress/config.mts | 4 ++-- docs/index.md | 36 ++++++++++++++++++++++-------------- docs/introduction.md | 24 ------------------------ 3 files changed, 24 insertions(+), 40 deletions(-) delete mode 100644 docs/introduction.md diff --git a/docs/.vitepress/config.mts b/docs/.vitepress/config.mts index 37be50e..a765141 100644 --- a/docs/.vitepress/config.mts +++ b/docs/.vitepress/config.mts @@ -8,14 +8,14 @@ export default defineConfig({ // https://vitepress.dev/reference/default-theme-config nav: [ { text: 'Home', link: '/' }, - { text: 'Setup', link: '/introduction' } + { text: 'Installation', link: '/installation' }, ], sidebar: [ { text: 'Setup', items: [ - { text: 'Introduction', link: '/introduction' }, + { text: 'Introduction', link: '/' }, { text: 'Installation', link: '/installation' }, { text: 'Migrating from Theme Core', link: '/migrating-from-theme-core' } ] diff --git a/docs/index.md b/docs/index.md index fa476fa..f10f2f2 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,16 +1,24 @@ --- -# https://vitepress.dev/reference/default-theme-home-page -layout: home - -hero: - name: "WordPress Theme Framework" - text: "Creode" - tagline: Documentation for Creode's WordPress Theme Framework. - actions: - - theme: brand - text: Installation - link: /installation - - theme: alt - text: Introduction - link: /introduction +outline: deep --- + +# Introduction +This project is a simple WordPress plugin containing the Creode WordPress Theme Framework. + +## Plugin Features +This plugin provides a simple way to install the Creode WordPress Theme Framework. It contains functionality that will allow for the simple compilation and handling of assets. It can facilitate the following: + +- Installation of the Creode WordPress Theme Framework +- Compilation of assets +- Providing a simple way to keep track of theme framework files and give a single location to manage SCSS and theme related files. +- Allow the sharing of new theme files and systems across multiple themes. + +## Commands +This plugin provides a number of commands. These are associated with the syncronisation of theme framework files and the compilation of assets. You can find more details on these commands in the [commands](/commands) section. + +## Upgrades from Theme Core +The theme core was a small framework that initially handled the compilation of assets and the enqueueing of scripts and styles. It was a small framework that was not designed to be used as a base for themes. Details of this can be found in the [repository](https://github.com/creode/wordpress-theme-core). + +This package is designed to replace the theme core and provide a more robust framework for themes. + +A guide on upgrading your theme from the theme core to the new framework can be found in the [migrating from theme core](/migrating-from-theme-core) section. \ No newline at end of file diff --git a/docs/introduction.md b/docs/introduction.md deleted file mode 100644 index f10f2f2..0000000 --- a/docs/introduction.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -outline: deep ---- - -# Introduction -This project is a simple WordPress plugin containing the Creode WordPress Theme Framework. - -## Plugin Features -This plugin provides a simple way to install the Creode WordPress Theme Framework. It contains functionality that will allow for the simple compilation and handling of assets. It can facilitate the following: - -- Installation of the Creode WordPress Theme Framework -- Compilation of assets -- Providing a simple way to keep track of theme framework files and give a single location to manage SCSS and theme related files. -- Allow the sharing of new theme files and systems across multiple themes. - -## Commands -This plugin provides a number of commands. These are associated with the syncronisation of theme framework files and the compilation of assets. You can find more details on these commands in the [commands](/commands) section. - -## Upgrades from Theme Core -The theme core was a small framework that initially handled the compilation of assets and the enqueueing of scripts and styles. It was a small framework that was not designed to be used as a base for themes. Details of this can be found in the [repository](https://github.com/creode/wordpress-theme-core). - -This package is designed to replace the theme core and provide a more robust framework for themes. - -A guide on upgrading your theme from the theme core to the new framework can be found in the [migrating from theme core](/migrating-from-theme-core) section. \ No newline at end of file From ea33d59711a3b1af361171cfcc2d4e7d163f87e4 Mon Sep 17 00:00:00 2001 From: Jamie Sykes Date: Tue, 12 Aug 2025 16:51:58 +0100 Subject: [PATCH 6/7] Adds rule to ignore built docs folder. --- docs/.vitepress/.gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/.vitepress/.gitignore b/docs/.vitepress/.gitignore index f8a91fd..1075d0f 100644 --- a/docs/.vitepress/.gitignore +++ b/docs/.vitepress/.gitignore @@ -1 +1,2 @@ -cache/* \ No newline at end of file +cache/* +dist/* \ No newline at end of file From c268158800652a07630c655fe8655d739505c29e Mon Sep 17 00:00:00 2001 From: Jamie Sykes Date: Tue, 12 Aug 2025 16:52:11 +0100 Subject: [PATCH 7/7] Add command to deploy documentation to github pages. --- .github/workflows/deploy-docs.yml | 66 +++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 .github/workflows/deploy-docs.yml diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml new file mode 100644 index 0000000..7a685e3 --- /dev/null +++ b/.github/workflows/deploy-docs.yml @@ -0,0 +1,66 @@ +# Sample workflow for building and deploying a VitePress site to GitHub Pages +# +name: Deploy VitePress site to Pages + +on: + # Runs on pushes targeting the `main` branch. Change this to `master` if you're + # using the `master` branch as the default branch. + push: + branches: [main] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. +concurrency: + group: pages + cancel-in-progress: false + +jobs: + # Build job + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 # Not needed if lastUpdated is not enabled + # - uses: pnpm/action-setup@v3 # Uncomment this block if you're using pnpm + # with: + # version: 9 # Not needed if you've set "packageManager" in package.json + # - uses: oven-sh/setup-bun@v1 # Uncomment this if you're using Bun + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: 22 + cache: npm # or pnpm / yarn + - name: Setup Pages + uses: actions/configure-pages@v4 + - name: Install dependencies + run: npm ci # or pnpm install / yarn install / bun install + - name: Build with VitePress + run: npm run docs:build # or pnpm docs:build / yarn docs:build / bun run docs:build + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: docs/.vitepress/dist + + # Deployment job + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + needs: build + runs-on: ubuntu-latest + name: Deploy + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 \ No newline at end of file