Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
docs:update readme yihong0618#134
  • Loading branch information
duanfei committed May 31, 2021
1 parent aa4db87 commit 0a63cc1
Show file tree
Hide file tree
Showing 11 changed files with 120 additions and 119 deletions.
7 changes: 4 additions & 3 deletions README-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
R.I.P. 希望大家都能健康顺利的跑过终点,逝者安息。

# [打造个人跑步主页](https://yihong.run/running)
[English](README-EN.md) | 简体中文
[English](README-EN.md) | 简体中文 | [Wiki](https://wiki.mfydev.run/)

<details>
<summary>GIF 展示</summary>
Expand Down Expand Up @@ -509,8 +509,9 @@ Actions [源码](https://github.com/yihong0618/running_page/blob/master/.github/
# 特别感谢
- @[flopp](https://github.com/flopp) 特别棒的项目 [GpxTrackPoster](https://github.com/flopp/GpxTrackPoster)
- @[shaonianche](https://github.com/shaonianche) icon 设计及文档
- @[geekplux](https://github.com/geekplux) 帮助及鼓励, 重构了前端代码,学到了不少~
- @[ben-29](https://github.com/ben-29) 搞定了咕咚,和我一起搞定了悦跑圈,太厉害了。
- @[geekplux](https://github.com/geekplux) 帮助及鼓励, 重构了前端代码,学到了不少
- @[ben-29](https://github.com/ben-29) 搞定了咕咚,和我一起搞定了悦跑圈,太厉害了
- @[MFYDev](https://github.com/MFYDev) Wiki

# 赞赏
谢谢就够了
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
</p>


English | [简体中文](https://github.com/yihong0618/running_page/blob/master/README-CN.md)
English | [简体中文](https://github.com/yihong0618/running_page/blob/master/README-CN.md)| [Wiki](https://wiki.mfydev.run/)

## [Runner's Page Show](https://github.com/yihong0618/running_page/issues/12)

Expand Down Expand Up @@ -432,7 +432,8 @@ Before submitting PR:

- @[flopp](https://github.com/flopp) great repo [GpxTrackPoster](https://github.com/flopp/GpxTrackPoster)
- @[shaonianche](https://github.com/shaonianche) icon design and doc
- @[geekplux](https://github.com/geekplux) Friendly help and encouragement, refactored the whole front-end code, learned a lot~
- @[geekplux](https://github.com/geekplux) Friendly help and encouragement, refactored the whole front-end code, learned a lot
- @[MFYDev](https://github.com/MFYDev) Wiki

# Support
Thanks is enough.
13 changes: 12 additions & 1 deletion gatsby-config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
module.exports = {
pathPrefix: '/', // Change to `/running_page` when running on github pages
siteMetadata: {
title: 'Running page',
siteTitle: 'Running',
siteUrl: 'https://yihong.run',
logo: 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQTtc69JxHNcmN1ETpMUX4dozAgAN6iPjWalQ&usqp=CAU',
description: 'Personal site and blog',
navLinks: [
{
name: 'Blog',
url: 'https://yihong.run/running',
},
{
name: 'About',
url: 'https://github.com/yihong0618/running_page/blob/master/README-CN.md',
},
],
},
plugins: [
'gatsby-transformer-json',
Expand Down
55 changes: 24 additions & 31 deletions src/components/Header/index.jsx
Original file line number Diff line number Diff line change
@@ -1,43 +1,36 @@
import React from 'react';
import { Link } from 'gatsby';
import { AVATAR, NAVS } from 'src/utils/const';
import React from 'react';
import useSiteMetadata from 'src/hooks/useSiteMetadata';

const Header = ({ siteTitle }) => {
if (!AVATAR && !NAVS) return null;
const { logo, siteUrl, navLinks } = useSiteMetadata();

return (
<>
<div>
<nav
className="db flex justify-between w-100 ph5-l"
style={{ marginTop: '3rem' }}
>
{AVATAR && (
<div className="dib w-25 v-mid">
<Link to="/" className="link dim">
<picture>
<img
className="dib w3 h3 br-100"
alt={siteTitle || 'avatar'}
src={AVATAR}
/>
</picture>
</Link>
</div>
)}
{NAVS && (
<div className="dib w-75 v-mid tr">
{NAVS.map((n, i) => (
<a
key={i}
href={n.link}
className="light-gray link dim f6 f5-l mr3 mr4-l"
>
{n.text}
</a>
))}
</div>
)}
<div className="dib w-25 v-mid">
<Link to={siteUrl} className="link dim">
<picture>
<img className="dib w3 h3 br-100" alt="logo" src={logo} />
</picture>
</Link>
</div>
<div className="dib w-75 v-mid tr">
{navLinks.map((n, i) => (
<a
key={i.name}
href={n.url}
className="light-gray link dim f6 f5-l mr3 mr4-l"
>
{n.name}
</a>
))}
</div>
</nav>
</>
</div>
);
};

Expand Down
11 changes: 7 additions & 4 deletions src/components/Layout/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,21 @@ import 'src/styles/index.scss';
import styles from './style.module.scss';

const Layout = ({ children }) => {
const { title, description } = useSiteMetadata();
const { siteTitle, description } = useSiteMetadata();

return (
<div>
<Helmet bodyAttributes={{ class: styles.body }}>
<html lang="en" />
<title>{title}</title>
{/* <title>{title}</title> */}
<meta name="description" content={description} />
<meta name="keywords" content="running" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, shrink-to-fit=no"
/>
</Helmet>
<Header title={title} />
<Header title={siteTitle} />
<div className="pa3 pa5-l">{children}</div>
</div>
);
Expand Down
7 changes: 6 additions & 1 deletion src/components/Layout/style.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@
h1,
h3,
h4,
li {
li,
a {
color: $nike;
text-decoration:none;
}
h1 {
font-size: 3.5rem;
}
}
10 changes: 6 additions & 4 deletions src/components/LocationStat/index.jsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
import React from 'react';
import YearStat from 'src/components/YearStat';
import LocationSummary from './LocationSummary';
import { CHINESE_LOCATION_INFO_MESSAGE_FIRST, CHINESE_LOCATION_INFO_MESSAGE_SECOND } from '../../utils/const';
import CitiesStat from './CitiesStat';
import LocationSummary from './LocationSummary';
import PeriodStat from './PeriodStat';
import { CHINESE_LOCATION_INFO_MESSAGE_FIRST, CHINESE_LOCATION_INFO_MESSAGE_SECOND } from '../../utils/const'

const LocationStat = ({ changeYear, changeCity, changeTitle }) => (
<div className="fl w-100 w-30-l pb5 pr5-l">
<section className="pb4" style={{ paddingBottom: '0rem' }}>
<p>
{CHINESE_LOCATION_INFO_MESSAGE_FIRST}.
{CHINESE_LOCATION_INFO_MESSAGE_FIRST}
.
<br />
{CHINESE_LOCATION_INFO_MESSAGE_SECOND}.
{CHINESE_LOCATION_INFO_MESSAGE_SECOND}
.
<br />
<br />
Yesterday you said tomorrow.
Expand Down
11 changes: 8 additions & 3 deletions src/hooks/useSiteMetadata.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
import { useStaticQuery, graphql } from 'gatsby';
import { graphql, useStaticQuery } from 'gatsby';

const useSiteMetadata = () => {
const { site } = useStaticQuery(
graphql`
query SiteMetaData {
site {
siteMetadata {
title
siteTitle
siteUrl
description
logo
navLinks {
name
url
}
}
}
}
`
`,
);
return site.siteMetadata;
};
Expand Down
32 changes: 17 additions & 15 deletions src/pages/404.jsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
import React from 'react';
import Layout from 'src/components/Layout';
import useSiteMetadata from 'src/hooks/useSiteMetadata';

const NotFoundPage = () => (
<Layout>
<h1 className="f-headline">404</h1>
<p>This page doesn&#39;t exist.</p>
<p className="moon-gray">
If you wanna more message, you could visit{' '}
<a
className="moon-gray b"
href="https://github.com/yihong0618/running_page"
>
https://github.com/yihong0618/running_page
</a>
</p>
</Layout>
);
const NotFoundPage = () => {
const { siteUrl } = useSiteMetadata();
return (
<Layout>
<h1 className="f-headline">404</h1>
<p>This page doesn&#39;t exist.</p>
<p className="moon-gray">
If you wanna more message, you could visit
{' '}
<a className="moon-gray b" href={siteUrl}>
{siteUrl}
</a>
</p>
</Layout>
);
};

export default NotFoundPage;
Loading

0 comments on commit 0a63cc1

Please sign in to comment.