Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export of comments? #95

Open
Flaburgan opened this issue Jan 8, 2025 · 4 comments
Open

Export of comments? #95

Flaburgan opened this issue Jan 8, 2025 · 4 comments

Comments

@Flaburgan
Copy link

Flaburgan commented Jan 8, 2025

Hello,
I'm just discovering your tool and I find it amazing, thank you for your great work.
I would like to know if there is a way to include comments on posts in the built Hugo website?
Inside the <item> element of my WordPress eXtended RSS file I have the following info:

		<wp:comment>
			<wp:comment_id>8</wp:comment_id>
			<wp:comment_author><![CDATA[NAME]]></wp:comment_author>
			<wp:comment_author_email><![CDATA[EMAIL]]></wp:comment_author_email>
			<wp:comment_author_url></wp:comment_author_url>
			<wp:comment_author_IP><![CDATA[IP]]></wp:comment_author_IP>
			<wp:comment_date><![CDATA[2011-12-18 15:31:13]]></wp:comment_date>
			<wp:comment_date_gmt><![CDATA[2011-12-18 14:31:13]]></wp:comment_date_gmt>
			<wp:comment_content><![CDATA[CONTENT]]></wp:comment_content>
			<wp:comment_approved><![CDATA[1]]></wp:comment_approved>
			<wp:comment_type><![CDATA[]]></wp:comment_type>
			<wp:comment_parent>0</wp:comment_parent>
			<wp:comment_user_id>2</wp:comment_user_id>
		</wp:comment>

But I don't find it back in the hugo generated file. Do I miss an option? Is this not supported yet?

EDIT: I just saw your remark at the very end of the README suggesting to use remark42. However I don't want to actually have a commenting system, I just want the old comments to be displayed, it's fine to not be able to publish new ones. So could this be integrated into your project?

@ashishb
Copy link
Owner

ashishb commented Jan 12, 2025

I just want the old comments to be displayed, it's fine to not be able to publish new ones. So could this be integrated into your project?

@Flaburgan sure this can be done.
It would be adding a new shortcode similar to

return writeShortCode(siteDir, "catlist", _selectedPostsShortCode)
adds website/layouts/shortcodes/catlist.html
Would you like to send a PR?

@Flaburgan
Copy link
Author

Hey, I never wrote go code, I think setting the environment and tests is going to be optimal, however I was about to offer a $50 bounty for it, what do you think?

@Flaburgan
Copy link
Author

Regarding the behavior, I think a new parameter --include-readonly-comments needs to be added, as people using Remark42 as you are suggesting would not want to have the comments included in Hugo.
Also, how should the comments be included? At the end of the posts/XXX.md? How would Hugo themes recognize them?

@ashishb
Copy link
Owner

ashishb commented Jan 13, 2025

Also, how should the comments be included? At the end of the posts/XXX.md? How would Hugo themes recognize them?

In the Markdown using some Hugo shortcode e.g.

{{< comment authorName="NAME" authorEmail="EMAIL" dateGMT="2011-12-18 14:31:13" content="CONTENT" >}}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants