Searching tags #34

Closed
andhapp opened this Issue May 7, 2009 · 8 comments

Projects

None yet

8 participants

@andhapp
andhapp commented May 7, 2009

I have been thinking to use the simplicity of Jekyll as a sort of a wiki. Many a times we come across the same problem over and over again and it would be good if it is documented somewhere. For example: How do I add new users to CentOS in a certain group? So I will assign my post some tags, let's say: linux, administration...and so on.

The problem arises when I want to search for certain tags let us say "linux" from 300 or so posts I have got. So, I was thinking if we append the tags to the end of the file name like: "2008-10-18-foo-bar-tag-ruby-nuby.textile" and get javascript to filter the links on the page.

@tomjack
tomjack commented May 7, 2009

For searching on one tag it seems like we could just generate tag indexes. E.g. for every tag you use, generate _site/tags/[tag]/index.html from some tag layout file.

But if you want to be able to go to /tags/linux/administration to get everything with both tags, then things could get crazy. When you have a post with 5 tags you'd have to generate 120 separate tag indexes, for that post's tags alone. For that many the space required isn't so bad, but I'm not sure how much it would slow jekyll down. If you have 7 or more tags on a post it starts to get ridiculous.

@henrik
henrik commented May 7, 2009

Tag index pages or a single page listing tags (like http://henrik.nyh.se/tag ) could work. If someone needs to find tag1+tag2, I'd suggest going with a single page and then using JavaScript to e.g. make /tag#tag1+tag2 do something clever.

@andhapp
andhapp commented May 8, 2009

@henrik - yeah it would work on just a single page or may be I should abandon this whole idea and just go and use wiki.

@qrush
qrush commented Jan 1, 2013

👍 on not using Jekyll if you need search built in. Jekyll's job is slightly dynamic site generation, that's it.

@qrush qrush closed this Jan 1, 2013
@kevinSuttle

So search isn't something that's being considered?

@mattr-
Member
mattr- commented Jan 4, 2013

That is correct. If search is a hard requirement for what you're doing,
Jekyll is not the right tool for the job.

@parkr
Member
parkr commented Jan 4, 2013

Write a plugin which outputs a list of your tags and the associated posts and write a sinatra server which responds to /search and just parses through that list output by the jekyll plugin. An idea.

@ixti
Member
ixti commented Jan 4, 2013

The easiest way is to use plugin that generates posts listing by tags. You can use mine (see it in action: http://ixti.net/tags/ruby.html).

Alternatively, if you want kind of "real" search, you can generate a JS file with post => tags mapping and then write a search tool in JS. To write such dynamic JS, you can use jekyll-assets plugin.

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