New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow index files to ignore permalink structure #20
Comments
@joshfry how so? What does your config look like? |
Here's my assemble task: assemble: {
options: {
data: 'src/templates/data/**/*.{json,yml}',
assets: 'dist/assets',
helpers: 'src/templates/helpers/*.js',
layoutdir: 'src/templates/layouts',
layout: 'default.hbs',
partials: ['src/templates/partials/*.hbs'],
plugins: ['permalinks'],
permalinks: {
structure: ':basename/index.html'
}
},
pages: {
files: [
{
expand: true,
flatten: true,
cwd: 'src/templates/pages',
src: ['**/*.hbs'],
dest: 'dist/'
}
]
},
} This is the output from the shell:
My issue is that since the |
ah! got it. that makes sense. let me see what I can come up with |
@joshfry let me know if this works out for you. |
@jonschlinkert I tested it out tonight and it worked as expected. Unfortunately, {{assets}} didn't work right and all the pages following the permalink structure had broken style, script and image links. I'll re-test at work tomorrow and post specific examples of issues. |
bah, I forgot to test for that. I'l re-open until this is fixed properly |
@jonschlinkert the asset links are still not being updated. I installed permalinks from npm, then replaced The index files' {{asset}} links no longer work, either. The output directory is being added to the urls, like this: index page Inside page, one level deep ( |
I'll need more info about your setup to debug. The tests work fine, and it's working fine on my setup. Perhaps if you looked at the gruntfile for this repo to see how I'm doing it, and how the templates are setup, so you can explain what we're doing differently to yield different results... |
@jonschlinkert, If you look at my sample assemble task above, the link to assets is Amazing work @jonschlinkert and @doowb! I'm tickled pink. |
Great! I'm glad it worked, but it shouldn't matter what directory the I'm going to leave this open until we get this 100% fixed, thanks for hanging in there. @doowb any ideas here? you're much more familiar with when/how the path is calculated. |
looking at the code, it looks like the assets are only re-calculated if the page is an "index" page. There should be something at the bottom of the plugin to re-calculate the assets after the new I can see if I can do something. |
that would be great, thanks. |
Check out my PR #26 . It works for all the test cases now (the |
@doowb: perfect. I changed the |
👍 nice! happy to hear it! |
@jonschlinkert @doowb, I noticed something that may require opening this issue again (unless I'm doing something wrong). Ignoring all files named My goal is to get assemble to generate a site with pages, blog posts and an index page with a list of blog posts. Here's how I currently have
Notice that Assemble task (I stripped out non-issue parts)
Let me know if you need any more clarification. |
Isn't this more of a matter of preference? I'm currently building my personal blog and I have "posts" going to |
@jonschlinkert, do you have the source for your blog on github? Maybe I'm going about it all wrong.. If I can see how you're doing it, a light bulb may go on in my head. |
ignore that last comment. how could index files in two different dirs overwrite each other? Based on what you described, each target should be able to have an |
I'll try to get it pushed up in the next day or two. I'm working on getting the init task updated too. I'll keep working with you on this until we get it figured out |
Here's the ouput from grunt for my 2 tasks:
See how when |
ah, well if that's the case this is a bug. @doowb do you want to look at this? this sounds like a calculation error |
@joshfry I think if you want both index files, they'll have to be in different dest folders, so you should be able to change your configuration for the posts: {
options: {
permalinks: {
structure: ':title/index.html'
}
},
files: [
{
expand: true,
cwd: 'assemble/posts',
src: ['**/*.hbs'],
dest: 'dist/articles/'
}
]
} |
@doowb that is exactly what I had in my first post, but then I thought I was missing something. I think that's right |
Thats it! THANK YOU @doowb and @jonschlinkert. Especially thank you for your quick responses.. It was my error. |
So this issue was originally created to "ignore" files called .... okay you replied while I was typing, so I'm not going to suggest my other idea because I think it just makes it look like it's doing more magic 😉 |
I can't resist a The Office quote.. "I love inside jokes... I'd love to be apart of one someday." - Michael Scott |
lol... I forgot about that. |
@joshfry lol great quote, my wife and I love that show |
Using the permalinks plugin breaks index pages by putting them inside new directories named index. So for example, the site's homepage is no longer accessible unless you point to
/index
. Can there be a way to allow index files to ignore the permalink structure?The text was updated successfully, but these errors were encountered: