Skip to content

Conversation

@nezoomie
Copy link

@nezoomie nezoomie commented Oct 1, 2013

Allows indexPagePath to be a string or an array:

indexPagePath: ["tags", "en/tags", "de/tags", "it/tags"]

This allows the generation of multiple, filtered localized tags pages using some logic in the tags' layout.

@rantecki
Copy link
Owner

rantecki commented Oct 2, 2013

Hi there. Interesting change. Having multiple tag index pages may have some implications for @getTagUrl() though (and consequently the tag cloud) as there are now multiple options. It looks as though @getTagUrl() will currently only return the index page from the first path in the list, and there is currently no mechanism to support finding the other pages. Perhaps additional optional query parameters could be passed to @getTagUrl()? What do you think?

@nezoomie
Copy link
Author

nezoomie commented Oct 2, 2013

good point. I think we can go a better way then. What do you think about:

  indexPagePath: 'tags',
  basePath: 'blog/',    // optional. Defaults to '/'
  context: ['en','de','it']     // string or array. Root context included by default

then using an optional context query:

  @getTagUrl({context: 'en'})

I'd throw in another problem which I'm currently facing, the tagCloud. Usign contexts, that may be solved all together using metadata:

---
title: 'My blog post'

tagsContext:
  - en

tags:
  - some
  - tags
---

then:

  @getTagCloud({context: 'en'})

as it comes almost for free, I'd support context to be an array as well:

  @getTagUrl({context: ['en','de']})
  @getTagCloud({context: ['en','de','it']})

additionally allows context query for tagCloud and getTagurl
@nezoomie
Copy link
Author

nezoomie commented Oct 7, 2013

Applied some changes.

  • Dropped the basePath idea (didn't see the need for it)
  • Dropped multiple indexPagePath in favor of an optional context array:
 {
    indexPagePath: 'blog/tags',
    context: ['en','de']
  }
  • A context array can be specified in the document. If not available, the document will be available for context-less queries only
  • @getTagUrl() now takes an optional context query:

@getTagUrl('news', context: 'en')

  • @getTagCloud now takes an optional context query. Count and weighting are relative to the context:

@getTagCloud(context: 'en')

@rantecki
Copy link
Owner

rantecki commented Oct 7, 2013

Looks pretty good, thanks. Will review and merge in a couple of days. I'm a bit slammed at the moment!

@rantecki
Copy link
Owner

rantecki commented Nov 7, 2013

Just letting you know I haven't forgotten about this. I went to write some tests a while ago to cover the additional functionality, but I ran into some problems. Will look into it again in the next couple of days hopefully.

@nezoomie
Copy link
Author

nezoomie commented Nov 7, 2013

no problem 👍

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants