GithubHelp home page GithubHelp logo

assemble / assemble Goto Github PK

View Code? Open in Web Editor NEW
4.2K 109.0 277.0 12.74 MB

Get the rocks out of your socks! Assemble makes you fast at web development! Used by thousands of projects for rapid prototyping, themes, scaffolds, boilerplates, e-books, UI components, API documentation, blogs, building websites/static site generator, an alternative to Jekyll for gh-pages and more! Gulp- and grunt-friendly.

Home Page: http://assemble.io/

License: MIT License

JavaScript 16.30% CSS 76.61% HTML 7.10%
build static-site static-site-generator templates scaffold generator nodejs javascript gulp grunt

assemble's People

Contributors

ain avatar arkkimaagi avatar asans avatar avr avatar bauerca avatar bendrucker avatar caseyg1204 avatar criticalmash avatar doowb avatar efender avatar enavarrocu avatar frayer avatar jonschlinkert avatar jordanthomas avatar klokie avatar mootari avatar onokumus avatar rauberdaniel avatar rbecheras avatar robloach avatar scmorrison avatar stefanwalther avatar stevenblack avatar thegreatsunra avatar thom4parisot avatar tylerhowarth avatar xzyfer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

assemble's Issues

add support for markdown files

In particular, github flavored markdown would be best, since github seems to have the most active and rich version of markdown.

process handlebars templates in yaml front matter

This will allow partials and handlebars tags to be more flexible and DRY. The page title is a good example:

<h1>{{page.title}}</h1>

For which the yaml front matter is:

---
page:
  title: Hi! I'm the page title!

---

Now, if you are visiting a theme, you might want the name of the theme to be the page title, so you could change the template on every page, like this:

<h1>{{theme.name}}</h1>

and this:

---
page:
  title: 
theme:
  name: Bootstrap

---

But a better way to do it is to keep the template the same, like this:

<h1>{{page.title}}</h1>

and process templates in yaml front matter like this:

---
page:
  title: {{theme.name}}
theme:
  name: Bootstrap

---

split out yaml pre-preprocessor

The yaml front-matter shouldn't require a specific template engine. Split that out to make it default to use in all assemble builds.

Page level layout specification

channeling @doowb

"Adding ability to specify the layout template from within the page yaml front-matter. Also able to use underscore templates to expand config values from within grunt"

only require path for layouts

After trying out several different project configurations and trying to optimize build targets, I think this makes a lot more sense:

  • require only path to layouts folder. it would probably be better to have the path to the layouts folder set in paths.json or as a global option somewhere (config.json, defaults.json or whatever the file should be called). Then maybe allow user to override that with a custom path inside a grunt target or the config for a specific project
  • allow layout to be determined in yaml front matter, requiring only the name of the layout. for now, we can hard wire all layouts as .mustache files, so just the file name would suffice (if it's better to include ext I don't feel strongly about it):
---
layout: blog-post

---
  • allow overriding the layout specified in the yaml front matter with a layout specified in a page configuration, like this:

Example pages.json / scaffold.json (not sure what we should call that yet)

{
    "page": {
        "layout": "some-layout"
    }
}
  • allow empty value for layouts
---
layout: 

---

or

---

---

clean task for app folder

@doowb you should create a clean task to clean out the app folder, or any files that change names or move folders will leave junk behind

Empty tarball when installing from npm

I am trying to install assemble from npm:
npm install assemble --save-dev

but node_modules/assemble contains only README.md and package.json files

Also I tried to install it from git:
npm install git://github.com/sellside/assemble.git --save-dev
but get an error when I try grunt assemble, I get an error: Error: Cannot find module 'lodash'

So I installed lodash... than js-yaml, marked and highlight.js
Then it worked out!

automatically recognize/process nested json files for handlebars data

This is what I do today, using currency as an arbitrary example. I presently have the object currencies setup with an array of currencies in site.json like this:

// site.json
{
  "brand": "themestack",
  "currencies-enabled": true,
  "active-currency": "USD",
  "currencies": [
    {
      "ISO": "USD",
      "VAT": "",
      "modifier": ""
    },
    {
      "ISO": "CAD",
      "VAT": "",
      "modifier": ""
    },
    {
      "ISO": "EUR",
      "VAT": "",
      "modifier": ""
    }
  ]
}

And the data is used like this:

{{#if site.currencies-enabled}}
  <ul class="dropdown-menu">
    {{#each site.currencies}}
      {{> currencies }}
    {{/each}}
  </ul>
{{/if}}

If possible, I would like to externalize the array of currencies to another file, currencies.json, and have that automatically recognized by the compiler so that no changes are required in the handlebars templates. So markup and templates would stay the same, but the json would change to:

// site.json
{
  "brand": "themestack",
  "currencies-enabled": true,
  "active-currency": "USD",
  "currencies": "currencies.json"
}


// currencies.json
[
  {
    "ISO": "USD",
    "VAT": "",
    "modifier": ""
  },
  {
    "ISO": "CAD",
    "VAT": "",
    "modifier": ""
  },
  {
    "ISO": "EUR",
    "VAT": "",
    "modifier": ""
  }
]

Add support for...

IMPLEMENTED IN ASSEMBLE v0.6.0! Any engine can be registered like:

assemble.engine('swig', require('engine-swig');

Templating engines under consideration. Comments/feedback encouraged.

If you would like an engine added to the list, please make a comment on this issue so I can add it to the list for consideration.

add support for YAML to options.data property

YAML is more readable sometimes. would be nice for a user to be able to arbitrarily add .json or .{yaml,yml} files as needed.

options: {
     data: [ 'config/site.json', 'config/content.yml', 'src/data/grid.json' ]
}

nested layouts

Jekyll does this currently. The way it works is you can create a very simple layout that has only the head and body tags, for example. Other layouts will then use that layout as a base, but with additions such as a navbar, footer etc..

For example:

base-layout.hbs

<!DOCTYPE html>
<html lang="en">
  <head>
    <title>Document</title>
  </head>
  <body>
    {{> body }}
  </body>
</html>

kitchen-sink-layout.hbs

---
layout: base-layout.hbs

---
{{> navbar }}
{{> body }}

make all options available in options block

need to be able to set options for yaml, marked, handlebars directly in the assemble task. the native options of those plugins should be made available somehow. we can talk this through to come up with a tactful way of doing this

handlebars helper: paths (relative) to other referenced files

Useful if you have a static site and organize your pages into folders.

So, for example in the navbar on the index.html page, you would just add something like the following to the href attr for the link to the contact page:

{{assemble.path.relative}}/contact-us.html

and then the helper would would insert the correct path to that page, so you wouldn't even really need to think about where the other files are located, as long as the file names are unique.

Or, if you had two files with the same name you could do something like this:

{{assemble.path.relative}}/domains/search.html

and

{{assemble.path.relative}}/themes/search.html

so the helper would use the folder and the file name to reconstruct the path. In other words, in cases where you will have duplicate file names, you can add as many folders before the file name as you need for the file name to be recognized as unique. Make sense?

or it could be done with underscore

template inheritance

I think template inheritance should work like this:

  • "section" blocks are used to create the default content
  • "extend" blocks inherit "section" blocks

Layout: default.hbs

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>{{ title }}</title>
    </head>
    <body>

        {{#section "header"}}
          <div class="page-header">
            <h1>Welcome to our site!</h1>
          </div>
        {{/section}}

        {{> body }}

        {{#section "footer"}}
          <script src="assets/jquery.js"></script>
          <script src="assets/bootstrap.js"></script>
        {{/section}}

    </body>
</html>

Page: some-page.hbs

---
title: About Us
layout: default.hbs

---
{{#extend "header"}}
  <div class="page-header">
    <h1>{{ title }}</h1>
  </div>
{{/extend}}

<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>

{{#extend "footer"}}
  <script src="assets/jquery.js"></script>
  <script src="assets/bootstrap.js"></script>
  <script src="assets/other-script.js"></script>
{{/extend}}

Note also that the extend blocks don't have to be in any particular order. They could be like this:

---
title: About Us
layout: default.hbs

---

<!-- this content would go in the {{> body }} -->
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>

<!-- this content would replace the head section -->
{{#extend "header"}}
  <div class="page-header">
    <h1>{{ title }}</h1>
  </div>
{{/extend}}

<!-- this content would replace the footer section -->
{{#extend "footer"}}
  <script src="assets/jquery.js"></script>
  <script src="assets/bootstrap.js"></script>
  <script src="assets/other-script.js"></script>
{{/extend}}

Is the layout mandatory ?

In the doc I don't see that layout is required. But without it, I ran into an error:

Warning: EISDIR, illegal operation on a directory Use --force to continue.

Maybe a clearer error message ?

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.