Coder Social home page Coder Social logo

tag page about neilchenxie.github.io HOT 5 CLOSED

neilchenxie avatar neilchenxie commented on June 30, 2024
tag page

from neilchenxie.github.io.

Comments (5)

neilChenXie avatar neilChenXie commented on June 30, 2024

page

cd /path/to/my-jekyll-project/
touch tags.html
---
layout: page
permalink: /tags/
---

<ul class="tag-cloud">
{% for tag in site.tags %}
  <li style="font-size: {{ tag | last | size | times: 100 | divided_by: site.tags.size | plus: 70  }}%">
    <a href="#{{ tag | first | slugize }}">
      {{ tag | first }}
    </a>
  </li>
{% endfor %}
</ul>

<div id="archives">
{% for tag in site.tags %}
  <div class="archive-group">
    {% capture tag_name %}{{ tag | first }}{% endcapture %}
    <h3 id="#{{ tag_name | slugize }}">{{ tag_name }}</h3>
    <a name="{{ tag_name | slugize }}"></a>
    {% for post in site.tags[tag_name] %}
    <article class="archive-item">
      <h4><a href="{{ site.baseurl }}{{ post.url }}">{{post.title}}</a></h4>
    </article>
    {% endfor %}
  </div>
{% endfor %}
</div>

from neilchenxie.github.io.

neilChenXie avatar neilChenXie commented on June 30, 2024

Tag Cloud

<h1>Tag Cloud</h1>
{% assign tags = site.tags | sort %}
{% for tag in tags %}
 <span class="site-tag">
    <a href="/tag/{{ tag | first | slugify }}/"
        style="font-size: {{ tag | last | size  |  times: 4 | plus: 80  }}%">
            {{ tag[0] | replace:'-', ' ' }} ({{ tag | last | size }})
    </a>
</span>
{% endfor %}

from neilchenxie.github.io.

neilChenXie avatar neilChenXie commented on June 30, 2024

Collections

site.tags is used for display all tags, but generating tag pages is based on jekyll collections.

_config.yml

collections:
  tags_page:
      output: true  # create static pages
      permalink: /tag/:slug/
defaults:
    - scope:
        path: ""
        type: tags_page #decided {collection} folder
      values:
        layout: page_tag # decided which layout will be used

_{collection} folder

_ is very important for jekyll to recognize it.

layouts

from neilchenxie.github.io.

neilChenXie avatar neilChenXie commented on June 30, 2024

Relation

  1. collection
  2. tag cloud

from neilchenxie.github.io.

neilChenXie avatar neilChenXie commented on June 30, 2024

总结: http://chen-node.com/communication/jekll_tag_page/

from neilchenxie.github.io.

Related Issues (20)

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.