Skip to content

Dynamic permalinks and WebC #27

Closed
Closed
@voxpelli

Description

@voxpelli

When using liquid I had a news.11tydata.json containing:

{
  "layout": "layouts/post",
  "tags": ["news"],
  "permalink": "{{ page.date | date: '%Y/%m' }}/{{ title | slug }}/index.html"
}

When using WebC I should instead be using WebC for that? Feels like a challenge? I would preferably use eg. liquid for my permalinks and only WebC for my actual HTML

You may use data variables here (and template syntax, too). These will be parsed with the current template’s rendering engine.

This plugin could provide a custom behavior by setting permalink in compilerOptions to a function or false:

compileOptions: {
cache: true,
getCacheKey: function(contents, inputPath) {
// if global components change, recompile!
return contents + inputPath + componentsMapKey;
}
},

I think it should done of:

  1. Have an example of a dynamic permalink in WebC
  2. Provide an alternative renderer for permalinks
  3. Disable permalink link rendering if its not feasible with WebC

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions