nikola icon indicating copy to clipboard operation
nikola copied to clipboard

YAML metadata in Pandoc-renderred posts is included in HTML

Open damufo opened this issue 2 years ago • 4 comments

Hello:

Environment

Python Version: 3.5.3

Nikola Version: 8.2.0

Operating System: docker nginx:alpine

Description:

config.py

METADATA_FORMAT = "YAML"

Post source:

---
category: ''
date: 2022-02-24 16:06:27 UTC+01:00
description: ''
link: ''
slug: novo-artigo
tags: ''
title: Título do artigo 3
type: text
---
Escribe o teu artigo aquí.

Metadata is rendered (showed): render_yaml

Very thanks.

damufo avatar Feb 24 '22 15:02 damufo

Hi, sorry for the late response, but I cannot reproduce this, using Nikola v8.2.0, Ubuntu 20.04, and both reST and Markdown posts, both fresh (nikola new_post) and using code provided by you. Can you verify you’re using a recent version of Nikola and other dependencies?

Kwpolska avatar Apr 09 '22 21:04 Kwpolska

Hello: Sorry, I've been reviewing the issue and it happens when I use pandoc as a compiler and mix posts in rst and markdown.

damufo avatar Apr 22 '22 07:04 damufo

This scenario isn’t currently supported, and it might be difficult to add support for it. For pandoc posts, we don’t remove the metadata from compiled posts — this is because our algorithm might delete parts of content in some conditions, and some input formats might lead to metadata not being removed anyway.

If you’re using Markdown and reST, consider using a native compiler instead of Pandoc. If you’re using Pandoc, you’ll need to use the Nikola metadata format and comments appropriate for your input format, or two-file posts.

Kwpolska avatar Apr 22 '22 13:04 Kwpolska

OK! At the moment two-file posts is my solution. Very thanks!

damufo avatar Apr 23 '22 10:04 damufo