Skip to content

Commit

Permalink
自动生成类别
Browse files Browse the repository at this point in the history
  • Loading branch information
QuincySx committed Nov 9, 2020
1 parent 7e44608 commit e6eb1d2
Show file tree
Hide file tree
Showing 347 changed files with 48 additions and 58 deletions.
8 changes: 4 additions & 4 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ exclude:
# Markdown

include:
-sheet
-sheets

highlighter: false
markdown: kramdown
Expand All @@ -59,10 +59,10 @@ defaults:

# Site info

url: https://devhints.io
title: Devhints.io cheatsheets
url: https://hints.smallRaw.com
title: SmallRaw Cheatsheets

# GitHub metadata
# https://help.github.com/articles/repository-metadata-on-github-pages/

repository: rstacruz/cheatsheets
repository: SmallRaw/cheatsheets
30 changes: 0 additions & 30 deletions _data/categories.yml

This file was deleted.

6 changes: 3 additions & 3 deletions _data/content.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
home:
title: "SmallRaw Cheatsheets"
title: "SmallRaw 开发速查表"
tagline: |
这是 SmallRaw 组织制作的一份开发速查表。
Expand All @@ -9,7 +9,7 @@ top_nav:
edit_on_github: 去 GitHub 编辑

sheet:
suffix: cheatsheet
suffix: 开发速查表

social_list:
default_description: "收集开发速查表"
Expand All @@ -24,7 +24,7 @@ related_posts_callout:
related_posts_group:
top: 顶置的开发速查表
other: 其他开发速查表
category: 相关开发速查表
category: 相同类型的开发速查表

search_form:
default_placeholder: 搜索开发速查表
Expand Down
2 changes: 1 addition & 1 deletion _data/disqus.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
enabled: true
enabled: false
host: devhints.disqus.com
7 changes: 3 additions & 4 deletions _includes/about-the-site.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
<div class="about-the-site">
<div class="container">
<p class='blurb'>
<strong><a href="{{ base }}">{{ site.title }}</a></strong> is a collection of cheatsheets I've written over the years.
Suggestions and corrections? <a href='https://github.com/rstacruz/cheatsheets/issues/907'>Send them in</a>.
<strong><a href="{{ base }}">{{ site.title }}</a></strong> 自用的开发速查表清单。
有意见与建议? <a href='https://github.com/SmallRaw/cheatsheets/issues/1'>意见反馈</a>.
<i class='fleuron'></i>
I'm <a href="http://ricostacruz.com">Rico Sta. Cruz</a>.
Check out my <a href="http://ricostacruz.com/til">Today I learned blog</a> for more.
看看我今天有没有写 <a href="https://blog.smallraw.com">博客</a>.
</p>

{% if page.url != '/index.html' %}
Expand Down
2 changes: 1 addition & 1 deletion _includes/site-header.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class='site-header'>
<div class='container'>
This is <a href="."><em>{{ site.title }}</em></a> &mdash; a collection of cheatsheets I've written.
This is <a href="."><em>{{ site.title }}</em></a> &mdash; 我写的开发速查表。
</div>
</div>

24 changes: 18 additions & 6 deletions _layouts/2017/home.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,26 @@
<!doctype html>
<html class='NoJs' lang='en'><head>
<html class='NoJs' lang='cn'><head>

<!-- 推荐速查表 -->
{% assign featured_pages = site.pages
| where_exp: "page", "page.tags contains 'Featured'"
%}

<!-- 最近修改的速查表 -->
{% assign recent_pages = site.pages
| where_exp: "page", "page.updated"
| sort: "updated", "first"
%}

<!-- 分类信息 -->
{% capture categorie_list %}
{% for categorie in site.pages %}
{{categorie.category | strip }}
{% if forloop.last == false %}::{% endif%}
{% endfor %}
{% endcapture %}
{% assign categories = categorie_list | split: '::' | sort | uniq %}

{% include 2017/head.html critical='home' %}

</head><body class='UseCompactHeader HighlightPubFirstLine'>
Expand Down Expand Up @@ -51,13 +64,12 @@ <h2 class='category item' data-js-searchable-header>
{% endfor %}


{% for category in site.data.categories.names %}
{% for category in categories %}
<h2 class='category item' id='{{ category | downcase | replace: " ", "-" }}' data-js-searchable-header>
<span>{{ category }}</span>
</h2>

{% for page in site.pages %}
{% if page.category == category %}
{% if category contains page.category %}
{% if page.title %}
{% include 2017/pages-list-item.html page=page class='article item' %}
{% endif %}
Expand All @@ -66,9 +78,9 @@ <h2 class='category item' id='{{ category | downcase | replace: " ", "-" }}' dat
{% endfor %}

<div class='message item missing-message'>
<h3>See something missing?</h3>
<h3>想要帮助我完善?</h3>
<p>
<a class='push-button' href='{{ site.github.repository_url }}/issues/907'>Request cheatsheet</a>
<a class='push-button' href='{{ site.github.repository_url }}/issues/1'>前去完善</a>
</p>
</div>
</div>
Expand Down
6 changes: 3 additions & 3 deletions _layouts/2017/sheet.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ <h1 class='h1'>{{ page.title }} <em>{{ site.data.content.sheet.suffix }}</em></h

{% if page.tags contains 'WIP' %}
<aside class='notice-box'>
This page is a work in progress. You can help by <a href='{{ site.github.repository_url }}/blob/master/{{ page.path | remove: '.html' }}'>suggesting edits</a>!
这一页正在进行中。你可以<a href='{{ site.github.repository_url }}/blob/master/{{ page.path | remove: '.html' }}'>前去编辑</a>!
</aside>
{% endif %}

{% if page.deprecated_by %}
<aside class='notice-box'>
<strong>Deprecated:</strong> This guide covers an older version.
<a href='{{ base }}{{ page.deprecated_by }}'>A newer version is available here.</a>
<strong>弃用:</strong> 该速查表内容可能已经过旧。
<a href='{{ base }}{{ page.deprecated_by }}'>更新的版本可以在这里找到.</a>
</aside>
{% endif %}

Expand Down
13 changes: 11 additions & 2 deletions _layouts/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,22 @@
{% include head.html %}
{% include site-header.html %}

{% for category in site.data.categories.names %}
{% capture categorie_list %}
{% for categorie in site.pages %}
{{categorie.category | strip }}
{% if forloop.last == false %}::{% endif%}
{% endfor %}
{% endcapture %}
{% assign categories = categorie_list | split: '::' | sort | uniq %}


{% for category in categories %}
<div class='pages-header'>
<h2 id='{{ category | downcase | replace: " ", "-" }}'>{{ category }}</h2>
</div>
<div class='pages-list'>
{% for page in site.pages %}
{% if page.category == category %}
{% if category contains page.category %}
<a href="{{base}}{{ page.url }}">
<span class='title'>{{ page.title }}</span>
<span class='date'>{{ page.url | remove: '.html' | remove: '/' }}</span>
Expand Down
6 changes: 3 additions & 3 deletions _layouts/redirect.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
{% assign target = page.redirect.to | remove: '.html' | replace: 'cheatsheets/cheatsheets', 'cheatsheets' %}
<html lang="en-US">
<meta charset="utf-8">
<title>Redirecting…</title>
<title>链接调跳转中...</title>
<link rel="canonical" href="{{ target }}">
<meta http-equiv="refresh" content="0; url={{ target }}">
<h1>Redirecting...</h1>
<a href="{{ target }}">Click here if you are not redirected.</a>
<h1>链接调跳转中...</h1>
<a href="{{ target }}">如果你还没有跳转请点击这里。</a>
<script>location="{{ target }}"</script>
</html>
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"license": "MIT",
"main": "index.js",
"private": true,
"repository": "https://github.com/rstacruz/cheatsheets.git",
"repository": "https://github.com/SmallRaw/cheatsheets.git",
"scripts": {
"build": "run-s -s 'parcel:*:build' jekyll:build",
"dev": "run-p -sl jekyll:watch 'parcel:*:watch'",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit e6eb1d2

Please sign in to comment.