st john smith
st john smith

Reputation: 71

Can Jekyll use other file formats apart from markdown?

I have a large quantity of HTML files can i use these and turn them into blog posts??

I am trying to work out a way to turn these into blog posts, and i am not sure if Jekyll is the right option.

Upvotes: 0

Views: 167

Answers (1)

David Jacquel
David Jacquel

Reputation: 52829

Given your original post post-title.html is :

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body>
    <h2>Intro</h2>
    <p>Text here</p>
</body>
</html>

You just keep the content part :

<h2>Intro</h2>
<p>Text here</p>

Add a front matter to it :

---
layout: post
---
<h2>Intro</h2>
<p>Text here</p>

Rename it to 2014-12-21-post-title.html. And you're good to go ! Jekyll post can be markdown, but html too !

Note : the title (page.title) is here derived from the file name. If you want to use an elaborated title, you can add it in the front matter :

---
...
title: I'm a blogger, sometimes !!
---

Useful informations can be found in Jekyll documentation.

Upvotes: 1

Related Questions