GithubHelp home page GithubHelp logo

wintersmith-jade's Introduction

wintersmith-jade

A plugin to enable jade to be used as a content page (not just a template).

Looking for maintainers

I'm no longer able to look after this package, as well as it deservers. If anyone is interested in taking it over, please let me know! Open an issue on this repository, and we'll go from there!

Usage

Create a .jade file in your content directory. Wintersmith would usually ignore those without this plugin. With the wintersmith-jade plugin, Wintersmith will now pick up those as content and render the Jade as HTML like any other plugin.

To provide Wintersmith with metadata, use the following as a formatting example.

---
title: 'Title'
subtitle: 'Subtitle'
date: '2013/10/12'
teaser: 'Here is a sample teaser.'
template: 'standard.jade'
---

p Content here.

wintersmith-jade's People

Contributors

smebberson avatar jnordberg avatar bensleveritt avatar dagoss avatar soheilpro avatar

Stargazers

 avatar  avatar Jesse Stiller avatar Jo Meenen avatar Zeno Jiricek avatar Kelly Hallman avatar Mimi Flynn avatar  avatar

Watchers

Zeno Jiricek avatar  avatar James Cloos avatar  avatar

wintersmith-jade's Issues

The contents and locals objects are not available to jade content

The contents and locals objects are not available to jade content files like they are to jade templates. For example, the following is undefined when it appears in content.

p #{locals.title}

This happens in the contents tree too. The following also can't be resolved.

img(src=contents.images['logo.svg'].url)

Note: I know this project isn't really active at the moment; just wanted to make sure this got documented somewhere in case myself/someone else has the time to clean up some of these issues :)

Submit to NPM?

It'd be great to have this in NPM, this plugin is great.

Use jade-var-matter to get Jade variables as metadata

The jade-var-matter package for parsing a Jade string for Jade-style vars and providing that data back to the application.

Using YAML frontmatter in Jade feels a bit hacky since Jade has its own variable mechanism.

I think it would be ideal to be able to do something like this:

- var title = "My Page Title"
- var layout = "default.layout"

p Here is my content...

I poked around with wintersmith-jade, but it wasn't entirely clear to me how to work this in. This plugin is using Wintersmith's default markdown plugin to parse out metadata and get content. I'm not familiar with Coffeescript enough to actually get it working, but I think the solution is to check if result.metadata is empty, and then try using jade-var-matter to parse result.markdown (sic) and putting that into result.metadata.

I wasn't sure how to get that working in the async waterfall. Figure I'll open this issue and maybe someone smarter than me will see this and be able to help :)

Usage outline

Great idea for a plugin, but I can't seem to get it working (probably through not understanding how it works).

What would be great would be a little example of usage, I can't seem to find any reference to how the .jade files should be laid out (metadata etc.).

The filename metadata is being ignored

Using frontmatter like this:

---
filename: '/some/path/index.html'
---

rr defining filenameTemplate in the config.json seems to have no effect on the output. The property is ignored and output its source filename (e.g. contents/about.jade always outputs to /about.html, even if filename or filenameTemplate is set to something else).

I think the problem is here:

opts = {filename: filepath.full}
env.utils.extend opts, options
tpl = jade.compile result.markdown, opts

This does not happen using the default Wintersmith markdown plugin, so it doesn't appear to be an issue with Wintersmith.

Fails with wintersmith ~2.0.10

Both build and preview give the following error:
error Error loading plugin 'wintersmith-jade': Cannot find module './plugin'

Metadata Format

Using the format as specified by the README file (jade variables) does not work:

title = 'ηBits'
subtitle = 'etaBits Webs'
date = '2013/10/15'
teaser = 'etaBits is your ultimate online business partner, it helps your business whether it is internet-based or internet-promoted..'
template = 'index.jade'

Using the format from the example (.md metadata style), works:


---
title: 'within JADE'
template: index.jade

---

Please either update the code to use something other than MarkdownPage.extractMetadata, or revert the README file to show the right way, because the files won't render altogether using the new format.
Thanks for the useful plugin 👍

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.