Skip to content
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

[DRAFT] Add tags/categories/archives pages plugins #870

Closed
wants to merge 1 commit into from
Closed

[DRAFT] Add tags/categories/archives pages plugins #870

wants to merge 1 commit into from

Conversation

ixti
Copy link
Member

@ixti ixti commented Mar 17, 2013

This is a start discussion pull request (real one will be re-factored and recreated as a separate one).

These plugins adds "dynamically" generated pages for archives (list posts by years), tags and categories. Usage example can be found on my blog (https://github.com/ixti/ixti.github.com/):

Follows up of #867.

end


class Page
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It'd be sweet if you could modify lib/jekyll/page.rb with any modifications necessary.

@parkr
Copy link
Member

parkr commented May 13, 2013

I'd love to see these added into the jekyll core. Having tags and categories without a direct means of showing them (short of looping through site posts and printing those which match a hard-coded category or tag name) seems to point to a missing feature to me.

@mattr-, what do you think?

@mattr-
Copy link
Member

mattr- commented May 13, 2013

I think this is awesome! 👍 🎉

@mattr-
Copy link
Member

mattr- commented May 13, 2013

And obviously they don't need to be plugins anymore. 😃

@dragoon
Copy link

dragoon commented Jun 1, 2013

+1 for those pages, just one question, are your plugins somehow better than: https://github.com/recurser/jekyll-plugins ? How do they differ?

@dragoon
Copy link

dragoon commented Jun 1, 2013

The plugin does not work for me, returns error:

Generating... error: undefined method uses_relative_permalinks' for #<Jekyll:ArchivesPlugin:Page @year=2011>. Use --trace to view backtrace`

It seems that new Jekyll uses some method that plugin does not implement.

@ixti
Copy link
Member Author

ixti commented Jun 1, 2013

I don't know how they differ, they are just what I wrote for myself. This pull request is outdated of course, but it's just a draft (a stub if you will) so if general idea will be accepted - it will be completely refactored and new pull request will takeover this one. If you want to see these plugins working with current version of Jekyll grab them from my blog's sources directly: https://github.com/ixti/ixti.github.com/tree/source/_plugins

@dragoon
Copy link

dragoon commented Jun 2, 2013

Hi, thanks for the reply. Actually I have already tried to use plugins form your blog sources, and they did not work either.
I had to add the following function to the Page class to fix them. Don't know if it's correct or not since I'm not a ruby programmer, just want to set up my blog :)

  def uses_relative_permalinks
      url && @dir != "" && site.config['relative_permalinks']
  end

@ixti
Copy link
Member Author

ixti commented Jun 2, 2013

@dragoon Oops. Sorry. I've committed a fix about a month ago but forgot to push. Your variant will work as expected, but it's just not needed - those generators will never generate relative links, so in my commit I just stubbed uses_realtive_permalinks with false.

@ixti
Copy link
Member Author

ixti commented Jun 2, 2013

So, if overall "feeling" is quiet "we want it", I'll prepare more realistic pull request.
/cc @parkr @mattr-

@mattr-
Copy link
Member

mattr- commented Jun 3, 2013

I think both @parkr and I said that we wanted this. Get crackin' on that PR! 😃

@mattr- mattr- closed this Jun 3, 2013
@parkr
Copy link
Member

parkr commented Jun 3, 2013

I do think they should be opt-in, but yeah I'd love to see this in the core!

@ixti ixti deleted the feature-tags-pages branch June 3, 2013 16:21
@mayarichman
Copy link

What's the status of built-in tag support for Jekyll on Github?

I'm building a blog with multiple contributors who will primarily interact through Prose.io and cannot be building locally and pushing to Github every time they post something new. Tags are extremely important and useful for this site, but so far it only runs locally with plugins.

@mattr-
Copy link
Member

mattr- commented Jul 10, 2013

I'm afraid I'm a bit confused by your question. This pull request is about
adding archive pages for posts by year, tag, and/or category.

Jekyll supports tags for posts already. Tags are specified in the YAML
front matter for posts. You can find more info in the docs about
frontmatter
.

@mayarichman
Copy link

I thought Jekyll supported tags but Github Pages prevents the functionality that allows custom pages to be built for each tag because it disables custom plugins. See this blog post.

I thought this issue was about adding to the Jekyll core some basic tag pages functionality something.io/tag/ruby so when Github Pages upgraded Jekyll there would be built-in functionality for this.

@mattr-
Copy link
Member

mattr- commented Jul 10, 2013

That is exactly what this issue is about, yes. I thought you were talking
about tag functionality in general before. I'm sorry for misunderstanding
you. We're actually waiting on @ixti to submit what he thinks is the real
pull request for this.

On Wed, Jul 10, 2013 at 3:59 PM, Maya notifications@github.com wrote:

I thought Jekyll supported tags but Github Pages prevents the
functionality that allows custom pages to be built for each tag because it
disables custom plugins. See this blog posthttp://charliepark.org/tags-in-jekyll/
.

I thought this issue was about adding to the Jekyll core some basic tag
pages functionality something.io/tag/ruby so when Github Pages upgraded
Jekyll there would be built-in functionality for this.


Reply to this email directly or view it on GitHubhttps://github.com//pull/870#issuecomment-20772785
.

@mayarichman
Copy link

No problem, I am looking forward to the continued development of this, right now I am plotting some hackish solutions.

@ixti
Copy link
Member Author

ixti commented Jul 11, 2013

Sorry for delay. Will submit a pull request this weekend.

@mattr-
Copy link
Member

mattr- commented Jul 11, 2013

No worries. Don't rush yourself unnecessarily. 😃

On Wed, Jul 10, 2013 at 7:47 PM, Aleksey V. Zapparov
notifications@github.com wrote:

Sorry for delay. Will submit a pull request this weekend.

Reply to this email directly or view it on GitHub:
#870 (comment)

@ixti
Copy link
Member Author

ixti commented Aug 28, 2013

I don't know when I'll find time to finish this proposal, so if there anybody wish to overtake it - I'll be glad. Feel free to use code from proposed plugins if you'll find them useful.

@kelvinst
Copy link

Nice man, I'll take a look at to help on this when I finish my current PR... (=

@parkr
Copy link
Member

parkr commented Aug 14, 2014

If anyone watching this issue has the time or interest to create a category & page generator plugin, I'd love to take a look at it and possibly include it in core.

@alfredxing
Copy link
Member

I would be willing to work on this. I have a question though—what is the difference between a 'tag' and a 'category', and how should Jekyll distinguish between the two?

@kleinfreund
Copy link

I'm not sure if there is a definitive difference, but if I were to guess: Only one category applies to a post, but a post can have multiple tags.

@alfredxing
Copy link
Member

I guess I won't worry about it too much, since each Post object has a categories and a tags attribute. I'll just use those.

@kleinfreund
Copy link

What I said doesn't apply to Jekyll, of course. One post can indeed have multiple categories. But should it?

@alfredxing
Copy link
Member

Wouldn't make a lot of sense to have multiple categories for one post (that's what tags are for, after all), but it's probably not in the scope of this issue to decide that. I'm sure there's a solid rationale behind the original decision.

@alfredxing alfredxing mentioned this pull request Aug 15, 2014
4 tasks
@steelman
Copy link
Contributor

Categories are ordered and tags are not. Categories provide a tree like structure while tags link posts to a number of different ... sets.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

10 participants