assemble / grunt-assemble-permalinks

Permalinks middleware for Assemble, the static site generator for Grunt.js and Yeoman. This plugin enables powerful and configurable URI replacement patterns, presets, uses Moment.js for parsing dates, and much more.
MIT License
43 stars 11 forks source link

Can't get permalinks to work #61

Open mikestecker opened 9 years ago

mikestecker commented 9 years ago

I can't seem to get permalink to work in any way.

I am trying to create a knowledgebase site that is split up into 4 sections, one for each of our products. Underneath each section, I'd like to use categories and articles would be organized into each category underneath a section.

All my articles are in Markdown.

My grunt options (coffeescript):

assemble:
  options:
    today: '<%= grunt.template.today() %>'
    production: false
    flatten: true
    contextual:
      dest: './temp'
    data: ['<%= config.src %>/data/*.{json,yml}', 'package.json']
    assets: '<%= config.dist %>/assets'
    helpers: [
      '<%= config.src %>/extensions/*.js'
      'helper-prettify'
    ]
    middleware: [
      'assemble-middleware-anchors'
      'assemble-middleware-contextual'
      'assemble-middleware-drafts'
      'assemble-middleware-permalinks'
      'assemble-middleware-sitemap'
      'assemble-middleware-toc'
    ]
    plugins: [ ]
    partials: [
      '<%= config.src %>/templates/includes/**/*.{hbs,md}'
    ]
    layoutdir: '<%= config.src %>/templates/layouts'
    layout: 'default.hbs'
    marked:
      sanitize: false
    prettify:
      indent: 2
      condense: true
      padcomments: true

  pages:
    files: [ {
      expand: true,
      cwd: '<%= config.src %>/templates/pages',
      src: ['*.hbs'],
      dest: '<%= config.dist %>/'
    } ]
  articles:
    permalinks:
      structure: ':section/:category/:basename/index:ext'
    files: [ {
      expand: true
      cwd: '<%= config.src %>/articles'
      src: ['**/*.hbs']
      dest: '<%= config.dist %>'
      ext: '.html'
    } ]

here is the markdown header:


---
title: Test Article
description: Lorem ipsum dolor sit amet, consectetur adipiscing elit.

section: My Product

categories:
- Test Category

tags:
- feature
- priority

---

my package.json:

  "devDependencies": {
    "assemble": "^0.6.0-beta.5",
    "assemble-middleware-anchors": "^0.2.4",
    "assemble-middleware-drafts": "^0.1.5",
    "assemble-middleware-lunr": "^0.2.1",
    "assemble-middleware-permalinks": "^0.5.2",
    "assemble-middleware-sitemap": "^0.2.5",
    "assemble-middleware-toc": "^0.2.3",
    "autoprefixer": "^5.2.0",
    "bower": "~1.4.1",
    "coffee-script": "~1.9.2",
    "grunt": "^0.4.5",
    "grunt-assemble": "^0.3.1",
    "grunt-autoprefixer": "^3.0.1",
    "grunt-bowercopy": "^1.2.0",
    "grunt-contrib-clean": "^0.6.0",
    "grunt-contrib-coffee": "~0.13.0",
    "grunt-contrib-concat": "^0.5.1",
    "grunt-contrib-connect": "^0.10.1",
    "grunt-contrib-copy": "^0.8.0",
    "grunt-contrib-sass": "~0.9.2",
    "grunt-contrib-watch": "~0.6.1",
    "grunt-dev-update": "^1.3.0",
    "grunt-gh-pages": "^0.10.0",
    "grunt-github-api": "^0.2.3",
    "grunt-markdown-to-json": "^0.4.2",
    "grunt-newer": "^1.1.0",
    "grunt-postcss": "^0.5.1",
    "grunt-sync-pkg": "^0.1.2",
    "grunt-verb": "^0.2.4",
    "handlebars-helper-md": "^0.2.0",
    "handlebars-helper-partial": "^0.2.0",
    "helper-prettify": "^0.1.7",
    "highlight.js": "^8.6.0",
    "jit-grunt": "^0.9.1",
    "js-prettify": "^1.4.0",
    "lodash": "^3.9.3",
    "matchdep": "^0.3.0",
    "permalinks": "^0.3.1",
    "resolve-dep": "^0.5.3",
    "time-grunt": "^1.0.0"
  },

I'm not sure what I'm missing. I've tried changing between the non-beta version of Assemble, the contrib versions of the permalinks plugin but nothing seems to work. It always renders my file in the root of my destination directory.

ALSO, if you look in my options above, you'll see that the plugins I have tried to install are all listed under the middleware section. I've tried putting them in the plugins area, but assemble hangs each time no matter what plugin is listed there.