{"action":"created","issue":{"url":"https://api.github.com/repos/assemble/assemble-permalinks/issues/9","repository_url":"https://api.github.com/repos/assemble/assemble-permalinks","labels_url":"https://api.github.com/repos/assemble/assemble-permalinks/issues/9/labels{/name}","comments_url":"https://api.github.com/repos/assemble/assemble-permalinks/issues/9/comments","events_url":"https://api.github.com/repos/assemble/assemble-permalinks/issues/9/events","html_url":"https://github.com/assemble/assemble-permalinks/issues/9","id":174770211,"number":9,"title":"Permalinks not rendering pages added using glob or filename","user":{"login":"markdorrill","id":6216178,"avatar_url":"https://avatars.githubusercontent.com/u/6216178?v=3","gravatar_id":"","url":"https://api.github.com/users/markdorrill","html_url":"https://github.com/markdorrill","followers_url":"https://api.github.com/users/markdorrill/followers","following_url":"https://api.github.com/users/markdorrill/following{/other_user}","gists_url":"https://api.github.com/users/markdorrill/gists{/gist_id}","starred_url":"https://api.github.com/users/markdorrill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/markdorrill/subscriptions","organizations_url":"https://api.github.com/users/markdorrill/orgs","repos_url":"https://api.github.com/users/markdorrill/repos","events_url":"https://api.github.com/users/markdorrill/events{/privacy}","received_events_url":"https://api.github.com/users/markdorrill/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-09-02T14:15:56Z","updated_at":"2016-09-02T18:24:17Z","closed_at":null,"body":"Hi, \r\n\r\nI've been learning assemble all week (previously knowing the grunt version), it really looks like powerful set of tools. \r\n\r\nI've just been attempting to get a basic site outline set using the blog example from the main assemble repo. My aim is to use and this and submit a pr of a working example for other beginners.\r\n\r\n**The possible bug**: It looks like pages are not rendering with permalinks when they have been added to a collection using a glob or single filename.\r\n\r\nAlso; what is the method to define new permanlink variables as :site.base returns a Failed to read error?\r\n\r\nHere is my assemblefile that outlines a scenario to demonstrate this:\r\n\r\n```\r\n'use strict';\r\n\r\nvar path = require('path');\r\nvar extname = require('gulp-extname');\r\nvar permalinks = require('assemble-permalinks');\r\nvar getDest = require('view-get-dest');\r\nvar assemble = require('assemble');\r\nvar app = assemble();\r\n\r\n/**\r\n * Plugins\r\n */\r\n\r\napp.use(getDest());\r\napp.use(permalinks());\r\n\r\napp.data({\r\n  site: {\r\n    base: 'setfromdata'\r\n  }\r\n});\r\n\r\n/**\r\n * Create views collection for our site pages and blog posts.\r\n * Posts will be written in markdown.\r\n */\r\n\r\napp.create('pages');\r\napp.create('posts', {\r\n  pager: true,\r\n  renameKey: function(key, view) {\r\n    return view ? view.basename : path.basename(key);\r\n  }\r\n});\r\n\r\n// add a page\r\n\r\n\r\n/**\r\n * Register a handlebars helper for processing markdown.\r\n * This could also be done with a gulp plugin, or a\r\n * middleware, but helpers are really easy and provide\r\n * the most control.\r\n */\r\n\r\napp.helper('markdown', require('helper-markdown'));\r\napp.helper('link-to', require('helper-link-to'));\r\n//app.helper('helper-not', require('assemble-helper-not'));\r\n\r\napp.helper('log', function(val) {\r\n  console.log(val);\r\n});\r\n\r\n/**\r\n * Tasks for loading and rendering our templates\r\n */\r\n\r\napp.task('load', function(cb) {\r\n  console.log('hello from load');\r\n  \r\n  app.page('thisis.md', {content: '...'}); // permalinks - works\r\n  app.page('home.md', {content: '...'}); // permalinks - works\r\n  \r\n  app.page('src/templates/pages/blog.hbs'); // permalinks - not working\r\n  \r\n  app.partials('src/templates/includes/*.hbs'); // permalinks - not working\r\n  app.layouts('src/templates/layouts/*.hbs'); // permalinks - not working\r\n  app.pages('src/templates/pages/*.hbs'); // permalinks - not working\r\n  app.posts('src/content/*.md'); // permalinks - working ** but rendering outside the dest folder **\r\n  cb();\r\n});\r\n\r\n/**\r\n * Default task\r\n */\r\n\r\napp.task('default', ['load'], function() {\r\n  \r\n  return app.toStream('pages')\r\n    .pipe(app.toStream('posts'))\r\n    .on('error', console.log)\r\n    .pipe(app.renderFile('md'))\r\n    .on('error', console.log)\r\n    .pipe(extname())\r\n    .pipe(app.permalink(app.data('site.base') + '/site/:name.html'))\r\n    //.pipe(app.permalink(app.data(':site.base/site/:name.html'))) // Failed to read: :site.base/site/:name.html\r\n    .pipe(app.dest('dest-example'));\r\n    /*\r\n    .pipe(app.dest(function(file) {\r\n      file.path = file.data.permalink;\r\n      file.base = path.dirname(file.path);\r\n      return file.base;\r\n    }));*/\r\n});\r\n\r\n/**\r\n * Expose your instance of assemble to the CLI\r\n */\r\n\r\nmodule.exports = app;\r\n\r\n```"},"comment":{"url":"https://api.github.com/repos/assemble/assemble-permalinks/issues/comments/244451919","html_url":"https://github.com/assemble/assemble-permalinks/issues/9#issuecomment-244451919","issue_url":"https://api.github.com/repos/assemble/assemble-permalinks/issues/9","id":244451919,"user":{"login":"markdorrill","id":6216178,"avatar_url":"https://avatars.githubusercontent.com/u/6216178?v=3","gravatar_id":"","url":"https://api.github.com/users/markdorrill","html_url":"https://github.com/markdorrill","followers_url":"https://api.github.com/users/markdorrill/followers","following_url":"https://api.github.com/users/markdorrill/following{/other_user}","gists_url":"https://api.github.com/users/markdorrill/gists{/gist_id}","starred_url":"https://api.github.com/users/markdorrill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/markdorrill/subscriptions","organizations_url":"https://api.github.com/users/markdorrill/orgs","repos_url":"https://api.github.com/users/markdorrill/repos","events_url":"https://api.github.com/users/markdorrill/events{/privacy}","received_events_url":"https://api.github.com/users/markdorrill/received_events","type":"User","site_admin":false},"created_at":"2016-09-02T18:24:17Z","updated_at":"2016-09-02T18:24:17Z","body":"UPDATE: I took another look and everything is being rendered, just in 3 different locations I didn't notice\r\n\r\npages added by object in assemblefile: dest (desired location)\r\nglob added posts ../../ from dest\r\nglob added pages ../../../ from dest\r\n\r\nlooks like its something to do with paths that I don't understand."}}
{"actor":{"display_login":"markdorrill"}}