Html as input format

14 views
Skip to first unread message

Gerald Rapior

unread,
Nov 23, 2016, 9:26:23 AM11/23/16
to nikola-discuss
Dear all,

I don't get, how I can use html-files as a posts or pages. I tried it with a very short example:
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<p>paragraph</p>
</body>
</html>

I can't think of a simpler html-file. As a page, Nikola shows the file name as the title only but without any content. As a post the build process stops because there is no date. I know only the <time datetime="2016-11-23 UTC+1 15:00"> as a valid html tag. This doesn't fix the termination.
Maybe I forgot something important or I'm completely wrong with my idea of a html input file.

The background is following: I want to get rid of my pure latex files and want to transfer the files to rst. Unfortunately, the possibilities of references are limited in rst but Sphinx solve the problem. I hope, I can make a jinja template with a content block only and export it to html. On the other side Sphinx is not nearly a blogging software as Nikola is. My solution is not perfect, but acceptable because it doesn't happens every day that I have to write complicated documents.

All the best
Gerald

Chris Warrick

unread,
Nov 23, 2016, 10:11:41 AM11/23/16
to Nikola—Discuss
Nikola takes its metadata from HTML comments or .meta files. You will need this:

<!-- .. date: 2016-11-23 15:00 UTC+1 -->

At the top of your file, along with other important fields.

Run this: nikola new_post -f html
You can also add -2 to get separate .meta and .html files.

--
Chris Warrick <https://chriswarrick.com/>
PGP: 5EAAEA16

Gerald Rapior

unread,
Nov 23, 2016, 4:14:26 PM11/23/16
to nikola-discuss
Thank you very much Chris!

I don't know the -f html flag.
Reply all
Reply to author
Forward
0 new messages