GithubHelp home page GithubHelp logo

nicholasbracey / ca-frontend-renders Goto Github PK

View Code? Open in Web Editor NEW

This project forked from amplience/ca-frontend-renders

0.0 1.0 0.0 254 KB

Starting point for implementing frontend modules from Amplience Content Authoring app.

License: Other

JavaScript 20.89% HTML 70.72% CSS 8.39%

ca-frontend-renders's Introduction

Amplience Content Authoring

Content Authoring Accelerators

This repository is intended as an accelerated starting point for implementing Amplience Content Authoring; it contains commonly used content types and the front end render templates required to display them.

Table of Contents

Quick Start

# Install dependencies 
$ npm install

# Build project
$ gulp

Open page with desired render, e.g. localhost:9100/dist/renders/image/index.html

Demo

http://demo.amplience.com/cademo/homepage/

Content Packages

Commonly used content types have been split up into separate packages. Individual packages can be found in src/renders, here you can edit any render templates or styling prior to running a build. You will also find everything necessary to set up the content types within your Amplience account and to display the resulting content. Each package has its own readme which will walk you through the necessary steps.

Generated Builds

Built renders are located in dist/renders folder. Here you can find unminified and minified css, uncompiled and precompiled handlebars templates, JSON content types for the Content Authoring app, README's, and the visualisation html page. The libs folder contains js dependencies for the render. Most of the files in the libs folder are taken from the dist/reusable folder, described below.

Dependencies

All JS dependencies for renders can be found in the dist/reusable folder. JS dependencies are composed of helper scripts and 3d party libs.

Helper scripts

Helper scripts can be found in src/reusable/js folder. Below is the list of scripts and their description:

  • renderTypes.js contains ID's for all Content types, and can be found in the Content Authoring app. This file is needed when one render is composed of several others nested within it.
  • utils.js is needed to make AJAX requests to retrieve render data. It also has several methods to troubleshoot the renders.
  • hanldebars_helpers.js is used to declare various handlebars helpers, to solve different tasks for handlebars templates.

3rd-party libs

All 3d-party libs are pulled as npm dependencies and can be found in package.json

  • handlebars.min.js is the handlebars templates library.
  • cms-javascript-sdk.min.js is used to format the requested JSON content. Example usage:
amp.inlineContent(JSON.parse(data));
  • showdown.min.js is used to parse text with markdown and convert it into semantic html.
  • lory.js is a slider library and is used for slider renders.

Building minified and concatenated files

# Install dependencies 
$ npm install

# Build minified project
$ gulp buildAllMin

This will build minified and concatenated files for all renders.

Usage

Development

Want to contribute? Great! To fix a bug or enhance an existing module, follow these steps:

  • Fork the repo
  • Create a new branch on your fork (git checkout -b feature/improve-feature)
  • Make the appropriate changes in the files
  • Add changes to reflect the changes made
  • Commit your changes (git commit -am 'Improve feature')
  • Push to the branch (git push origin improve-feature)
  • Create a Pull Request to the develop branch

Tests

$ npm run test

Bug / Feature Request

If you find a bug, kindly open an issue here by including your steps to reproduce and the expected result. If you’d like to request a new function, feel free to do so by opening an issue here

ca-frontend-renders's People

Contributors

tylik1 avatar ncooper-amp avatar

Watchers

Nick Bracey 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.