Skip to content

Commit 5a6ebcd

Browse files
authored
Merge branch 'fullstack-hy2020:source' into source
2 parents 363847c + 0c80c96 commit 5a6ebcd

File tree

533 files changed

+60073
-57504
lines changed

Some content is hidden

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

533 files changed

+60073
-57504
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,6 @@ yarn-error.log
6868
.pnp.js
6969
# Yarn Integrity file
7070
.yarn-integrity
71+
72+
73+
.nvmrc

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v10.18.1

CONTRIBUTING.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Running Full stack open on your environment
2+
3+
1. Fork the repository
4+
2. Clone your fork
5+
3. Verify that you are running Node version 10 ([NVM](https://github.com/nvm-sh/nvm) recommended for managing node versions)
6+
5. Install gatsby globally `npm install -g gatsby-cli`
7+
4. Install dependencies with `npm install`
8+
5. Start the application with `npm start`
9+
10+
# Setting up the PR
11+
12+
1. Prettify your code with `npm run format`
13+
2. Create a new branch for your changes
14+
3. Create the PR from that branch to the source branch

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# Full stack open 2020
1+
# Full stack open
2+
3+
Despite the repo name this IS the current course repository
24

35
<https://fullstackopen.com/>
46

gatsby-config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ const plugins = [
4444
createSearchConfig('finnish', 'fi'),
4545
createSearchConfig('english', 'en'),
4646
createSearchConfig('chinese', 'zh'),
47+
createSearchConfig('portuguese', 'ptbr'),
4748
{
4849
resolve: `gatsby-plugin-sitemap`,
4950
},

gatsby-node.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ exports.createPages = ({ actions, graphql }) => {
4747
lang: lang,
4848
},
4949
});
50-
} else if (!isEmpty(navigation[lang][part]) && frontmatter.letter) {
50+
} else if (navigation[lang] && !isEmpty(navigation[lang][part]) && frontmatter.letter) {
5151
createPage({
5252
path:
5353
lang === 'fi'

gatsby-ssr.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
export { default as wrapPageElement } from './wrapPageElement';
2-
export { default as wrapRootElement } from './wrapRootElement';
2+
export { default as wrapRootElement } from './wrapRootElement';
3+
export { default as onRenderBody } from './onRenderBody';

onRenderBody.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import React from 'react';
2+
3+
const onRenderBody = ({ setHeadComponents }) => {
4+
const initializeTheme = `
5+
(function() {
6+
try {
7+
const savedTheme = localStorage.getItem('selected_theme');
8+
9+
if (savedTheme) {
10+
document.documentElement.dataset.theme = savedTheme;
11+
} else if (
12+
window.matchMedia &&
13+
window.matchMedia('(prefers-color-scheme: dark)').matches
14+
) {
15+
document.documentElement.dataset.theme = 'dark';
16+
}
17+
} catch (e) {}
18+
})();
19+
`;
20+
21+
setHeadComponents([
22+
<script
23+
key="initialize-theme"
24+
dangerouslySetInnerHTML={{
25+
__html: initializeTheme,
26+
}}
27+
/>,
28+
]);
29+
};
30+
31+
export default onRenderBody;

0 commit comments

Comments
 (0)