Skip to content

Commit

Permalink
Fix titles to posts
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleAMathews committed Jul 22, 2015
1 parent 2286041 commit a896447
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 24 deletions.
12 changes: 10 additions & 2 deletions html.cjsx
@@ -1,15 +1,23 @@
React = require 'react'
Typography = require 'typography'
DocumentTitle = require 'react-document-title'

typography = new Typography()
{TypographyStyle} = typography

module.exports = React.createClass
getDefaultProps: ->
title: "Default title"
body: ""

render: ->
title = DocumentTitle.rewind()
if @props.title then title = @props.title

if __GH_PAGES__? and __GH_PAGES__
urlPrefix = @props.config.ghPagesURLPrefix
else
urlPrefix = ""

<html lang="en">
<head>
<meta charSet="utf-8"/>
Expand All @@ -36,6 +44,6 @@ module.exports = React.createClass
</head>
<body className="landing-page">
<div id="react-mount" dangerouslySetInnerHTML={{__html: @props.body}} />
<script src="/bundle.js"/>
<script src={urlPrefix + "/bundle.js"}/>
</body>
</html>
43 changes: 23 additions & 20 deletions pages/index.cjsx
Expand Up @@ -2,6 +2,7 @@ React = require 'react'
Router = require 'react-router'
{RouteHandler, Link} = Router
sortBy = require 'lodash/collection/sortBy'
DocumentTitle = require 'react-document-title'
{link} = require 'gatsby-helpers'

module.exports = React.createClass
Expand All @@ -26,25 +27,27 @@ module.exports = React.createClass
</li>
)

<div>
<p
style={{
marginBottom: rhythm(2.5)
}}
>
<img
src="./kyle-round-small-pantheon.jpg"
<DocumentTitle title="#{@props.config.blogTitle}">
<div>
<p
style={{
float: 'left'
marginRight: rhythm(1/4)
marginBottom: 0
width: rhythm(2)
height: rhythm(2)
marginBottom: rhythm(2.5)
}}
/>
Written by <strong>{@props.config.authorName}</strong> who lives and works in San Francisco building useful things. <a href="https://twitter.com/kylemathews">You should follow him on Twitter</a>
</p>
<ul>
{pageLinks}
</ul>
</div>
>
<img
src="./kyle-round-small-pantheon.jpg"
style={{
float: 'left'
marginRight: rhythm(1/4)
marginBottom: 0
width: rhythm(2)
height: rhythm(2)
}}
/>
Written by <strong>{@props.config.authorName}</strong> who lives and works in San Francisco building useful things. <a href="https://twitter.com/kylemathews">You should follow him on Twitter</a>
</p>
<ul>
{pageLinks}
</ul>
</div>
</DocumentTitle>
5 changes: 3 additions & 2 deletions wrappers/md.cjsx
Expand Up @@ -2,6 +2,7 @@ React = require 'react'
require '../css/zenburn.css'
moment = require 'moment'
DocumentTitle = require 'react-document-title'
{link} = require 'gatsby-helpers'

ReadNext = require '../components/ReadNext'

Expand All @@ -12,7 +13,7 @@ module.exports = React.createClass
{rhythm} = @props.typography
post = @props.page.data

<DocumentTitle title="Name of blog | #{post.title}">
<DocumentTitle title="#{post.title} | #{@props.config.blogTitle}">
<div className="markdown">
<h1>{post.title}</h1>
<div dangerouslySetInnerHTML={{__html: post.body}}/>
Expand All @@ -32,7 +33,7 @@ module.exports = React.createClass
<ReadNext post={post} {...@props}/>
<p>
<img
src="/kyle-round-small-pantheon.jpg"
src={link("/kyle-round-small-pantheon.jpg")}
style={{
float: 'left'
marginRight: rhythm(1/4)
Expand Down

0 comments on commit a896447

Please sign in to comment.