npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

html-webpack-c5-theme-plugin

v0.0.18

Published

c5 html-webpack-plugin to generate c5 theme files

Downloads

7

Readme

Html-Webpack-C5-Theme-Plugin

Tests Build

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

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

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

<c5-area name="C5 area"></c5-area>

Make an area global

<c5-area name="C5 area" global="true"></c5-area>

Disable Editing Controls

<c5-area name="C5 area" editable="false"></c5-area>

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

<div class="container">
  <!--C5 Begin Element Name-->
  <div class="sm-12 md-10">
    <c5-area name="Main"></c5-area>
  </div>
  <!--C5 End Element Name-->
</div>

This will be placed into a file under 'theme_name/elements/element_name.php'

The element file would contain the following

<?php
defined('C5_EXECUTE') or die('Access Denied.');
/* @var \Concrete\Core\Page\View\PageView $view */
$c = \Concrete\Core\Page\Page::getCurrentPage();?>
<div class="sm-12 md-10">
        <?php
        $area = new \Concrete\Area\Area('Main');
        $area->display($c);
        ?>
    </div>

The main html file will be outputted like this

...
<div class="container">
    <?php $view->inc('elements/element_name');?>
</div>
...