Giter Club home page Giter Club logo

minddust.github.io's People

Contributors

minddust avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

minddust.github.io's Issues

Simpler data lookups

Re: http://www.minddust.com/post/tags-and-categories-on-github-pages/

It's possible to get rid of this double for lookup:

{% for post_tag in post.tags %}
    {% for data_tag in site.data.tags %}
        {% if data_tag.slug == post_tag %}
            {% assign tag = data_tag %}
        {% endif %}
    {% endfor %}

Instead you could write a much nicer:

{% for post_tag in post.tags %}
    {% assign tag = site.data.tags[post_tag] %}

Your tags.yml currently looks like this:

- slug: django
  name: Django

- slug: django-template-tags
  name: Django Template Tags

- slug: font-awesome
  name: Font Awesome

- slug: icons
  name: Icons

and the above works if you restructure it like so:

django:
  slug: django
  name: Django
django-template-tags:
  slug: django-template-tags
  name: Django Template Tags
font-awesome:
  slug: font-awesome
  name: Font Awesome
icons:
  slug: icons
  name: Icons

with the added benefit of {{site.data.tags.icons.name}}, should you want to do that. It makes more sense if you're crossreferencing projects. The dot notation even works with font-awesome, probably because Liquid is not a full-fledged language and - doesn't mean minus.

and since you only used slug to look the tag up, you it's not needed any more:

django:
  name: Django
django-template-tags:
  name: Django Template Tags
font-awesome:
  name: Font Awesome
icons:
  name: Icons

Regarding /blog/tag/{{ tag.slug }}/, since tag.slug == post_tag was true you can use post_tag to create the url. This is really question of taste though, if you don't mind duplicating the slug as tag key in yaml you could use the uniform tag.slug version.

When you're listing all tags you can use

{% for data_tag_entry in site.data.tags %}
    {% assign data_tag_slug = data_tag_entry[0] %}
    {% assign data_tag = data_tag_entry[1] %}

so the slug is not lost.

This obviosly works for all data ymls.

Auto-generating category files

Hi, have you found a way to auto-generate the content in the _my_tags and _my_categories folders? As long as it works locally the same effect could be achieved as the files would be committed to source code and Github Pages is none the wiser. I'm new to Ruby/Jekyll so I'm not sure where to start, I get the sense that the plugin examples I've seen generate content in _site, which isn't what we want.

Thanks!

Blog post leaves out crucial information

Hi there,

In your blog post, HOW TO USE TAGS AND CATEGORIES ON GITHUB PAGES WITHOUT PLUGINS, you supply an incomplete example of the code needed to set the system up. In the implementation of the website, you have one extra line above what you have mirrored in the post:

{% assign post = page %}

This line is crucial to the rest of the code working, since (at least as of now) Jekyll uses 'page' instead of 'post'.

After I added that line, implementing the rest was extremely easy and very well documented, especially with the full implementation available for perusal. I am very grateful that you took the time to figure this out, and thought you might be unaware of the above omission.

Tags and categories on github pages without plugins

Hi @minddust ,

Just tried to display tags and categories following your guide but for some reason there are no tags/categories displayed on my post page.
The only difference is that my blog folder is under _posts/ (not in the root folder like yours) .
Could it cause the problem?

Add post = page assignment

I've read your post about categories and tags on github pages. It was exactly what I was looking for. However, I could only get it working untill I saw that I've missed something.

You have to add this: {% assign post = page %} at the top of the post layout. Alternatively, you could replace post by page in the subsequent code. I know the earlier post does contain this statement. But when writing code examples, the code should be complete.

adding tag links to a list of tags

Hi Stephan -- thank you so much for helping me figure out the tags. I've found your site to be extremely useful! I have a followup question. I have a page with a list of posts by tag. the code is below. I'd like to add a LINK to each tag name that goes to the permalink location for tag.

so for example this is a page that i built using your code that calls the HDF5 tag!
http://lwasser.github.io/NEON_HigherEd/HDF5/

to create a URL path i'd like to use the slug in the tags.yml page because that will never have spaces in it. Can you provide a bit of direction regarding how i would modify the code below to find the slug for each tag? (if that makes sense?) i've tried several things - none of which have worked.
thank you for any direction!
Leah

by Tag
{% assign post = page %}
{% for tag in site.tags %}
      <h3><a name="{{ tag | first }}">{{ tag | first }}</a></h3>
        {% for posts in tag %}
          {% for post in posts %}
          <article>
          {% if post.url %}       
            <h2><a href="{{ post.url | prepend: site.baseurl }}">{{ post.title }}</a></h2>
           <p>{% if post.description %}{{ post.description }}{% else %}{{ post.content | strip_html | strip_newlines | truncate: 120 }}{% endif %}</p>      
            {% endif %}
            </article>
          {% endfor %}
        {% endfor %}
    {% endfor %}

Category Layout question

Hi,

Loving your tag and category tutorials; just what I was looking for! (Although #9 is an interesting question...)

My question is about the layout:
https://github.com/minddust/minddust.github.io/blob/master/_layouts/blog_by_category.html

In here you treat the my_categories as a hash, rather than an array. For me, that collection is an array; I cannot access them by slug, but instead by numeric ID... Eg:

site.categories[0].slug -- works
site.categories['example'].slug -- does not work

Also youre collection is my_categories but you use categories in site?

robots.txt sitemap

The sitemap line in robots.txt doesn't render correctly since there isn't a front matter in that file. Adding two --- lines at the start of the file should be enough to fix it.

The alternative tags Jekyll implementation is misleading

The tutorial provided is very helpful, and a good solution, but the second post is very misleading.

The wording used implies (or seems to) that the instructions to have a full tagging solution are in that posts, but it's actually missing some bits, for example, the creation of the blog_by_tag layout.

While this may be obvious for people working with Jekyll, it's very confusing for people who don't know anything about Jekyll, and assume that implementations would only take a few minutes :-)

Using subdirectories for categories

#3 ? I am still wrapping my head around collections and categories and so for this implementation keeps my source dir pretty clean. Now to muss it up, but not by much I found this: jekyll/jekyll#1141
which taught me that sudir/_posts works for categories but it is not hitting in the blog_by_category layout.
forgive me as I am just starting out and I am sure it is something to do with the loop. I will do my best to figure out how I can do this but I thought you might have an idea. Oh, and i couldn't figure out how to label this a question

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.