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

linked-tags broken #292

Closed
eak24 opened this issue Dec 15, 2017 · 28 comments · Fixed by #307
Closed

linked-tags broken #292

eak24 opened this issue Dec 15, 2017 · 28 comments · Fixed by #307

Comments

@eak24
Copy link

eak24 commented Dec 15, 2017

The linked-tags functionality doesn't work. Jekyll doesn't make a tags folder within the _site directory when run locally and when linked_tags is set to true in _config.yml. To see this, just clone the local version of beautiful jekyll, turn on linked-tags, and run locally with jekyll serve and no tag pages are generated.

@eak24
Copy link
Author

eak24 commented Dec 15, 2017

I instead am using the Jekyll-category-pages plugin, which I think is a more modular way to get the same effect as the tags 'plugin'. I'm pulling out the tag plugin to remove cruft. I was not able to get it working, but I didn't spend much time on it.

@daattali
Copy link
Owner

Your post makes many references to "linked-tags". The parameter should be "link-tags" without "ed". Is that what you tried?

@eak24
Copy link
Author

eak24 commented Dec 16, 2017

Yes I set link-tags not linked. Thanks for the catch but that is not the problem.

@daattali
Copy link
Owner

I believe it was @epwalsh who added this tags feature, perhaps he has something useful to say about this?

@daattali
Copy link
Owner

daattali commented Jan 6, 2018

Going to try to summon @epwalsh again :)

@daattali
Copy link
Owner

@jennydaman to continue the conversation from #303 (comment)

This issue is what you mentioned - the tags folder doesn't get generated. Looking at the commit that added this feature b90c1c8 it seems like there's a plugin that was created for that https://github.com/daattali/beautiful-jekyll/blob/master/_plugins/_tag_gen.rb

Does that tell you how these folders should get generated?

jennydaman added a commit to jennydaman/beautiful-jekyll that referenced this issue Jan 15, 2018
Fixes daattali#292, but might break newer features since f4d7021. I don't know.
@jennydaman
Copy link
Contributor

jennydaman commented Jan 15, 2018

I'm not a ruby dev, though I am an insomniac.

Found the conflict to be #264. I reverted the changes manually. https://github.com/jennydaman/beautiful-jekyll/tree/old-tag demonstrates compatibility with link-tags: true (tested with my improved Docker solution).

I don't have time anymore for integration tests (it's 3 AM and got homework to do).

If link-tags is an important feature, then someone should verify that everything else works (I'm particularly concerned about 92c9cf8 and c2be2a9). Of course, the most optimal solution is to update _tag_gen.rb so that it is compatible with recent versions of the github-pages gem.

Also noteworthy: jekyll-paginate is no longer under development. See https://github.com/sverrirs/jekyll-paginate-v2.

Good night.

if it ain't broke, don't fix it

@OCram85
Copy link
Contributor

OCram85 commented Jan 15, 2018

Hey guys,
I decided to customize the tag links on my personal site.
I just link to a single page called tags and with the target anchor like this: https://ocram85.github.io/tags#Jekyll

I hope it helps in this discussion.^^

@jennydaman
Copy link
Contributor

jennydaman commented Jan 15, 2018 via email

@daattali
Copy link
Owner

@jennydaman I'm also on east coast, also insomniac, trying to finish a client project....

@OCram85 is that page generated automatically using all the tags that exist in any post? Or do you have to manually supply the list of tags? ie. If you make a new post and use a brand new tag in it, would this page update to have that tag? I'm assuming that's possible by looping over all posts and looking at all tags of each post. If this solution works great, I would be much much happier with that than the current. As you know, I prefer anything that is within-browser over commandline when it comes to jekyll :)

@OCram85
Copy link
Contributor

OCram85 commented Jan 15, 2018

I did the following:

  • There is a page called tags which is generated while the build process.
    • It contains all known tags from all the posts and list them alphabetically.
      -Each tag gets a heading the the #anchor.
  • All I had to do was, changing the your template whenever the is your tag link to something like this:
{% if page.tags.size > 0 %}
        <div class="blog-tags">
          Tags:
          {% if site.link-tags %}
          {% for tag in page.tags %}
            <a href="/tags/#{{ tag }}">{{ tag }}</a>
          {% endfor %}
          {% else %}
            {{ page.tags | join: ", " }}
          {% endif %}
        </div>
      {% endif %}

I'm currently quite busy but if I find some time I'm going to create a PR therefore...

@daattali
Copy link
Owner

A PR is welcome whenever you find the time, no stress

@jennydaman
Copy link
Contributor

Oops phone wasn't silenced.

@OCram85 has an interesting solution where the site is built from source on a different branch and exported to master with App Veyor. Although I'm not familiar with that service, the concept gave me an idea. Maybe it's possible to support tags (the original implementation) by using jekyll build --destination docs/. I'll try that in the morning, and if it works, maybe we should make a note in README.md.

@daattali
Copy link
Owner

Which part exactly can't be automated by github pages? The more we can keep inside gh-pages and not have to venture into more technologies, the better.

@OCram85
Copy link
Contributor

OCram85 commented Jan 15, 2018

@jennydaman: Oh you can forget my custom build queue. The described workflow for building a tag index and linking there just uses basic jekyll and liquid. This should work for everyone. Like already said, I'm going to create a PR therefore. So you can test it on your own if you like.

@jennydaman
Copy link
Contributor

jennydaman commented Jan 15, 2018

@OCram85 what I tried to do is use the original tag generator on Github Pages. It works!
Example: https://twlinux.github.io/

In English, what I did was use git worktree to have separate branches in separate folders. I mounted both folders in my Docker container and used jekyll build to generate static HTML to my master branch.

https://github.com/twlinux/twlinux.github.io#bundle-static-files-to-master-branch

Tags are awesome. Maybe it should be noted in README.md (for advanced users) that although Github Pages's Jekyll engine will not support the custom tags plugin, you can bundle it yourself.

@OCram85
Copy link
Contributor

OCram85 commented Jan 16, 2018

@jennydaman: Here is a gist with my current tags.md and a snippet wiht the linking example to this page.

https://gist.github.com/OCram85/ad58b3d585705c8be8d0eb646cf516c0

@OCram85
Copy link
Contributor

OCram85 commented Jan 16, 2018

@daattali , @jennydaman : I just realized the _tag_gen.rb doesn't seem to work with the current ph-pages version. This means gh-pages ignores the _plugin dir and does not use any plugins there.

That's the reason why i customized the tag index page and the way of linking onto this.

@jennydaman
Copy link
Contributor

@OCram85 yes, I noted that above. #292 (comment)

My current solution is to use guthub-pages v106 (old) and TravisCI. I prefer the old _tag_gen.rb because it creates separate pages for different tags.

@OCram85
Copy link
Contributor

OCram85 commented Jan 16, 2018

@jennydaman Srry i missed that part. I ran into this plugins issue multiple times. But I didn't found any way to disable the so called whitelist or safe mode.

To build the jekyll page manually the easiest way would maybe be switch from gh-pages gem to the jekyll and list the needed gems manually^^

@daattali
Copy link
Owner

Sorry I haven't followed the conversation. It sounds like both of your solutions do require building the site with ruby locally rather than using purely GH, correct?

I agree with @jennydaman that having a separate page per tag is nicer than putting them all in one page. But isn't it possible to stay entirely within github pages if you do put all tags on the same page? By having a tags.md page that simply loops through all the pages and builds a list of posts per tag?

@jennydaman
Copy link
Contributor

I think @OCram85's tags.md is unrelated to his third party build system.

@daattali
Copy link
Owner

Awesome, in that case I will wait for a PR :)

@OCram85
Copy link
Contributor

OCram85 commented Jan 18, 2018

Done 👿

@daattali
Copy link
Owner

This now works much better than it did before thanks to @OCram85

@daattali
Copy link
Owner

@OCram85 here is the updated version: https://daattalitest.github.io/tags I hope you don't mind my changes

@OCram85
Copy link
Contributor

OCram85 commented Jan 19, 2018

Looks awesome! I'm going to implement this tags view on my blog as well 😄

@daattali
Copy link
Owner

Notice the .linked-section css I added. It's to fix the issue that when you link to a specific section on the page, the navbar was hiding it. It's a super clean solution to that general 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 a pull request may close this issue.

4 participants