Comments (5)
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.
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.
Collections
site.tags
is used for display all tags, but generating tag pages is based onjekyll 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.
Relation
- collection
- tag cloud
from neilchenxie.github.io.
总结: http://chen-node.com/communication/jekll_tag_page/
from neilchenxie.github.io.
Related Issues (20)
- TravelList
- Git 经验 HOT 1
- 搜索引擎用法
- Linux文件夹 HOT 1
- Humor HOT 1
- 400马拉松计划
- 骰子游戏 HOT 1
- Party Game
- 各地Coffee HOT 3
- Category Article List HOT 1
- Hot Pot HOT 1
- Linux Tips HOT 1
- year tags HOT 2
- tax ticket name
- 账号
- ENV under Win7 HOT 2
- atom editor HOT 3
- service, systemd & systemctl HOT 6
- 图床
- 产品经理工作总结 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from neilchenxie.github.io.