Skip to content
This repository was archived by the owner on Oct 19, 2018. It is now read-only.

Commit d00dde4

Browse files
committed
Edit this page on Github button
1 parent 5269390 commit d00dde4

File tree

4 files changed

+116
-81
lines changed

4 files changed

+116
-81
lines changed

Diff for: .gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
node_modules
22
.cache
33
public
4+
.netlify

Diff for: src/pages/index.tsx

+4-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@ const IndexPage = () => (
66
<section className="hero">
77
<div className="hero-body">
88
<div className="container has-text-centered">
9-
<h1 className="title">Hero title</h1>
10-
<h2 className="subtitle">Hero subtitle</h2>
9+
<h1 className="title">accounts-js</h1>
10+
<h2 className="subtitle">
11+
Fullstack authentication and accounts-management for Javascript
12+
</h2>
1113
<Link className="button" to="/docs/introduction/">
1214
Get started
1315
</Link>

Diff for: src/styles/prism-github.css

+93-78
Original file line numberDiff line numberDiff line change
@@ -1,82 +1,97 @@
1-
21
/**
32
* Github-like theme for Prism.js
43
* @author Luke Askew http://github.com/lukeaskew
54
*/
6-
code,
7-
code[class*='language-'],
8-
pre[class*='language-'] {
9-
color: #333;
10-
text-align: left;
11-
white-space: pre;
12-
word-spacing: normal;
13-
tab-size: 4;
14-
hyphens: none;
15-
font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;
16-
line-height: 1.4;
17-
direction: ltr;
18-
cursor: text;
19-
}
20-
21-
pre[class*='language-'] {
22-
overflow: auto;
23-
margin: 1em 0;
24-
padding: 1.2em;
25-
border-radius: 3px;
26-
font-size: 85%;
27-
}
28-
29-
p code,
30-
li code,
31-
table code {
32-
margin: 0;
33-
border-radius: 3px;
34-
padding: 0.2em 0;
35-
font-size: 85%;
36-
}
37-
p code:before, p code:after,
38-
li code:before,
39-
li code:after,
40-
table code:before,
41-
table code:after {
42-
letter-spacing: -0.2em;
43-
content: '\00a0';
44-
}
45-
46-
code,
47-
:not(pre) > code[class*='language-'],
48-
pre[class*='language-'] {
49-
background: #f7f7f7;
50-
}
51-
52-
:not(pre) > code[class*='language-'] {
53-
padding: 0.1em;
54-
border-radius: 0.3em;
55-
}
56-
57-
.token.comment, .token.prolog, .token.doctype, .token.cdata {
58-
color: #969896;
59-
}
60-
.token.punctuation, .token.string, .token.atrule, .token.attr-value {
61-
color: #183691;
62-
}
63-
.token.property, .token.tag {
64-
color: #63a35c;
65-
}
66-
.token.boolean, .token.number {
67-
color: #0086b3;
68-
}
69-
.token.selector, .token.attr-name, .token.attr-value .punctuation:first-child, .token.keyword, .token.regex, .token.important {
70-
color: #795da3;
71-
}
72-
.token.operator, .token.entity, .token.url, .language-css .token.string {
73-
color: #a71d5d;
74-
}
75-
.token.entity {
76-
cursor: help;
77-
}
78-
79-
.namespace {
80-
opacity: 0.7;
81-
}
82-
5+
code,
6+
code[class*='language-'],
7+
pre[class*='language-'] {
8+
color: #333;
9+
text-align: left;
10+
white-space: pre;
11+
word-spacing: normal;
12+
tab-size: 4;
13+
hyphens: none;
14+
font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;
15+
line-height: 1.4;
16+
direction: ltr;
17+
cursor: text;
18+
}
19+
20+
pre[class*='language-'] {
21+
overflow: auto;
22+
margin: 1em 0;
23+
padding: 1.2em;
24+
border-radius: 3px;
25+
font-size: 85%;
26+
}
27+
28+
p code,
29+
li code,
30+
table code {
31+
margin: 0;
32+
border-radius: 3px;
33+
padding: 0.2em 0;
34+
font-size: 85%;
35+
}
36+
p code:before,
37+
p code:after,
38+
li code:before,
39+
li code:after,
40+
table code:before,
41+
table code:after {
42+
letter-spacing: -0.2em;
43+
content: '\00a0';
44+
}
45+
46+
code,
47+
:not(pre) > code[class*='language-'],
48+
pre[class*='language-'] {
49+
background: #f7f7f7;
50+
}
51+
52+
:not(pre) > code[class*='language-'] {
53+
padding: 0.1em;
54+
border-radius: 0.3em;
55+
}
56+
57+
.token.comment,
58+
.token.prolog,
59+
.token.doctype,
60+
.token.cdata {
61+
color: #969896;
62+
}
63+
.token.punctuation,
64+
.token.string,
65+
.token.atrule,
66+
.token.attr-value {
67+
color: #183691;
68+
}
69+
.token.property,
70+
.token.tag {
71+
color: #63a35c;
72+
}
73+
.token.boolean,
74+
.token.number {
75+
color: #0086b3;
76+
}
77+
.token.selector,
78+
.token.attr-name,
79+
.token.attr-value .punctuation:first-child,
80+
.token.keyword,
81+
.token.regex,
82+
.token.important {
83+
color: #795da3;
84+
}
85+
.token.operator,
86+
.token.entity,
87+
.token.url,
88+
.language-css .token.string {
89+
color: #a71d5d;
90+
}
91+
.token.entity {
92+
cursor: help;
93+
}
94+
95+
.namespace {
96+
opacity: 0.7;
97+
}

Diff for: src/templates/docs-page.tsx

+18-1
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,16 @@ const StyledLink = styled(Link)`
4444
}
4545
`;
4646

47-
export default ({ data }) => {
47+
const EditButton = styled.a`
48+
color: rgba(10,10,10,0.5) !important;
49+
`;
50+
51+
export default ({ data, pathContext }) => {
4852
const post = data.markdownRemark;
53+
let slug = pathContext.slug;
54+
// remove last char
55+
slug = slug.substring(0, slug.length - 1);
56+
console.log(slug);
4957
return (
5058
<div className="columns">
5159
<div className="column is-one-fifth">
@@ -126,6 +134,15 @@ export default ({ data }) => {
126134
className="content"
127135
dangerouslySetInnerHTML={{ __html: post.html }}
128136
/>
137+
<div className="has-text-right">
138+
<EditButton
139+
className="button is-white"
140+
href={`https://github.com/accounts-js/docs/tree/redesign-bulma/src/pages${slug}.md`}
141+
target="_blank"
142+
>
143+
Edit this page on Github
144+
</EditButton>
145+
</div>
129146
</div>
130147
</div>
131148
);

0 commit comments

Comments
 (0)