**DEPRECATED & UNMAINTAINED** Partials and templates for use in Mozilla Foundation projects.
Перейти к файлу
Alan Mooiman 006e9ab1a6 Merge pull request #63 from alanmoo/fluid-containers
Use container-fluid to prevent horizontal scroll
2016-06-02 20:23:43 -04:00
scripts oops. only try to process scss that exists... 2016-03-22 16:15:36 -07:00
src Update resource-list template 2016-06-02 11:07:38 -04:00
.eslintrc.yaml refactoring preview js to pass eslint 2016-03-08 10:37:32 -08:00
.gitignore blow away previous built assets before kicking off a new build 2016-03-23 14:53:49 -07:00
.npmignore adding npm publishing hooks & scripts 2016-03-15 12:53:34 -07:00
.travis.yml adding sass linting 2016-03-03 11:37:35 -08:00
ISSUE_TEMPLATE.md issue template and license 2016-03-01 11:10:03 -08:00
LICENSE issue template and license 2016-03-01 11:10:03 -08:00
README.md revised docs 2016-03-24 15:55:48 -07:00
deploy.sh getting rid of redundant status file 2016-03-17 12:21:59 -07:00
package.json blow away previous built assets before kicking off a new build 2016-03-23 14:53:49 -07:00

README.md

Build Status

Mozmaker Templates

Partials and templates for the Mozilla Foundation's CMS driven projects.

http://mozilla.github.io/mozmaker-templates/demo/

Definitions & Best Practices

Partials should be very small snippets of HTML. They should rely extensively on Mozmaker for styling (ideally, completely). Partials are pulled into our fork of Calypso via a REST API and are available to users as a boilerplate for new simple pages or parts of more complex pages.

Templates are more complex arrangements of partials. They are intended as boilerplate for stand-alone pages and can contain regions not intended for content management. It's ok to have custom JavaScript and CSS accompany a template!

Setup for Development

  • git clone https://github.com/mozilla/mozmaker-templates.git && cd mozmaker-templates
  • npm i
  • npm start

File Structure

├── api <- Contains compiled code for the static REST API.
├── demo <- Contains compiled code for a live demo page.
├── dist <- More compiled code provided as a convenience for dependents.
├── scripts <- Code used by npm scripts.
└── src
    ├── app.js <- Code for running the template previewer.
    ├── index.html <- Shell for template previews.
    ├── style.css <- Style for template previews.
    └── partials
        ├── sample-partial
        │   ├── index.html <- Partial HTML
    └── templates
        ├── sample-template
        │   ├── images <- Any images used by the template
        │   ├── index.html <- Template HTML
        │   └── style.scss <- Template-specific SCSS

File Naming Conventions

  • All files should be named in hyphenated-lowercase

Relationship To Mozmaker

Mozmaker is a core dependency of these templates and partials, and is intended to be developed in tandem with them. When many templates need a common component, it's recommended that it be placed upstream in Mozmaker to reduce duplicated code.

If you want to co-develop Mozmaker locally and see changes reflected in this project, you can run npm link in the root of your Mozmaker repo and then npm link mozmaker in this repo. Once you've done this you should npm start Mozmaker and then you'll see your edits immediately reflected in the front end here.

REST API

This project contains a very basic REST API which is deployed as static JSON routes to GitHub Pages. This REST API is used in our fork of Calypso to retrieve partials and their associated HTML.

The service is available at:

http://mozilla.github.io/mozmaker-templates/api

Routes

  • GET /partials - Returns an array of partial IDs.
  • GET /partial/PARTIAL_ID - Returns an object containing the complete markup for the indicated partial.