https://github.com/deek87/html-webpack-c5-theme-plugin
Concrete5 Theme Plugin for html-webpack-plugin to generate concrete5 theme files.
https://github.com/deek87/html-webpack-c5-theme-plugin
concrete5 concrete5-theme html-webpack-plugin-plugin php theme theme-development webpack webpack-plugin
Last synced: 23 days ago
JSON representation
Concrete5 Theme Plugin for html-webpack-plugin to generate concrete5 theme files.
- Host: GitHub
- URL: https://github.com/deek87/html-webpack-c5-theme-plugin
- Owner: deek87
- License: mit
- Created: 2020-05-19T08:42:00.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-03-14T17:44:31.000Z (about 3 years ago)
- Last Synced: 2025-10-26T22:46:04.428Z (7 months ago)
- Topics: concrete5, concrete5-theme, html-webpack-plugin-plugin, php, theme, theme-development, webpack, webpack-plugin
- Language: TypeScript
- Homepage:
- Size: 280 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Html-Webpack-C5-Theme-Plugin
 
## Installation
To install first run
```
npm install -D html-webpack-plugin webpack
npm install -D html-webpack-c5-theme-plugin
```
then inside your webpack.config.js file
```js
const { HtmlWebpackC5ThemePlugin } = require("html-webpack-c5-theme-plugin");
// or use const HtmlWebpackC5ThemePlugin = require("html-webpack-c5-theme-plugin").default;
const HtmlWebpackPlugin = require("html-webpack-plugin");
module.exports ={
...
plugins : [
new HtmlWebpackPlugin(),
new HtmlWebpackC5ThemePlugin(pluginOptions, HtmlWebpackPlugin)
]
...
}
```
`pluginOptions` can be either a string representing a theme name or a configuration object
`HtmlWebpackPlugin` does not need to be passed but sometimes when dealing with multiple installations of the html-webpack-plugin, assets may not be correctly passed
## Configuration
Configuration options for this plugin are as follows
```js
const c5Options = {
packageHandle: null, // set to null unless you want to add theme to a package.
themeHandle: "c5_theme", // The theme handle of the theme. This will be used in page_theme.php for namespacing.
themeName: "Concrete5 Theme", // The theme name of the outputted files. This will be will be used in page_theme.php.
themeDescription: "A nice description", // Enter a description about the theme. This will be used in page_theme.php.
skipIndex: false, // Set to true if you dont want to process index.html as a php file. Useful if your index.html is just links.
defaultPage: "index.html", // This is the page that will be used for generating default.php.
deleteHtml: false, // This will delete html files after generating php.
};
```
## Defining an area
To define a concrete 5 area in your files
just put the following html tag
```html
```
### Make an area global
```html
```
### Disable Editing Controls
```html
```
## Defining an element
To define an element area just use html5 comment tags like this replace `Element Name` with what you want the element to be called
```html
```
This will be placed into a file under 'theme_name/elements/element_name.php'
The element file would contain the following
```php
display($c);
?>
```
The main html file will be outputted like this
```php
...
inc('elements/element_name');?>
...
```