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

Show tags/categories on pages #104

Closed
peterjc opened this issue Oct 8, 2016 · 7 comments
Closed

Show tags/categories on pages #104

peterjc opened this issue Oct 8, 2016 · 7 comments

Comments

@peterjc
Copy link
Member

peterjc commented Oct 8, 2016

e.g. http://biopython.org/wiki/ABI_traces should have a link to the Cookbook category http://biopython.org/wiki/Category%3ACookbook added automatically via the tag meta-data already in the header.

@Gasta88
Copy link
Contributor

Gasta88 commented Jan 23, 2017

Hi @peterjc ,

can you provide two working pages as a reference example? If I managed, I would like to have a go.

@peterjc
Copy link
Member Author

peterjc commented Jan 24, 2017

We don't have any examples of this yet - I believe all we need to do is add something to the template and all the pages will have links to the relevant pages from their (already defined tags).

The template code on https://github.com/biopython/biopython.github.io/blob/master/_layouts/tagpage.html does the opposite, it lists all the pages with a tag.

I think showing the tags (Jekyll terminology, these were originally categories under MediaWiki) on each page means learning more about the liquid template language and adding code to https://github.com/biopython/biopython.github.io/blob/master/_layouts/wiki.html to list all the tags on a page (perhaps as a simple header or footer). This will use page.tags, perhaps like the minimal example on https://jekyllrb.com/docs/templates/ but the tags should be links ideally.

There are various blog posts on this kind of thing, e.g. https://codinfox.github.io/dev/2015/03/06/use-tags-and-categories-in-your-jekyll-based-github-pages/ - hopefully you can find something simple which works.

@Gasta88
Copy link
Contributor

Gasta88 commented Jan 25, 2017

Thanks for the clarification.
I've found a possible approach here: http://charliepark.org/tags-in-jekyll/

I would like to carry one some tests on the forked repo, but I don't know how to deploy the pages. What is it used for this project?

@peterjc
Copy link
Member Author

peterjc commented Jan 25, 2017

Nice example :)

The key point looks to be this markdown/XML/liquid snippet:

<ul class="tag_list_in_post">
{% for tag in page.tags %}<li class="inline tag_list_item"><a class="tag_list_link" href="/tag/{{ tag }}">{{ tag }}</a></li>{% endfor %}
</ul>

That is in _include/meta.md which gets embedded from his _layout/post.html via this snippet:

{% include meta.md %}

Then there would be some CSS to style this bullet-list of tag links. I can see how to adapt this to our tags for the (former MediaWiki) categories like documentation and cook-book.

--

We're using GitHub pages. The lazy option (assuming you are not using GitHub Pages for a person repository) is to call your fork Gasta88.github.io

Otherwise you'd need to install and run Jekyll locally, see #79

@Gasta88
Copy link
Contributor

Gasta88 commented Feb 2, 2017

I've been trying for a week to apply any possible suggestion that I've managed to find on the web...but no joy.

Alternatively, would it be possible to consider an edit of the wiki pages?
I could add a link to the Cookbook (as suggested here: https://help.github.com/articles/adding-links-to-wikis/ ) that point to the correct page.

@peterjc peterjc closed this as completed in 431d351 Feb 7, 2017
@peterjc
Copy link
Member Author

peterjc commented Feb 7, 2017

@Gasta88 I don't know how far you were able to get, and if you were trying something similar or not, but inspired by the example you found I was able to get this to work. Thank you!

@Gasta88
Copy link
Contributor

Gasta88 commented Feb 7, 2017

Great to hear!

I couldn't get that far, but I'll gladly peek at your solution for future references.

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

No branches or pull requests

2 participants