1.0.0 • Published 10 years ago

jumblr v1.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
10 years ago

Jade Tumblr Mixins

Installation

Usage

include the jumblr.jade at the top of your main jade file:

include node_modules/jumblr/lib/jumblr

Mixins

+jumblr(type) - Standard Tumblr block

+jumblr('Video')
  li(class="post video")
    {Video-500}
    +jumblr('Caption')
      div(class="caption") {Caption}

//- output
{block:Video}
<li class="post video">{Video-500}{block:Caption}
  <div class="caption">{Caption}</div>{/block:Caption}
</li>{/block:Video}

+jumblrStr(type, content) - Standard Tumblr block as string (Great for nesting tags)

+jumblrStr('IndexPage', 'optional-class ')
section(class= jumblrStr)

//- output
<section class="{block:IndexPage}optional-class {/block:IndexPage}"></section>

+jumblrStrList({type: content, type: content}) - Standard Tumblr block list as string (Great for concatenating tags)

+jumblrStr("NoSearchResults", "no-results ")
+jumblrStrList({"TagPage": "tag ", "SearchPage": "search "+jumblrStr})
+jumblrStrList({"IndexPage": "index "+jumblrStrList, "PermalinkPage": "permalink "})

body(class= jumblrStrList)

//- output
<body class="{block:IndexPage}index {block:TagPage}tag {/block:TagPage}{block:SearchPage}search {block:NoSearchResults}no-results {/block:NoSearchResults}{/block:SearchPage}{/block:IndexPage}{block:PermalinkPage}permalink {/block:PermalinkPage}"></body>

+jumblrVar(type, preWhitespace) - Standard Tumblr variable (Great for removing "missing space" error)

p
  +jumblrVar('Scallywag')
  | : Oh
  +jumblrVar('Caption', true)
    |  my Captain

//- output
<p>{Scallywag}: Oh {Caption} my Captain</p>

License

MIT

1.0.0

10 years ago

0.1.2

10 years ago

0.1.1

11 years ago

0.1.0

11 years ago

0.0.5

11 years ago

0.0.4

11 years ago

0.0.3

11 years ago

0.0.2

11 years ago

0.0.1

11 years ago