MD files contain only front matter
Closed this issue · 5 comments
Describe the bug
The MD files are generated as expected, but they only contain front matter without the actual contents of the post.
Version of Ghost
Which version of Ghost was used to create the export
v2.9.1
To Reproduce
Steps to reproduce the behaviour:
- Export your content from the Labs section of the Ghost Admin app.
- Download the ghostToHugo binary for your OS (I used v0.2.2 ghostToHugo-Linux-x86_64.tar.gz).
- Generate the MD files using the command
./ghostToHugo -p '/path/to/blog' blog-name.ghost.YYYY-MM-DD.json
- Files are generated with only front matter and no content e.g
+++
author = "John Doe"
date = 2018-12-27T15:43:58Z
description = ""
draft = true
slug = "sample-post"
title = "Sample Post"
+++
Expected behaviour
The content is supposed to be part of the generated posts.
Additional context
I've looked at the ghost JSON export. The post contents are contained in it as expected.
@nicholaskajoh could you please try with v0.3.0 and see if that resolves your issue?
NOTE: depending on your export, you may need to provide a time format string. With the latest ghost version I needed the following:
$ ./ghostToHugo -f"2006-01-02 15:04:05" -p "/path/to/blog" "/path/to/export"
Works like a charm! Thanks.
Although, when I used -f "2006-01-02 15:04:05"
it messed up the dates in all my posts. The dates became 0001-01-01T00:00:00Z
.
Excellent! Glad to hear it's working.
On the date issue, that was based on what I was seeing from my export from Ghost, clearly your's is different. If you need some help figuring out the format, just drop a snippet (created_at
date from a post) in here from your export and I'll help you decode it.
Here's one: 2018-12-25T06:51:43.000Z.
Ah, then you're in luck. That is the default ghostToHugo
uses. Just leave off the -f
option and you should be good to go.