Skip to content

Commit 3a3c1d8

Browse files
committed
style: format code style
1 parent 7cdf63e commit 3a3c1d8

37 files changed

+711
-579
lines changed

README.md

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
> Modern static blog template.
44
5-
65
[中文文档](./README_CN.md)
76

87
<br />
@@ -13,7 +12,7 @@ This is the source code of my [blog](https://unix.bio).
1312

1413
You can also use this project to build your own blog.
1514

16-
Run `npm init unix-bio` or `yarn create unix-bio` to initialize.
15+
Run `npm init unix-bio` or `yarn create unix-bio` to initialize.
1716

1817
<br />
1918

@@ -25,20 +24,20 @@ First, Please make sure your [NodeJS](https://nodejs.org/en/) is in the latest v
2524

2625
2. run `npm run post` to create your post.
2726

28-
2. run `npm run dev` to browse development page.
27+
3. run `npm run dev` to browse development page.
2928

30-
3. run `npm i -g now && now` to deploy. (Default deployment to [now](https://now.sh/))
29+
4. run `npm i -g now && now` to deploy. (Default deployment to [now](https://now.sh/))
3130

3231
<br />
3332

3433
### Features
3534

3635
#### High optimization
3736

38-
- High performance optimization thanks to [next.js](http://nextjs.com/)
39-
- Perfect SEO support
40-
- High readability
41-
- Your just need to `write`
37+
- High performance optimization thanks to [next.js](http://nextjs.com/)
38+
- Perfect SEO support
39+
- High readability
40+
- Your just need to `write`
4241

4342
<p align="center">
4443
<img width="500" align="center" src="https://user-images.githubusercontent.com/11304944/77065913-1bba2000-6a1d-11ea-868c-8e96dd09ddd5.png">
@@ -54,9 +53,9 @@ You can **switch languages** in the configuration file
5453

5554
#### Write on MDXJS
5655

57-
- Full markdown support
58-
- React Components support
59-
- More customization possibilities
56+
- Full markdown support
57+
- React Components support
58+
- More customization possibilities
6059

6160
<p align="center">
6261
<img width="600" src="https://user-images.githubusercontent.com/11304944/76159776-b33a8b80-615e-11ea-9752-19827e5c900d.png">
@@ -131,4 +130,3 @@ After running the command, the generated static file will be in the `/out` direc
131130
### LICENSE
132131

133132
[MIT](./LICENSE)
134-

README_CN.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,20 @@
2222

2323
2. 运行 `npm run post` 创建你的第一篇文章。
2424

25-
2. 运行 `npm run dev` 在本地预览页面。
25+
3. 运行 `npm run dev` 在本地预览页面。
2626

27-
3. 运行 `npm i -g now && now` 命令开始部署。 (默认会部署到 [now](https://now.sh/))
27+
4. 运行 `npm i -g now && now` 命令开始部署。 (默认会部署到 [now](https://now.sh/))
2828

2929
<br />
3030

3131
### 特色
3232

3333
#### 高优化
3434

35-
- 得益于 [next.js](http://nextjs.com/)[@zeit-ui/react](https://react.zeit-ui.co/) 的高性能优化与混合渲染
36-
- 完善的 SEO 支持和服务端渲染
37-
- 高可读性支持
38-
- 你只需要专注于写作
35+
- 得益于 [next.js](http://nextjs.com/)[@zeit-ui/react](https://react.zeit-ui.co/) 的高性能优化与混合渲染
36+
- 完善的 SEO 支持和服务端渲染
37+
- 高可读性支持
38+
- 你只需要专注于写作
3939

4040
<p align="center">
4141
<img width="500" align="center" src="https://user-images.githubusercontent.com/11304944/77065913-1bba2000-6a1d-11ea-868c-8e96dd09ddd5.png">
@@ -51,9 +51,9 @@
5151

5252
#### 在 MDXJS 下开始写作
5353

54-
- 完善的 Markdown 语法支持
55-
- 可以在 Markdown 种使用 React 组件
56-
- 更多定制组件的可能性
54+
- 完善的 Markdown 语法支持
55+
- 可以在 Markdown 种使用 React 组件
56+
- 更多定制组件的可能性
5757

5858
<p align="center">
5959
<img width="600" src="https://user-images.githubusercontent.com/11304944/76159776-b33a8b80-615e-11ea-9752-19827e5c900d.png">
@@ -132,4 +132,3 @@ npm run export
132132
### 协议
133133

134134
[MIT](./LICENSE)
135-

blog.config.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
21
const BLOG = {
32
author: 'Witt',
43
title: 'Witt - unix.bio',
5-
description: 'Hi, I\'m Witt. A JavaScript full stack engineer, I\'m creating apps and libs to help improve the developer experience.',
4+
description:
5+
"Hi, I'm Witt. A JavaScript full stack engineer, I'm creating apps and libs to help improve the developer experience.",
66
summary: 'JavaScript 工程师,对开发者体验感兴趣。',
77
language: 'zh-cn',
88
latestLimit: 5,
@@ -17,11 +17,11 @@ const BLOG = {
1717
github: 'unix',
1818
twitter: 'echo_witt',
1919
domain: 'unix.bio',
20-
20+
2121
googleAnalytics: 'UA-110371817-3',
2222
cn: true,
2323
enableViews: true,
24-
24+
2525
layouts: {
2626
pageWidth: '750px',
2727
pageWidthMobile: '88vw',

lib/components/contacts.jsx

Lines changed: 86 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -10,90 +10,110 @@ const Contacts = ({ isDetailPage = false }) => {
1010
const configs = useConfigs()
1111
const isDark = useMemo(() => theme.type === 'dark', [theme.type])
1212
const switchTheme = () => configs.onChange(theme.type === 'dark')
13-
13+
1414
const themeTitle = Configs.isCN() ? '切换主题' : 'Switch themes'
1515
const linkProps = {
1616
rel: 'noreferrer',
1717
target: '_blank',
1818
}
19-
19+
2020
return (
2121
<>
2222
<div className="contacts">
23-
{isDetailPage && <Divider y={.5} />}
23+
{isDetailPage && <Divider y={0.5} />}
2424
<div className="between">
2525
<div className="socials">
26-
{Configs.email && <Link aria-label="email" href={Configs.email} {...linkProps}>Email</Link> }
27-
{Configs.github && <Link aria-label="github" href={Configs.github} {...linkProps}>Github</Link>}
28-
{Configs.twitter && <Link aria-label="twitter" href={Configs.twitter} {...linkProps}>Twitter</Link>}
26+
{Configs.email && (
27+
<Link aria-label="email" href={Configs.email} {...linkProps}>
28+
Email
29+
</Link>
30+
)}
31+
{Configs.github && (
32+
<Link aria-label="github" href={Configs.github} {...linkProps}>
33+
Github
34+
</Link>
35+
)}
36+
{Configs.twitter && (
37+
<Link aria-label="twitter" href={Configs.twitter} {...linkProps}>
38+
Twitter
39+
</Link>
40+
)}
2941
</div>
3042
<div>
31-
{isDark && <span title={themeTitle}><SunIcon onClick={switchTheme} size={16} /></span>}
32-
{!isDark && <span title={themeTitle}><MoonIcon onClick={switchTheme} size={16} /></span>}
43+
{isDark && (
44+
<span title={themeTitle}>
45+
<SunIcon onClick={switchTheme} size={16} />
46+
</span>
47+
)}
48+
{!isDark && (
49+
<span title={themeTitle}>
50+
<MoonIcon onClick={switchTheme} size={16} />
51+
</span>
52+
)}
3353
</div>
3454
</div>
35-
55+
3656
<style jsx>{`
37-
.contacts {
38-
width: ${Configs.layouts.pageWidth};
39-
padding: 0 ${theme.layout.gapQuarter};
40-
position: absolute;
41-
z-index: 1;
42-
bottom: 3.5rem;
43-
left: 50%;
44-
transform: translateX(-50%);
45-
color: ${theme.palette.accents_6};
46-
}
47-
48-
.between {
49-
display: flex;
50-
justify-content: space-between;
51-
align-items: center;
52-
}
53-
54-
.contacts :global(svg) {
55-
cursor: pointer;
56-
margin: ${theme.layout.gapQuarter} ${theme.layout.gapHalf};
57-
position: relative;
58-
color: inherit;
59-
z-index: 2;
60-
}
61-
62-
.contacts :global(a) {
63-
color: inherit;
64-
}
65-
66-
.socials :global(a) {
67-
margin-right: .5rem;
68-
font-size: .75rem;
69-
text-transform: uppercase;
70-
}
71-
72-
.contacts span {
73-
color: inherit;
74-
display: inline-flex;
75-
justify-content: center;
76-
align-items: center;
77-
}
78-
79-
.contacts span:hover {
80-
color: ${theme.palette.accents_4};
81-
}
82-
83-
.contacts :global(a:hover) {
84-
color: ${theme.palette.accents_4};
85-
text-decoration: underline dashed;
86-
cursor: ne-resize;
87-
transition: all 150ms ease;
88-
}
89-
90-
@media only screen and (max-width: ${theme.layout.breakpointMobile}) {
9157
.contacts {
58+
width: ${Configs.layouts.pageWidth};
59+
padding: 0 ${theme.layout.gapQuarter};
9260
position: absolute;
93-
width: ${Configs.layouts.pageWidthMobile};
61+
z-index: 1;
62+
bottom: 3.5rem;
63+
left: 50%;
64+
transform: translateX(-50%);
65+
color: ${theme.palette.accents_6};
66+
}
67+
68+
.between {
69+
display: flex;
70+
justify-content: space-between;
71+
align-items: center;
72+
}
73+
74+
.contacts :global(svg) {
75+
cursor: pointer;
76+
margin: ${theme.layout.gapQuarter} ${theme.layout.gapHalf};
77+
position: relative;
78+
color: inherit;
79+
z-index: 2;
80+
}
81+
82+
.contacts :global(a) {
83+
color: inherit;
84+
}
85+
86+
.socials :global(a) {
87+
margin-right: 0.5rem;
88+
font-size: 0.75rem;
89+
text-transform: uppercase;
90+
}
91+
92+
.contacts span {
93+
color: inherit;
94+
display: inline-flex;
95+
justify-content: center;
96+
align-items: center;
97+
}
98+
99+
.contacts span:hover {
100+
color: ${theme.palette.accents_4};
101+
}
102+
103+
.contacts :global(a:hover) {
104+
color: ${theme.palette.accents_4};
105+
text-decoration: underline dashed;
106+
cursor: ne-resize;
107+
transition: all 150ms ease;
108+
}
109+
110+
@media only screen and (max-width: ${theme.layout.breakpointMobile}) {
111+
.contacts {
112+
position: absolute;
113+
width: ${Configs.layouts.pageWidthMobile};
114+
}
94115
}
95-
}
96-
`}</style>
116+
`}</style>
97117
</div>
98118
<Spacer y={3.5} />
99119
</>

lib/components/home.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const Home = () => {
55
return (
66
<div className="home">
77
<Profile />
8-
8+
99
<style jsx>{`
1010
.home {
1111
width: 100%;

0 commit comments

Comments
 (0)