An open API service indexing awesome lists of open source software.

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.

Awesome Lists containing this project

README

          

# Html-Webpack-C5-Theme-Plugin

![Tests](https://github.com/deek87/html-webpack-c5-theme-plugin/workflows/Tests/badge.svg?branch=master) ![Build](https://github.com/deek87/html-webpack-c5-theme-plugin/workflows/Build/badge.svg?branch=master)

## 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');?>

...
```