Skip to content

Commit 856bf01

Browse files
committed
fix: with permalink and emoji
1 parent 007cfc8 commit 856bf01

File tree

10 files changed

+113
-80
lines changed

10 files changed

+113
-80
lines changed

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ source 'https://rubygems.org'
44
gemspec
55

66
gem 'jekyll-feed'
7+
gem 'jemoji'

Gemfile.lock

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ PATH
88
GEM
99
remote: https://rubygems.org/
1010
specs:
11+
activesupport (6.0.2.2)
12+
concurrent-ruby (~> 1.0, >= 1.0.2)
13+
i18n (>= 0.7, < 2)
14+
minitest (~> 5.1)
15+
tzinfo (~> 1.1)
16+
zeitwerk (~> 2.2)
1117
addressable (2.7.0)
1218
public_suffix (>= 2.0.2, < 5.0)
1319
ast (2.4.0)
@@ -21,6 +27,10 @@ GEM
2127
eventmachine (1.2.7)
2228
ffi (1.12.2)
2329
forwardable-extended (2.6.0)
30+
gemoji (3.0.1)
31+
html-pipeline (2.12.3)
32+
activesupport (>= 2)
33+
nokogiri (>= 1.4)
2434
html-proofer (3.15.3)
2535
addressable (~> 2.3)
2636
mercenary (~> 0.3)
@@ -55,6 +65,10 @@ GEM
5565
nokogiri (~> 1.10)
5666
jekyll-watch (2.2.1)
5767
listen (~> 3.0)
68+
jemoji (0.12.0)
69+
gemoji (~> 3.0)
70+
html-pipeline (~> 2.2)
71+
jekyll (>= 3.0, < 5.0)
5872
json (2.3.0)
5973
kramdown (1.17.0)
6074
liquid (4.0.3)
@@ -63,6 +77,7 @@ GEM
6377
rb-inotify (~> 0.9, >= 0.9.10)
6478
mercenary (0.3.6)
6579
mini_portile2 (2.4.0)
80+
minitest (5.14.0)
6681
nokogiri (1.10.9)
6782
mini_portile2 (~> 2.4.0)
6883
nokogumbo (2.0.2)
@@ -94,13 +109,17 @@ GEM
94109
sass-listen (4.0.0)
95110
rb-fsevent (~> 0.9, >= 0.9.4)
96111
rb-inotify (~> 0.9, >= 0.9.7)
112+
thread_safe (0.3.6)
97113
typhoeus (1.3.1)
98114
ethon (>= 0.9.0)
115+
tzinfo (1.2.7)
116+
thread_safe (~> 0.1)
99117
unicode-display_width (1.7.0)
100118
w3c_validators (1.3.5)
101119
json (>= 1.8)
102120
nokogiri (~> 1.6)
103121
yell (2.2.2)
122+
zeitwerk (2.3.0)
104123

105124
PLATFORMS
106125
ruby
@@ -109,6 +128,7 @@ DEPENDENCIES
109128
html-proofer (~> 3.0)
110129
jekyll-feed
111130
jekyll-theme-cayman-blog!
131+
jemoji
112132
rubocop (~> 0.50)
113133
w3c_validators (~> 1.3)
114134

Reports/2020/#1 - 2020.05.03.md

Lines changed: 0 additions & 79 deletions
This file was deleted.

_config.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ show_downloads: false
44

55
baseurl: # change this to the subpath of your site, e.g. /blog. Leave it empty if you don't need it.
66
url: "https://pyweekly.qiwihui.com" # change this to the base hostname & protocol for your site
7-
7+
permalink: /:title
88

99
google_analytics: "UA-46660488-11"
1010

@@ -26,6 +26,7 @@ github:
2626
plugins:
2727
- jekyll-target-blank
2828
- jekyll-feed
29+
- jemoji
2930

3031
target-blank:
3132
rel: nofollow

_posts/2020-05-03-#1.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
layout: post
33
title: "Python 周报 #1 | 2020-05-03"
4+
permalink: /1
45
---
56

67
Python 周报,提供有价值的 Python 及行业相关信息。

script/bootstrap

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/sh
2+
3+
set -e
4+
5+
gem install bundler
6+
bundle install

script/cibuild

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/sh
2+
3+
set -e
4+
5+
bundle exec jekyll build
6+
bundle exec htmlproofer ./_site --check-html
7+
# bundle exec htmlproofer ./_site --check-html --check-sri
8+
# bundle exec rubocop -D
9+
# bundle exec script/validate-html
10+
# gem build jekyll-theme-cayman-blog.gemspec

script/release

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#!/bin/sh
2+
# Tag and push a release.
3+
4+
set -e
5+
6+
# Make sure we're in the project root.
7+
8+
cd $(dirname "$0")/..
9+
10+
# Make sure the darn thing works
11+
12+
bundle update
13+
14+
# Build a new gem archive.
15+
16+
rm -rf jekyll-theme-cayman-blog-*.gem
17+
gem build -q jekyll-theme-cayman-blog.gemspec
18+
19+
# Make sure we're on the master branch.
20+
21+
(git branch | grep -q 'master') || {
22+
echo "Only release from the master branch."
23+
exit 1
24+
}
25+
26+
# Figure out what version we're releasing.
27+
28+
tag=v`ls jekyll-theme-cayman-blog-*.gem | sed 's/^jekyll-theme-cayman-blog-\(.*\)\.gem$/\1/'`
29+
30+
# Make sure we haven't released this version before.
31+
32+
git fetch -t origin
33+
34+
(git tag -l | grep -q "$tag") && {
35+
echo "Whoops, there's already a '${tag}' tag."
36+
exit 1
37+
}
38+
39+
# Tag it and bag it.
40+
41+
gem push jekyll-theme-cayman-blog-*.gem && git tag "$tag" &&
42+
git push origin master && git push origin "$tag"

script/server

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
3+
bundle exec jekyll serve

script/validate-html

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/usr/bin/env ruby
2+
# frozen_string_literal: true
3+
4+
require 'w3c_validators'
5+
6+
def validator(file)
7+
extension = File.extname(file)
8+
if extension == '.html'
9+
W3CValidators::NuValidator.new
10+
elsif extension == '.css'
11+
W3CValidators::CSSValidator.new
12+
end
13+
end
14+
15+
def validate(file)
16+
puts "Checking #{file}..."
17+
18+
path = File.expand_path "../_site/#{file}", __dir__
19+
results = validator(file).validate_file(path)
20+
21+
return puts 'Valid!' if results.errors.empty?
22+
23+
results.errors.each { |err| puts err.to_s }
24+
exit 1
25+
end
26+
27+
validate 'index.html'
28+
validate File.join 'assets', 'css', 'style.css'

0 commit comments

Comments
 (0)