GithubHelp home page GithubHelp logo

bhanditz / grav-plugin-webcomponents Goto Github PK

View Code? Open in Web Editor NEW

This project forked from elmsln/grav-plugin-webcomponents

0.0 2.0 0.0 41 KB

Webcomponents autoloader with built in support for Polymer.

License: Apache License 2.0

JavaScript 2.31% HTML 1.76% PHP 95.93%

grav-plugin-webcomponents's Introduction

Grav Webcomponents Plugin

Webcomponents is a Grav plugin that can be used to get webcomponents integrated into your Grav site with ease. Simply drop your webcomponents into user/webcomponents (unpacked from node_modules).

Installation

GPM Installation (Preferred)

The simplest way to install this plugin is via the Grav Package Manager (GPM). From the root of your Grav install type:

bin/gpm install webcomponents

Manual Installation

If for some reason you can't use GPM you can manually install this plugin. Download the zip version of this repository and unzip it under /your/site/grav/user/plugins. Then, rename the folder to webcomponents.

You should now have all the plugin files under:

`/your/site/grav/user/plugins/webcomponents`

Getting dependencies

You need polymer cli (not polymer but the CLI library) in order to interface with web components in grav. Get polymer cli installed prior to usage of this (and (yarn)[https://yarnpkg.com/lang/en/docs/install/#mac-stable] / an npm client of some kind)

$ yarn global add polymer-cli
# or...
$ npm install -g polymer-cli

Perform this on your computer locally, this doesn't have to be installed on your server.

Usage

Find the CopyThisStuff directory in /your/site/grav/user/plugins/webcomponents and copy the files in there over to /your/site/grav/user/data/webcomponents.

Then run the following (from the directory you copied it over to) in order to get dependencies:

$ yarn install
# or...
$ npm install

Now run polymer build and you'll have files in build/ which contain everything you'll need to get wired up to web components in your grav site. Modifying build.js or package.json can be used in order to get new elements and have them be implemented.

Shouldn't I put web components in my theme?

We don't think so. While it may seem counter intuitive, the theme layer should be effectively implementing what Grav is saying is available. If you think of standard HTML tags are being part of this (p, div, a, etc) then it makes a bit more sense. You don't want functional HTML components to ONLY be supplied if your theme is there, you want your theme to implement and leverage the components.

New to web components?

We built our own tooling to take the guess work out of creating, publishing and testing web components for HAX and other projects. We highly recommend you use this tooling though it's not required:

Fell in love with web components? Starting to say "hmm why do I need Grav again?" Yeah, we did too so that's why we built HAXCMS -- https://github.com/elmsln/haxcms. HAXCMS isn't as powerful on the backend as GravCMS but it does everything in the front-end by design and is a good complement to GravCMS for smaller scale brochure sites when Grav is still too much.

grav-plugin-webcomponents's People

Contributors

btopro avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.