Git Product home page Git Product logo

kirbytag-codepen's Introduction

CodePen extension for Kirby 2 (fork of Kirbytext CodePen tag by ClementRoy)

This extension for Kirby 2 enables you to easily embed CodePen ‘Pens’ into your sites pages.

Your content can be made with Kirby and ❤ and CodePen!

(codepen: http://codepen.io/chriscoyier/pen/oqHlh/)

Kirby 2 allows Kirbytext (Kirbys custom implementation of Mark Down) to be extended with custom ‘Kirbytags’. More about Kirbytags.

Sorry, not backwards compatible with Kirby 1. Kirbytext CodePen tag by ClementRoy is compatible. Kirby 3 compatible version is Kirby 3 CodePen embed by Texnixe

Installation

Place codepen.php in your /site/tags/ folder, or create a ‘tags’ folder inside your site folder if one is not there.

Usage

Now in your content text files you can now use the new codepen tag:

(codepen: http://codepen.io/chriscoyier/pen/oqHlh/)

This will embed the specified Pen using a default height and styled with the standard CodePen embed theme.

Parameters

You can supply additional parameters in the tag to override the height (500 = 500px height embed) or type (html, css result displayed).

(codepen: http://codepen.io/chriscoyier/pen/oqHlh/ height: 250 type: html)

You can specify an additional class which will apply to the CodePen iframe.

(codepen: http://codepen.io/chriscoyier/pen/oqHlh/ class: picked-pen)

This should be considered for adding custom styles to specific Pens. To apply a theme to all Pens, see next section.

Default Theme

This is a more advanced option and not essential, CodePen embeds will use the default CodePen theme style by default. Changing the default theme requires editing codepen.php file directly

If you are a CodePen user, pen themes enable you to create a theme style for your embedded Pens.

You can find your Theme ID in the standard embed code from the ‘Share’ option in any Pen. Look for the data-theme-id value.

To change from the default CodePen theme to your personal embed theme, open site/tags/codepen.php and edit the $theme = ''; value, to your theme (data-theme-id) value.

Note: Amending this value will change the theme of ALL your CodePen embeds using this Kirby extension.

Override Attributes

These are optional and require manual coding for finer control for your pages embeds.

There is a list of embed override attributes on the CodePen site which can toggle additional embed functionality.


Update Updated to include new support for CodePen iframe classes see Parameters section or read about the class feature.

Update 2 Kirby 3 compatible version is kirby3-codepen by Texnixe.

kirbytag-codepen's People

Contributors

plfstr avatar

Stargazers

inkplug avatar Ian Cox avatar

Watchers

James Cloos avatar  avatar  avatar

kirbytag-codepen's Issues

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.