Skip to content

Commit 007cfc8

Browse files
committed
feat: as a website
1 parent 6e7bd13 commit 007cfc8

22 files changed

+2044
-1
lines changed

404.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
layout: page
3+
title: 404 Error
4+
tagline: Ah snap! We could not find what you are looking for!
5+
permalink: /404.html
6+
---
7+
8+
Try got get back to the Home Page and start over!
9+
10+
[Go to the Home Page]({{ '/' | absolute_url }})

Gemfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# frozen_string_literal: true
2+
3+
source 'https://rubygems.org'
4+
gemspec
5+
6+
gem 'jekyll-feed'

Gemfile.lock

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
PATH
2+
remote: .
3+
specs:
4+
jekyll-theme-cayman-blog (0.0.9)
5+
jekyll (~> 3.8, >= 3.8.6)
6+
jekyll-target-blank
7+
8+
GEM
9+
remote: https://rubygems.org/
10+
specs:
11+
addressable (2.7.0)
12+
public_suffix (>= 2.0.2, < 5.0)
13+
ast (2.4.0)
14+
colorator (1.1.0)
15+
concurrent-ruby (1.1.6)
16+
em-websocket (0.5.1)
17+
eventmachine (>= 0.12.9)
18+
http_parser.rb (~> 0.6.0)
19+
ethon (0.12.0)
20+
ffi (>= 1.3.0)
21+
eventmachine (1.2.7)
22+
ffi (1.12.2)
23+
forwardable-extended (2.6.0)
24+
html-proofer (3.15.3)
25+
addressable (~> 2.3)
26+
mercenary (~> 0.3)
27+
nokogumbo (~> 2.0)
28+
parallel (~> 1.3)
29+
rainbow (~> 3.0)
30+
typhoeus (~> 1.3)
31+
yell (~> 2.0)
32+
http_parser.rb (0.6.0)
33+
i18n (0.9.5)
34+
concurrent-ruby (~> 1.0)
35+
jaro_winkler (1.5.4)
36+
jekyll (3.8.6)
37+
addressable (~> 2.4)
38+
colorator (~> 1.0)
39+
em-websocket (~> 0.5)
40+
i18n (~> 0.7)
41+
jekyll-sass-converter (~> 1.0)
42+
jekyll-watch (~> 2.0)
43+
kramdown (~> 1.14)
44+
liquid (~> 4.0)
45+
mercenary (~> 0.3.3)
46+
pathutil (~> 0.9)
47+
rouge (>= 1.7, < 4)
48+
safe_yaml (~> 1.0)
49+
jekyll-feed (0.13.0)
50+
jekyll (>= 3.7, < 5.0)
51+
jekyll-sass-converter (1.5.2)
52+
sass (~> 3.4)
53+
jekyll-target-blank (2.0.0)
54+
jekyll (>= 3.0, < 5.0)
55+
nokogiri (~> 1.10)
56+
jekyll-watch (2.2.1)
57+
listen (~> 3.0)
58+
json (2.3.0)
59+
kramdown (1.17.0)
60+
liquid (4.0.3)
61+
listen (3.2.1)
62+
rb-fsevent (~> 0.10, >= 0.10.3)
63+
rb-inotify (~> 0.9, >= 0.9.10)
64+
mercenary (0.3.6)
65+
mini_portile2 (2.4.0)
66+
nokogiri (1.10.9)
67+
mini_portile2 (~> 2.4.0)
68+
nokogumbo (2.0.2)
69+
nokogiri (~> 1.8, >= 1.8.4)
70+
parallel (1.19.1)
71+
parser (2.7.1.2)
72+
ast (~> 2.4.0)
73+
pathutil (0.16.2)
74+
forwardable-extended (~> 2.6)
75+
public_suffix (4.0.4)
76+
rainbow (3.0.0)
77+
rb-fsevent (0.10.4)
78+
rb-inotify (0.10.1)
79+
ffi (~> 1.0)
80+
rexml (3.2.4)
81+
rouge (3.18.0)
82+
rubocop (0.82.0)
83+
jaro_winkler (~> 1.5.1)
84+
parallel (~> 1.10)
85+
parser (>= 2.7.0.1)
86+
rainbow (>= 2.2.2, < 4.0)
87+
rexml
88+
ruby-progressbar (~> 1.7)
89+
unicode-display_width (>= 1.4.0, < 2.0)
90+
ruby-progressbar (1.10.1)
91+
safe_yaml (1.0.5)
92+
sass (3.7.4)
93+
sass-listen (~> 4.0.0)
94+
sass-listen (4.0.0)
95+
rb-fsevent (~> 0.9, >= 0.9.4)
96+
rb-inotify (~> 0.9, >= 0.9.7)
97+
typhoeus (1.3.1)
98+
ethon (>= 0.9.0)
99+
unicode-display_width (1.7.0)
100+
w3c_validators (1.3.5)
101+
json (>= 1.8)
102+
nokogiri (~> 1.6)
103+
yell (2.2.2)
104+
105+
PLATFORMS
106+
ruby
107+
108+
DEPENDENCIES
109+
html-proofer (~> 3.0)
110+
jekyll-feed
111+
jekyll-theme-cayman-blog!
112+
rubocop (~> 0.50)
113+
w3c_validators (~> 1.3)
114+
115+
BUNDLED WITH
116+
2.1.4

_config.yml

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,33 @@
1-
theme: jekyll-theme-cayman
1+
title: Python 周报
2+
description: 提供关于 Python 的资讯、教程和信息,也包括对 Python 开发者有价值的信息。
3+
show_downloads: false
4+
5+
baseurl: # change this to the subpath of your site, e.g. /blog. Leave it empty if you don't need it.
6+
url: "https://pyweekly.qiwihui.com" # change this to the base hostname & protocol for your site
7+
8+
9+
google_analytics: "UA-46660488-11"
10+
11+
# cayman-blog date format
12+
# refer to http://shopify.github.io/liquid/filters/date/ if you want to customize this
13+
cayman-blog:
14+
date_format: "%b %-d, %Y"
15+
16+
theme: # leave it empty
17+
18+
# social
19+
author: qiwihui
20+
twitter:
21+
username: pikabota
22+
github:
23+
owner_name: qiwihui
24+
owner_url: https://github.com/qiwihui
25+
26+
plugins:
27+
- jekyll-target-blank
28+
- jekyll-feed
29+
30+
target-blank:
31+
rel: nofollow
32+
33+
header_page_refs: ['about']

_includes/site-header.html

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<header class="site-header" role="banner">
2+
3+
<div class="wrapper">
4+
{% assign default_refs = site.pages | sort:"order" | map: "ref" %}
5+
{% assign page_refs = site.header_page_refs | default: default_refs %}
6+
7+
{% if page.layout != 'home' %}
8+
<a class="site-title" href="{{ "/" | absolute_url }}">{{ site.title | escape }}</a>
9+
{% endif %}
10+
11+
{% if page_refs %}
12+
<nav class="site-nav">
13+
<input type="checkbox" id="nav-trigger" class="nav-trigger" />
14+
<label for="nav-trigger">
15+
<span class="menu-icon">
16+
<svg viewBox="0 0 18 15" width="18px" height="15px">
17+
<path fill="#424242" d="M18,1.484c0,0.82-0.665,1.484-1.484,1.484H1.484C0.665,2.969,0,2.304,0,1.484l0,0C0,0.665,0.665,0,1.484,0 h15.031C17.335,0,18,0.665,18,1.484L18,1.484z"/>
18+
<path fill="#424242" d="M18,7.516C18,8.335,17.335,9,16.516,9H1.484C0.665,9,0,8.335,0,7.516l0,0c0-0.82,0.665-1.484,1.484-1.484 h15.031C17.335,6.031,18,6.696,18,7.516L18,7.516z"/>
19+
<path fill="#424242" d="M18,13.516C18,14.335,17.335,15,16.516,15H1.484C0.665,15,0,14.335,0,13.516l0,0 c0-0.82,0.665-1.484,1.484-1.484h15.031C17.335,12.031,18,12.696,18,13.516L18,13.516z"/>
20+
</svg>
21+
</span>
22+
</label>
23+
24+
<div class="trigger">
25+
{% for ref in page_refs %}
26+
{% assign my_page = site.pages | where: "ref", ref | first %}
27+
{% if my_page.title %}
28+
{% if my_page.title contains "404" %}
29+
{% else %}
30+
<a class="page-link" href="{{ my_page.url | absolute_url }}">{{ my_page.title | escape }}</a>
31+
{% endif %}
32+
{% endif %}
33+
{% endfor %}
34+
</div>
35+
</nav>
36+
{% endif %}
37+
</div>
38+
</header>

_includes/social-metatags.html

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
2+
{% if page.title %}
3+
{% assign page_title = page.title | escape %}
4+
{% else %}
5+
{% assign page_title = site.title | escape %}
6+
{% endif %}
7+
8+
9+
{% if page.author.name %}
10+
{% assign page_author = page.author.name | default: nil | escape %}
11+
{% assign twitter_creator = page.twitter.username | default: site.twitter.site | default: nil | escape %}
12+
{% else %}
13+
{% assign page_author = site.author.name | default: nil | escape %}
14+
{% assign twitter_creator = site.twitter.username | default: nil | escape %}
15+
{% endif %}
16+
17+
{% assign page_description = page.excerpt | default: page.tagline | default: site.description | strip_html | normalize_whitespace | truncate: 300 | escape %}
18+
19+
{%if page.image %}
20+
{% assign page_image = page.image | absolute_url %}
21+
{%else if site.image %}
22+
{% assign page_image = site.image | absolute_url %}
23+
{%endif %}
24+
25+
{% assign abs_url = '' | absolute_url %}
26+
{% assign canonical_url = page.url | replace:'index.html','' | prepend: abs_url %}
27+
28+
<!-- Place this data between the <head> tags of your website -->
29+
{%if page_author %}
30+
<meta name="author" content="{{ page_author }}" />
31+
{%endif %}
32+
<meta name="description" content="{{ page_description }}" />
33+
{%if page.tags.size > 0 %}
34+
<meta name="keywords" itemprop="tags" content="{{ page.tags | join: ', ' | escape }}"/>
35+
{%endif %}
36+
{%if page.keywords %}
37+
<meta name="keywords" itemprop="keywords" content="{{ page.keywords | escape }}" />
38+
{%endif %}
39+
{%if page.categories.size > 0 %}
40+
<meta name="keywords" itemprop="categories" content="{{ page.categories | join: ', ' | escape }}" />
41+
{%endif %}
42+
{%if page.category %}
43+
<meta name="keywords" itemprop="category" content="{{ category | escape }}" />
44+
{%endif %}
45+
46+
<!-- Twitter Card data -->
47+
<meta name="twitter:card" content="summary_large_image" />
48+
49+
{%if site.twitter.site %}
50+
<meta name="twitter:site" content="@{{ site.twitter.site }}" />
51+
{%endif %}
52+
53+
<meta name="twitter:title" content="{{ page_title }}" />
54+
<meta name="twitter:description" content="{{ page_description }}" />
55+
56+
{%if twitter_creator %}
57+
<meta name="twitter:creator" content="@{{ twitter_creator }}" />
58+
{%endif %}
59+
60+
<!-- Twitter summary card with large image must be at least 280x150px -->
61+
{%if page_image %}
62+
<meta name="twitter:image:src" content="{{ page_image }}" />
63+
<meta name="twitter:image" content="{{ page_image }}" />
64+
{%endif %}
65+
<meta name="twitter:url" content="{{ canonical_url }}" />
66+
67+
<!-- Open Graph data -->
68+
<meta property="og:title" content="{{ page_title }}" />
69+
<meta property="og:type" content="article" />
70+
<meta property="og:url" content="{{ canonical_url }}" />
71+
72+
{%if page_image %}
73+
<meta property="og:image" content="{{ page_image }}" />
74+
{%endif %}
75+
<meta property="og:description" content="{{ page_description }}" />
76+
<meta property="og:site_name" content="{{ site.title }}" />
77+
78+
{% if page-lang == "en" %}
79+
{% assign page-lang-country = "en_US" %}
80+
{% elsif page-lang == "it" %}
81+
{% assign page-lang-country = "it_IT" %}
82+
{% endif %}
83+
<meta property="og:locale" content="{{ page-lang-country }}" />
84+
85+
{%if page.date %}
86+
<meta property="article:published_time" content="{{ page.date | date_to_xmlschema }}" />
87+
{%endif %}
88+
{%if page.modified_date %}
89+
<meta property="og:updated_time" content="{{ page.modified_date | date_to_xmlschema }}" />
90+
<meta property="article:modified_time" content="{{ page.modified_date | date_to_xmlschema }}" />
91+
{%endif %}
92+
93+
{%if page.tags %}
94+
{% for tag in page.tags %}
95+
<meta property="article:tag" content="{{ tag | escape }}" />
96+
{% endfor %}
97+
{%endif %}
98+
99+
{%if page.keywords %}
100+
{% assign keywordsList = page.keywords | split:', ' %}
101+
{% for keyword in keywordsList %}
102+
<meta property="article:tag" content="{{ keyword | escape }}" />
103+
{% endfor %}
104+
{%endif %}
105+
106+
{%if page.categories %}
107+
{% for category in page.categories %}
108+
<meta property="article:tag" content="{{ category | escape }}" />
109+
{% endfor %}
110+
{%endif %}
111+
112+
{%if page.category %}
113+
<meta property="article:tag" content="{{ category | escape }}" />
114+
{%endif %}

0 commit comments

Comments
 (0)