Skip to content

Commit b660c6b

Browse files
committed
chore: style
1 parent 5dabddf commit b660c6b

File tree

6 files changed

+80
-30
lines changed

6 files changed

+80
-30
lines changed

src/components/issues_num/index.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import React, { FC } from 'react';
2-
import { Link } from 'gatsby';
32
import clsx from 'clsx';
43

54
import { fmtIssues } from '@utils/tools';
@@ -23,13 +22,13 @@ const IssuesNum: FC<IssuesNumProps> = (props) => {
2322
_link = `https://github.com/${rgdData.owner}/${rgdData.repo}/discussions/${props.number}`;
2423
}
2524
return (
26-
<Link
25+
<a
2726
className={clsx('number issues-num', props.className)}
28-
to={_link}
27+
href={_link}
2928
target="_blank"
3029
>
3130
{props.len ? fmtIssues(props.number, props.len) : `#${props.number}`}
32-
</Link>
31+
</a>
3332
);
3433
};
3534

src/hooks/useRepoLink.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,24 @@ import useRgd from './useRgd';
33
export default function useRepoLink() {
44
const { type, owner, repo, issues_owner, issues_repo, cname } = useRgd();
55

6-
let repoLink, repoType, dataRepo;
6+
let repoLink, repoType, dataRepo, repoTxt;
77
const siteRepo = `https://github.com/${owner}/${repo}`;
88
let rssLink = '/feed.xml';
99
if (type === 'issues') {
1010
dataRepo = `https://github.com/${issues_owner}/${issues_repo}`;
1111
repoLink = `${dataRepo}/issues`;
1212
repoType = 'issues';
13+
repoTxt = `${issues_owner}/${issues_repo}`;
1314
} else {
1415
dataRepo = siteRepo;
1516
repoLink = `${dataRepo}/discussions`;
1617
repoType = 'discussions';
18+
repoTxt = `${owner}/${repo}`;
1719
}
1820

1921
if (!/\.github\.io$/.test(repo) && !cname) {
2022
rssLink = `/${repo}/feed.xml`;
2123
}
2224

23-
return { repoLink, repoType, dataRepo, siteRepo, rssLink }
25+
return { repoLink, repoType, dataRepo, siteRepo, rssLink, repoTxt }
2426
}

src/layouts/base.tsx

Lines changed: 35 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ interface LayoutProps {
2121
export default function Layout(props: LayoutProps) {
2222
const data = useRgd();
2323
const siteData = useSite();
24-
const { siteRepo } = useRepoLink();
24+
const { dataRepo, repoTxt } = useRepoLink();
2525

2626
return (
2727
<HelmetProvider>
@@ -50,21 +50,40 @@ export default function Layout(props: LayoutProps) {
5050
<div className="content">{props.children}</div>
5151
</main>
5252
<footer>
53-
<a
54-
rel="license"
55-
href="http://creativecommons.org/licenses/by-nc-nd/4.0/"
56-
target="_blank"
57-
>
58-
<img
59-
style={{ width: 60, height: 21 }}
60-
src={require('@icons/license.svg').default}
61-
alt="License"
62-
/>
63-
</a>{' '}
64-
Copyright © {data?.website?.built_date || new Date().getFullYear()}
65-
-present
66-
<span className="owner" onClick={() => go(siteRepo)}>
67-
{data.owner}/{data.repo}
53+
<div className="license">
54+
<a
55+
rel="license"
56+
href="http://creativecommons.org/licenses/by-nc-nd/4.0/"
57+
target="_blank"
58+
>
59+
<img
60+
style={{ width: 60, height: 21 }}
61+
src={require('@icons/license.svg').default}
62+
alt="License"
63+
/>
64+
</a>
65+
</div>
66+
<div className="copyright">
67+
<span>
68+
Copyright ©{' '}
69+
{data?.website?.built_date || new Date().getFullYear()}
70+
-present
71+
</span>
72+
<a className="owner" href={dataRepo} target="_blank">
73+
{repoTxt}
74+
</a>
75+
{'.'}
76+
</div>
77+
<span className="powered">
78+
Powered by
79+
<a
80+
className="owner"
81+
title="GG (Gatsby + GitHub) - A gatsby website builder based on github discussions"
82+
href="https://github.com/lencx/gg"
83+
target="_blank"
84+
>
85+
gg
86+
</a>
6887
</span>
6988
</footer>
7089
</div>

src/styles/base.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
sans-serif;
1010

1111
--layout-header-height: 56px;
12-
--layout-footer-height: 56px;
12+
--layout-footer-height: 100px;
1313

1414
--gg-border: rgba(180, 180, 180, 0.1);
1515
}

src/styles/layout.scss

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,13 @@
2929

3030
main {
3131
padding-top: 80px;
32-
min-height: calc(100vh - var(--layout-header-height));
32+
min-height: calc(100vh - var(--layout-footer-height));
3333
background-color: var(--theme-content-background-color);
3434
}
3535

3636
footer {
37+
padding: 0 10px;
38+
position: relative;
3739
display: flex;
3840
align-items: center;
3941
justify-content: center;
@@ -42,17 +44,45 @@
4244
background-color: var(--theme-footer-background-color);
4345
font-size: 14px;
4446
color: #838c95;
45-
border-top: solid 1px rgba(120, 120, 120, 0.2);
47+
text-align: center;
48+
49+
&::after {
50+
position: absolute;
51+
top: 0;
52+
display: block;
53+
content: '';
54+
height: 1px;
55+
width: 100%;
56+
background: radial-gradient(rgba(150, 150, 150, 0.6), transparent 80%);
57+
}
4658

4759
img {
4860
vertical-align: middle;
49-
margin-right: 10px;
5061
}
5162

5263
.owner {
5364
margin-left: 5px;
5465
color: #3486e2;
5566
cursor: pointer;
67+
text-decoration: none;
68+
}
69+
70+
.copyright {
71+
margin-left: 10px;
72+
}
73+
74+
.powered {
75+
margin-left: 5px;
76+
}
77+
78+
@media screen and (max-width: 720px) {
79+
flex-direction: column;
80+
81+
.copyright,
82+
.powered {
83+
margin-top: 5px;
84+
margin-left: 0;
85+
}
5686
}
5787
}
5888
}

src/templates/labels.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import { graphql, Link } from 'gatsby';
2+
import { graphql } from 'gatsby';
33

44
import Layout from '@layouts/base';
55
import useRepoLink from '@hooks/useRepoLink';
@@ -22,14 +22,14 @@ export default function BlogCategory(props: any) {
2222
return (
2323
<Layout className="labels-page" title={`${labelsInfo.name} | Labels`}>
2424
<div className="markdown-body">
25-
<Link
26-
to={labelsLink}
25+
<a
26+
href={labelsLink}
2727
className="labels-head"
2828
style={{ background: `#${labelsInfo.color}` }}
2929
target="_blank"
3030
>
3131
{labelsInfo.name}
32-
</Link>
32+
</a>
3333

3434
{labelsInfo.description && (
3535
<div className="label-desc">{labelsInfo.description}</div>

0 commit comments

Comments
 (0)