Skip to content
This repository was archived by the owner on Dec 18, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion .github/workflows/build-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,19 @@ jobs:
- name: "Checkout"
uses: "actions/checkout@v4"

- name: "Build"
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 22
cache: npm # or pnpm / yarn

- name: Install dependencies
run: npm ci

- name: Build Usage Docs
run: npm run docs:build

- name: Build API Docs
uses: "phpDocumentor/phpDocumentor@master"
with:
target: "build/docs"
Expand Down
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/vendor/
/build
.phpdoc/cache
.phpdoc/cache
docs/.vitepress/dist
docs/.vitepress/cache
docs/api
node_modules
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v22.10.0
5 changes: 5 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,10 @@
],
"require": {
"composer/installers": "*"
},
"config": {
"allow-plugins": {
"composer/installers": true
}
}
}
35 changes: 35 additions & 0 deletions docs/.vitepress/config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { defineConfig } from 'vitepress'

// https://vitepress.dev/reference/site-config
export default defineConfig({
title: "WordPress Blocks Plugin",
description: "Serves as developer Documentation for the WordPress Blocks Plugin",
themeConfig: {
// https://vitepress.dev/reference/default-theme-config
nav: [
{ text: 'Home', link: '/' },
{ text: 'API Documentation', link: 'api/index.html' }
],

sidebar: [
{
text: 'Introduction',
collapsed: false,
items: [
{ text: 'What is this plugin?', link: '/what-is-it' },
{ text: 'Quick Start', link: '/quick-start' }
]
},
{
text: 'Blocks',
items: [
{ text: 'Creation', link: '/block-creation' },
]
}
],

socialLinks: [
{ icon: 'github', link: 'https://github.com/creode/wordpress-blocks' }
]
}
})
14 changes: 14 additions & 0 deletions docs/assets/acf-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions docs/assets/fast-dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions docs/assets/fast.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions docs/assets/thumbs-up-dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions docs/assets/thumbs-up.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file added docs/block-caching.md
Empty file.
24 changes: 24 additions & 0 deletions docs/block-creation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
title: Creation
editLink: false
---
# Creation
The creation of a new block is very simple and can be done in a few steps. The plugin is built to be simple to use and easy to get started with.

There is a very useful script which has been written in WP-CLI which can be used to create a new block. This script will create all the necessary files and folders for a new block within the currently active theme by default. The script can be run with the following command:

```bash
wp make-block "My New Block"
```

With "My New Block" being the name of the block you would like to create. This will then add a new block to the blocks folder with the theme. The block will be created with a basic block structure and will be ready to be edited and used.

The created structure looks like this:

```
blocks
└── my-new-block
├── templates
│ └── block.php
└── class-my-new-block.php
```
31 changes: 31 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
# https://vitepress.dev/reference/default-theme-home-page
layout: home

hero:
name: "WordPress Blocks Plugin"
text: "Easy Gutenberg block creation"
actions:
- text: "Get Started"
theme: brand
link: /what-is-it
- text: "Quick Start"
theme: secondary
link: /quick-start

features:
- title: Build fast
icon:
light: /assets/fast.svg
dark: /assets/fast-dark.svg
details: Focuses on developer experience and easy creation of new WordPress blocks
- title: Leverage ACF
details: Blocks are created to leverage the power of ACF within the Gutenberg Editor, this gives a lot of freedom when building blocks
icon:
src: /assets/acf-icon.svg
- title: Simple to use
details: Due to the developer experience focus, the plugin is simple to use and easy to get started with
icon:
light: /assets/thumbs-up.svg
dark: /assets/thumbs-up-dark.svg
---
21 changes: 21 additions & 0 deletions docs/quick-start.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
title: Quick Start
editLink: false
---
# Quick Start
## Requirements
This plugin requires the following to be installed and active on the WordPress site:
- Advanced Custom Fields Pro - A pro license is required to handle block creation.
- WP-CLI (Recommended) - This is used to create new blocks easily.
- Composer (Recommended) - This is used to install the plugin, though a zipped version can be downloaded from Github and placed in the `wp-content/mu-plugins` folder if required.

## Installation
The block library can be installed through composer using the following command:

```bash
composer require creode/wordpress-blocks
```

::: tip
This plugin is recommended to be installed as a mu-plugin. This is due to the fact that it provides a lot of infrastructural requirements. Installing through composer will already place this in the mu-plugins folder.
:::
5 changes: 5 additions & 0 deletions docs/what-is-it.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: What is it?
---
# What is it?
This plugin is a WordPress plugin which facilitates the creation of blocks for the WordPress block editor. It is built using the WordPress ACF and the block editor. This module also contains infrastructure to assist in the creation of template based blocks.
Loading
Loading