-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Style tweaks, move homepage to /archive * Redirect / to latest post * Fix divider spacing * Fix DOM layout * Use `gatsby-remark-embedder` * Better place for attribution * Excerpts are plain-text * Fix date formatting on archive * Move /archive back to / * target=_blank * Make yarn pin deps by default * Pin deps, remove now plugin * Class → Function components * Name Queries * Fix title for index page * Fix font stack, apparently * Add license, remove link to contributors * Update src/components/layout.js Co-Authored-By: Lipis <[email protected]> * format Co-authored-by: Lipis <[email protected]>
- Loading branch information
Showing
13 changed files
with
388 additions
and
198 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
--add.exact true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
// custom typefaces | ||
import "typeface-montserrat"; | ||
import "typeface-merriweather"; | ||
require("prismjs/themes/prism-solarizedlight.css"); | ||
import "./src/styles.css"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,83 +1,93 @@ | ||
import React from "react"; | ||
import { Link } from "gatsby"; | ||
|
||
import logoPath from "../../content/assets/logo.png"; | ||
|
||
import { rhythm, scale } from "../utils/typography"; | ||
|
||
class Layout extends React.Component { | ||
render() { | ||
const { location, title, children } = this.props; | ||
const rootPath = `${__PATH_PREFIX__}/`; | ||
let header; | ||
if (location.pathname === rootPath) { | ||
header = ( | ||
<h1 | ||
style={{ | ||
...scale(1.2), | ||
marginBottom: rhythm(1.5), | ||
marginTop: 0, | ||
}} | ||
> | ||
<Link | ||
style={{ | ||
boxShadow: `none`, | ||
textDecoration: `none`, | ||
color: `inherit`, | ||
}} | ||
to={`/`} | ||
> | ||
{title} | ||
</Link> | ||
</h1> | ||
); | ||
} else { | ||
header = ( | ||
<h3 | ||
style={{ | ||
fontFamily: `Montserrat, sans-serif`, | ||
marginTop: 0, | ||
}} | ||
> | ||
<Link | ||
function Layout({ location, title, children }) { | ||
const rootPath = `${__PATH_PREFIX__}/`; | ||
const logo = ( | ||
<img | ||
src={logoPath} | ||
alt="" | ||
style={{ | ||
height: rhythm(1), | ||
verticalAlign: "middle", | ||
background: "white", | ||
padding: `0 ${rhythm(0.1)}`, | ||
}} | ||
/> | ||
); | ||
|
||
return ( | ||
<div | ||
style={{ | ||
marginLeft: `auto`, | ||
marginRight: `auto`, | ||
maxWidth: rhythm(26), | ||
padding: `${rhythm(1.5)} ${rhythm(3 / 4)}`, | ||
}} | ||
> | ||
<header> | ||
<p style={{ fontFamily: "var(--ui-font)" }}> | ||
{location.pathname === rootPath ? ( | ||
<a | ||
href="https://excalidraw.com" | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
> | ||
{logo}Open Excalidraw | ||
</a> | ||
) : ( | ||
<> | ||
<span style={{ float: "right" }}> | ||
<a | ||
href="https://excalidraw.com" | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
> | ||
Open Excalidraw{logo} | ||
</a> | ||
</span> | ||
<Link to="/">All posts</Link> | ||
</> | ||
)} | ||
<span style={{ clear: "both" }} /> | ||
</p> | ||
{location.pathname === rootPath ? ( | ||
<h1 | ||
style={{ | ||
boxShadow: `none`, | ||
textDecoration: `none`, | ||
color: `inherit`, | ||
...scale(1.2), | ||
marginTop: 0, | ||
}} | ||
to={`/`} | ||
> | ||
{title} | ||
</Link> | ||
</h3> | ||
); | ||
} | ||
return ( | ||
<div | ||
</h1> | ||
) : null} | ||
</header> | ||
<main>{children}</main> | ||
<footer | ||
style={{ | ||
marginLeft: `auto`, | ||
marginRight: `auto`, | ||
maxWidth: rhythm(26), | ||
padding: `${rhythm(1.5)} ${rhythm(3 / 4)}`, | ||
textAlign: "center", | ||
padding: `${rhythm(2)} 0`, | ||
fontFamily: "var(--ui-font)", | ||
}} | ||
> | ||
<header>{header}</header> | ||
<main>{children}</main> | ||
<footer | ||
style={{ | ||
textAlign: "center", | ||
padding: `${rhythm(2)} 0`, | ||
}} | ||
> | ||
© {new Date().getFullYear()} | ||
{" – "} | ||
<a href="https://twitter.com/excalidraw">Twitter</a> | ||
{" – "} | ||
<a href="https://github.com/excalidraw">GitHub</a> | ||
{" – "} | ||
<a href="https://excalidraw.com">Excalidraw</a> | ||
</footer> | ||
</div> | ||
); | ||
} | ||
© {new Date().getFullYear()} Excalidraw Blog contributors | ||
{" • "} | ||
<a href="https://github.com/excalidraw/excalidraw-blog/blob/master/LICENSE"> | ||
MIT Licensed | ||
</a> | ||
{" • "} | ||
<a href="https://twitter.com/excalidraw">Twitter</a> | ||
{" • "} | ||
<a href="https://github.com/excalidraw/excalidraw-blog">View source</a> | ||
{" • "} | ||
<Link to="/">All posts</Link> | ||
</footer> | ||
</div> | ||
); | ||
} | ||
|
||
export default Layout; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
09b7f1e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to following URLs: