Skip to content

Commit 393876b

Browse files
committed
Upgrade theme
1 parent ebe7350 commit 393876b

File tree

280 files changed

+40324
-17352
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

280 files changed

+40324
-17352
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,5 @@ vendor/bundle
4444
.jekyll-metadata
4545
*.gem
4646
_zip
47+
48+
#<removed>

.prettierignore

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
package.json
2+
*.md
3+
*.html
4+
*.scss
5+
*.css
6+
_js/lib

.scripts/build-css.js

+24-24
Original file line numberDiff line numberDiff line change
@@ -11,42 +11,41 @@ const writeFile = promisify(fs.writeFile);
1111

1212
const ENC = 'utf-8';
1313

14-
const INLINE_REGEX = /(.*)\s*\/\/\s*inline\s*$/uigm;
15-
const DEFER_REGEX = /(.*)\s*\/\/\s*link\s*$/uigm;
16-
const INLINE_BLOCK_REGEX = /\/\/\s*>*\s*<{3,}\s*inline([\s\S]*?)\/\/\s*>{3,}.*/uigm;
17-
const DEFER_BLOCK_REGEX = /\/\/\s*>*\s*<{3,}\s*link([\s\S]*?)\/\/\s*>{3,}.*/uigm;
14+
const INLINE_REGEX = /(.*)\s*\/\/\s*inline\s*$/gimu;
15+
const DEFER_REGEX = /(.*)\s*\/\/\s*link\s*$/gimu;
16+
const INLINE_BLOCK_REGEX = /\/\/\s*>*\s*<{3,}\s*inline([\s\S]*?)\/\/\s*>{3,}.*/gimu;
17+
const DEFER_BLOCK_REGEX = /\/\/\s*>*\s*<{3,}\s*link([\s\S]*?)\/\/\s*>{3,}.*/gimu;
1818

1919
function genHeader(filename) {
20-
return `/*
21-
* THIS FILE IS AUTOGENERATED, DO NOT MODIFY!
22-
*
23-
* To change the contents of this file,
24-
* edit \`${filename}\`
25-
* and run \`npm run build:css\`.
26-
*
27-
* During development you can run \`npm run watch:css\`
28-
* to continuosly rebuild this file.
29-
*/
30-
20+
return `// THIS FILE IS AUTOGENERATED, DO NOT MODIFY!
21+
//
22+
// To change the contents of this file,
23+
// edit \`${filename}\`
24+
// and run \`npm run build:css\`.
25+
//
26+
// During development you can run \`npm run watch:css\`
27+
// to continuosly rebuild this file.
28+
//
3129
`;
3230
}
3331

3432
// <https://stackoverflow.com/a/45130990/870615>
3533
async function getFiles(dir) {
3634
const subdirs = await readdir(dir);
37-
const files = await Promise.all(subdirs.map(async (subdir) => {
38-
const res = resolve(dir, subdir);
39-
return (await stat(res)).isDirectory() ? getFiles(res) : res;
40-
}));
35+
const files = await Promise.all(
36+
subdirs.map(async subdir => {
37+
const res = resolve(dir, subdir);
38+
return (await stat(res)).isDirectory() ? getFiles(res) : res;
39+
}),
40+
);
4141
return files.reduce((a, f) => a.concat(f), []);
4242
}
4343

4444
(async function main() {
4545
try {
4646
const files = process.argv.length > 2 ? [process.argv[2]] : await getFiles('_sass');
47-
await Promise.all(files
48-
.filter(f => f.endsWith('.pre.scss'))
49-
.map(async (file) => {
47+
await Promise.all(
48+
files.filter(f => f.endsWith('.pre.scss')).map(async file => {
5049
const content = await readFile(file, ENC);
5150
const name = basename(file, '.pre.scss');
5251
const filename = format({ name, ext: '.scss' });
@@ -71,10 +70,11 @@ async function getFiles(dir) {
7170
writeFile(resolve(dir, '__inline', filename), header + inline, ENC),
7271
writeFile(resolve(dir, '__link', filename), header + defer, ENC),
7372
]);
74-
}));
73+
}),
74+
);
7575
process.exit(0);
7676
} catch (e) {
7777
console.error(e); // eslint-disable-line
7878
process.exit(1);
7979
}
80-
}());
80+
})();

Gemfile

+6-9
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,17 @@ gem "jekyll"
1616

1717
# If you have any plugins, put them here!
1818
group :jekyll_plugins do
19-
# gem "jekyll-avatar"
20-
# gem "jekyll-default-layout"
19+
gem "jekyll-default-layout"
2120
gem "jekyll-feed"
22-
# gem "jekyll-gist"
23-
# gem "jekyll-optional-front-matter"
21+
gem "jekyll-optional-front-matter"
2422
gem "jekyll-paginate"
25-
# gem "jekyll-readme-index"
26-
# gem "jekyll-redirect-from"
23+
gem "jekyll-readme-index"
24+
gem "jekyll-redirect-from"
2725
gem "jekyll-relative-links"
28-
# gem "jekyll-remote-theme"
2926
gem "jekyll-seo-tag"
3027
gem "jekyll-sitemap"
31-
gem 'jemoji'
32-
# gem "jekyll-titles-from-headings"
28+
gem "jekyll-titles-from-headings"
29+
gem "jemoji"
3330
end
3431

3532
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem

Gemfile.lock

+21-6
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ GEM
88
em-websocket (0.5.1)
99
eventmachine (>= 0.12.9)
1010
http_parser.rb (~> 0.6.0)
11-
eventmachine (1.2.5)
12-
ffi (1.9.23)
11+
eventmachine (1.2.7)
12+
ffi (1.9.25)
1313
forwardable-extended (2.6.0)
1414
http_parser.rb (0.6.0)
1515
i18n (0.9.5)
1616
concurrent-ruby (~> 1.0)
17-
jekyll (3.7.3)
17+
jekyll (3.8.3)
1818
addressable (~> 2.4)
1919
colorator (~> 1.0)
2020
em-websocket (~> 0.5)
@@ -27,20 +27,30 @@ GEM
2727
pathutil (~> 0.9)
2828
rouge (>= 1.7, < 4)
2929
safe_yaml (~> 1.0)
30-
jekyll-feed (0.9.3)
30+
jekyll-default-layout (0.1.4)
31+
jekyll (~> 3.0)
32+
jekyll-feed (0.10.0)
3133
jekyll (~> 3.3)
34+
jekyll-optional-front-matter (0.3.0)
35+
jekyll (~> 3.0)
3236
jekyll-paginate (1.1.0)
37+
jekyll-readme-index (0.2.0)
38+
jekyll (~> 3.0)
39+
jekyll-redirect-from (0.14.0)
40+
jekyll (~> 3.3)
3341
jekyll-relative-links (0.5.3)
3442
jekyll (~> 3.3)
3543
jekyll-sass-converter (1.5.2)
3644
sass (~> 3.4)
37-
jekyll-seo-tag (2.4.0)
45+
jekyll-seo-tag (2.5.0)
3846
jekyll (~> 3.3)
3947
jekyll-sitemap (1.2.0)
4048
jekyll (~> 3.3)
49+
jekyll-titles-from-headings (0.5.1)
50+
jekyll (~> 3.3)
4151
jekyll-watch (2.0.0)
4252
listen (~> 3.0)
43-
kramdown (1.16.2)
53+
kramdown (1.17.0)
4454
liquid (4.0.0)
4555
listen (3.1.5)
4656
rb-fsevent (~> 0.9, >= 0.9.4)
@@ -67,11 +77,16 @@ PLATFORMS
6777

6878
DEPENDENCIES
6979
jekyll
80+
jekyll-default-layout
7081
jekyll-feed
82+
jekyll-optional-front-matter
7183
jekyll-paginate
84+
jekyll-readme-index
85+
jekyll-redirect-from
7286
jekyll-relative-links
7387
jekyll-seo-tag
7488
jekyll-sitemap
89+
jekyll-titles-from-headings
7590
tzinfo-data
7691

7792
BUNDLED WITH

_config.yml

+58-22
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ baseurl: /UWP-Develop-Tutorial
1919

2020
# Language of your content in 2-letter code, e.g.: en, de.
2121
# You may also provide a location, e.g.: en-us, de_AT.
22-
lang: zh-cn
22+
lang: cn
2323

2424
# The title of your blog. Used in the sidebar and the browser tab.
2525
title: UWP 平台开发系列教程
@@ -59,7 +59,7 @@ copyright: © TotoroQ 2018. All rights reserved.
5959
# href: /cookies-policy/
6060

6161
# Format of the permalinks
62-
permalink: pretty
62+
permalink: /:categories/:year-:month-:day-:title/
6363

6464
# Pagination configuration (used by the `blog` layout)
6565
paginate: 5
@@ -71,18 +71,52 @@ paginate_path: /page-:num/
7171

7272
# Sidebar image and theme color of the site.
7373
accent_image: /assets/img/sidebar-bg.jpg
74-
accent_color: '#4fb1ba'
74+
accent_color: rgb(79,177,186)
75+
76+
# This is used for the `theme-color` meta tag,
77+
# which changes the background color of the browser UI in certain browsers.
78+
# Defaults to `accent_color`.
79+
theme_color: rgb(25,55,71)
7580

7681
# The string encoding which fonts to fetch from Google Fonts.
77-
# See: <https://qwtel.com/hydejack/docs/configuration/>
78-
google_fonts: Roboto+Slab:700|Noto+Sans:400,400i,700,700i
82+
# See: <https://hydejack.com/docs/configuration/>
83+
google_fonts: Roboto+Slab:400|Noto+Sans:400,400i,700,700i
7984

8085
# The text font. Expects a string that is a valid CSS font-family value.
86+
# To change font-weight, see _sass/variables.scss
8187
font: Noto Sans, Helvetica, Arial, sans-serif
8288

8389
# The font used for headings. Expects a string that is a valid CSS font-family value.
90+
# To change font-weight, see _sass/variables.scss
8491
font_heading: Roboto Slab, Helvetica, Arial, sans-serif
8592

93+
defaults:
94+
- scope:
95+
path: hyde
96+
values:
97+
accent_color: rgb(38,139,210)
98+
accent_image:
99+
background: rgb(32,32,32)
100+
overlay: false
101+
102+
# `jekyll-seo-tag` will mark collection outputs as `BlogPosting`,
103+
# but we want them to be `WebPage`s:
104+
- scope:
105+
type: projects
106+
values:
107+
seo:
108+
type: WebPage
109+
- scope:
110+
type: featured_categories
111+
values:
112+
seo:
113+
type: WebPage
114+
- scope:
115+
type: featured_tags
116+
values:
117+
seo:
118+
type: WebPage
119+
86120
# 3rd Party Integrations
87121
# ----------------------------------------------------------------------------------------
88122

@@ -142,18 +176,25 @@ hydejack:
142176
# When enabled, no user-related data will be stored until the user gives consent.
143177
cookies_banner: false
144178

145-
179+
# ⚡️ DANGER ZONE ⚡️
180+
# ----------------
181+
# This is an _experimental_ feature.
182+
# Only use if you know what Service Workers are and how they can impact your site!
183+
# Coding skills highly recommended.
184+
offline:
185+
enabled: true
186+
cache_version: 1
146187

147188
# Collections
148189
# ========================================================================================
149190

150191
collections:
151192
featured_categories:
152-
permalink: /category/:name/
193+
permalink: /:name/
153194
output: true
154195

155196
featured_tags:
156-
permalink: /tag/:name/
197+
permalink: /tag-:name/
157198
output: true
158199

159200
projects:
@@ -171,6 +212,8 @@ exclude:
171212
- node_modules
172213
- package.json
173214
- package-lock.json
215+
- webpack.config.js
216+
- "*.gemspec"
174217
include:
175218
- LICENSE.md
176219

@@ -179,20 +222,17 @@ include:
179222
# ========================================================================================
180223

181224
plugins:
182-
# - jekyll-avatar
183-
# - jekyll-default-layout
225+
- jekyll-default-layout
184226
- jekyll-feed
185-
# - jekyll-gist
186-
# - jekyll-optional-front-matter
227+
- jekyll-optional-front-matter
187228
- jekyll-paginate
188-
# - jekyll-readme-index
189-
# - jekyll-redirect-from
229+
- jekyll-readme-index
230+
- jekyll-redirect-from
190231
- jekyll-relative-links
191-
# - jekyll-remote-theme
192232
- jekyll-seo-tag
193233
- jekyll-sitemap
234+
- jekyll-titles-from-headings
194235
- jemoji
195-
# - jekyll-titles-from-headings
196236

197237
# Theme
198238
# ---------------------------------------------------------------------------------------
@@ -237,6 +277,7 @@ optional_front_matter:
237277

238278
readme_index:
239279
remove_originals: true
280+
with_frontmatter: true
240281

241282
relative_links:
242283
collections: true
@@ -261,9 +302,4 @@ compress_html:
261302
envs: [development]
262303

263304
sass:
264-
style: compressed
265-
266-
# If you are upgrading form v5 (or earlier), uncomment the lines below,
267-
# so that the location of the feed XML stays the same.
268-
# feed:
269-
# path: atom.xml
305+
style: compressed

_includes/body/analytics.html

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{% if site.google_analytics %}
2+
<script>
3+
window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;
4+
5+
/*{% if site.hydejack.cookies_banner %}*/
6+
if (navigator.CookiesOK) {
7+
ga('create', '{{ site.google_analytics }}', 'auto');
8+
} else if (document.cookie.indexOf("hy--cookies-ok=true") > -1) {
9+
ga('create', '{{ site.google_analytics }}', {
10+
'storage': 'none',
11+
'clientId': localStorage ? localStorage.getItem('ga--client-id') : undefined
12+
});
13+
} else {
14+
ga('create', '{{ site.google_analytics }}', {
15+
'storage': 'none'
16+
});
17+
ga('set', 'forceSSL', true);
18+
ga('set', 'anonymizeIp', true);
19+
}
20+
/*{% else %}*/
21+
ga('create', '{{ site.google_analytics }}', 'auto');
22+
/*{% endif %}*/
23+
24+
var pushStateEl = document.getElementsByTagName('hy-push-state')[0];
25+
var timeoutId;
26+
pushStateEl.addEventListener('hy-push-state-load', function() {
27+
window.clearTimeout(timeoutId);
28+
timeoutId = window.setTimeout(function() {
29+
ga('set', 'page', window.location.pathname);
30+
ga('send', 'pageview');
31+
}, 500);
32+
});
33+
34+
window.loadJSDeferred('https://www.google-analytics.com/analytics.js');
35+
</script>
36+
{% endif %}

_includes/body/comments.html

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{% assign disqus = site.disqus | default:site.disqus_shortname %}
2+
{% if disqus and page.comments %}
3+
<aside class="comments related" role="complementary">
4+
<h2 class="hr">{{ site.data.strings.comments | default:"Comments" }}</h2>
5+
<div id="disqus_thread"></div>
6+
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript" rel="nofollow">comments powered by Disqus.</a></noscript>
7+
</aside>
8+
{% endif %}

0 commit comments

Comments
 (0)