Skip to content

Commit

Permalink
Added icons
Browse files Browse the repository at this point in the history
Housekeeping
Cleaning
Optimized MDX layout
Done hooks
Added footer
More light/dark theme
  • Loading branch information
Marvin Heilemann committed Jan 12, 2020
1 parent e4fdc15 commit 627239a
Show file tree
Hide file tree
Showing 66 changed files with 772 additions and 173 deletions.
4 changes: 3 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{
"cSpell.words": [
"dayjs",
"taskz"
"dribbble",
"taskz",
"xing"
],
"todo-tree.filtering.excludeGlobs": [
"**/*.md",
Expand Down
Binary file modified assets/assets.sketch
Binary file not shown.
25 changes: 24 additions & 1 deletion gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,30 @@ module.exports = {
'gatsby-transformer-json',
'gatsby-plugin-sharp',
'gatsby-transformer-sharp',
`gatsby-plugin-mdx`,
{
resolve: 'gatsby-plugin-react-svg',
options: {
rule: {
include: /\.svg$/,
options: {
props: {
preserveAspectRatio: 'xMidYMid meet',
width: '100%',
height: '100%',
},
},
},
},
},
{
resolve: `gatsby-plugin-mdx`,
options: {
defaultLayouts: {
// would work, but can not pass props to it so useless to give e.g. a page title
// default: require.resolve('./src/templates/PageSingle.jsx'),
},
},
},
{
resolve: `gatsby-source-filesystem`,
options: {
Expand Down
14 changes: 14 additions & 0 deletions metadata.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,20 @@ module.exports = {
link: '/writings',
},
],
footerLinks: [
{
name: 'Credits',
link: '/credits',
},
{
name: 'Changelog',
link: '/changelog',
},
{
name: 'Imprint',
link: '/imprint',
},
],
socialLinks: [
{
name: 'Twitter',
Expand Down
98 changes: 98 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"gatsby-plugin-preact": "^3.1.25",
"gatsby-plugin-purgecss": "^4.0.1",
"gatsby-plugin-react-helmet": "^3.1.21",
"gatsby-plugin-react-svg": "^3.0.0",
"gatsby-plugin-remove-generator": "^1.0.4",
"gatsby-plugin-robots-txt": "^1.5.0",
"gatsby-plugin-sass": "^2.1.27",
Expand All @@ -71,7 +72,9 @@
"gatsby-transformer-json": "^2.2.25",
"gatsby-transformer-remark": "^2.6.48",
"gatsby-transformer-sharp": "^2.3.12",
"ionicons": "^4.6.3",
"kleur": "^3.0.3",
"lodash": "^4.17.15",
"node-sass": "^4.13.0",
"postcss-easing-gradients": "^3.0.1",
"preact": "^10.2.1",
Expand Down
62 changes: 62 additions & 0 deletions src/components/Icon.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import React from 'react'

import AngularIcon from '../images/icons/angular.svg'
import AppleIcon from '../images/icons/apple.svg'
import CodepenIcon from '../images/icons/codepen.svg'
import DiscordIcon from '../images/icons/discord.svg'
import DribbbleIcon from '../images/icons/dribbble.svg'
import GithubIcon from '../images/icons/github.svg'
import HackernewsIcon from '../images/icons/hackernews.svg'
import InstagramIcon from '../images/icons/instagram.svg'
import IonicIcon from '../images/icons/ionic.svg'
import LeagueOfLegendsIcon from '../images/icons/league-of-legends.svg'
import MarkdownIcon from '../images/icons/markdown.svg'
import NodejsIcon from '../images/icons/nodejs.svg'
import NpmIcon from '../images/icons/npm.svg'
import PythonIcon from '../images/icons/python.svg'
import SassIcon from '../images/icons/sass.svg'
import SteamIcon from '../images/icons/steam.svg'
import TwitchIcon from '../images/icons/twitch.svg'
import TwitterIcon from '../images/icons/twitter.svg'
import UnsplashIcon from '../images/icons/unsplash.svg'
import WindowsIcon from '../images/icons/windows.svg'
import WordpressIcon from '../images/icons/wordpress.svg'
import XingIcon from '../images/icons/xing.svg'
import YoutubeIcon from '../images/icons/youtube.svg'

const icons = {
angular: <AngularIcon />,
apple: <AppleIcon />,
codepen: <CodepenIcon />,
discord: <DiscordIcon />,
dribbble: <DribbbleIcon />,
github: <GithubIcon />,
hackernews: <HackernewsIcon />,
instagram: <InstagramIcon />,
ionic: <IonicIcon />,
lol: <LeagueOfLegendsIcon />,
markdown: <MarkdownIcon />,
nodejs: <NodejsIcon />,
npm: <NpmIcon />,
python: <PythonIcon />,
sass: <SassIcon />,
steam: <SteamIcon />,
twitch: <TwitchIcon />,
twitter: <TwitterIcon />,
unsplash: <UnsplashIcon />,
windows: <WindowsIcon />,
wordpress: <WordpressIcon />,
xing: <XingIcon />,
youtube: <YoutubeIcon />,
}

const Icon = ({ name }) => {
const IconElement = icons[name] || <span>Icon not found</span>
return (
<span className="icon" name={name}>
{IconElement}
</span>
)
}

export default Icon
22 changes: 0 additions & 22 deletions src/components/LayoutPage.jsx

This file was deleted.

25 changes: 8 additions & 17 deletions src/components/logo.jsx
Original file line number Diff line number Diff line change
@@ -1,28 +1,19 @@
import React from 'react'
import { useStaticQuery, graphql } from 'gatsby'
import { Link } from 'gatsby'

import logo from '../images/logo-white.svg'
import { useSiteData } from '../hooks/use-site-data'
import LogoComponent from '../images/logo.svg'

const Logo = () => {
const data = useStaticQuery(query)
const sitedata = useSiteData()

return (
<div id="logo">
<a href="/">
<img src={logo} alt={data.site.siteMetadata.title} />
</a>
<div className="logo">
<Link href="/">
<LogoComponent alt={`Logo of ${sitedata.title}`} />
</Link>
</div>
)
}

const query = graphql`
query SiteMetaQuery {
site {
siteMetadata {
title
}
}
}
`

export default Logo
4 changes: 2 additions & 2 deletions src/components/navigation.jsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import React, { useContext } from 'react'

import { Nav } from '../store'
import { useSiteMetadata } from '../hooks/use-site-metadata'
import { useMenuLinks } from '../hooks/use-menu-links'
import Link from './Link'

const Navigation = () => {
const { menuLinks } = useSiteMetadata()
const menuLinks = useMenuLinks()
const navState = useContext(Nav.State)
const navDispatch = useContext(Nav.Dispatch)

Expand Down
20 changes: 20 additions & 0 deletions src/hooks/use-footer-links.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { useStaticQuery, graphql } from 'gatsby'

export const useFooterLinks = () => {
const results = useStaticQuery(
graphql`
query FooterLinks {
site {
siteMetadata {
footerLinks {
name
link
}
}
}
}
`
)

return results.site.siteMetadata.footerLinks
}
Loading

0 comments on commit 627239a

Please sign in to comment.