Skip to content

Commit f2ad4c7

Browse files
author
Taylor Griffith
committed
img path
1 parent 9ab2a14 commit f2ad4c7

File tree

6 files changed

+3
-3
lines changed

6 files changed

+3
-3
lines changed

public/admin/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ backend:
22
name: git-gateway
33
branch: master # Branch to update (optional; defaults to master)
44

5-
media_folder: "src/images/uploads" # Media files will be stored in the repo under src/images/uploads
5+
media_folder: "public/uploads" # Media files will be stored in the repo under public/uploads
66

77
collections:
88
- name: "blog" # Used in routes, e.g., /admin/collections/blog
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/containers/Post.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export default withRouteData(({ post }) => (
99
<br />
1010
<h3>{post.data.title}</h3>
1111
<Moment format="MMMM Do, YYYY">{post.data.date}</Moment>
12-
<img className="image" src={require(`../images/uploads/${post.data.thumbnail}`)} alt="" />
12+
<img className="image" src={`/uploads/${post.data.thumbnail}`} alt="" />
1313
<p dangerouslySetInnerHTML={{ __html: post.content }} />
1414
</div>
1515
))

static.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ function getPosts () {
2222
// Create slug for URL //
2323
dataObj.data.slug = dataObj.data.title.toLowerCase().replace(/ /g, '-').replace(/[^\w-]+/g, '')
2424
// Parse image file name from path //
25-
dataObj.data.thumbnail = dataObj.data.thumbnail.replace('/src/images/uploads/', '')
25+
// dataObj.data.thumbnail = dataObj.data.thumbnail.replace('/src/images/uploads/', '')
2626
// Push object into items array //
2727
items.push(dataObj)
2828
}

0 commit comments

Comments
 (0)