Skip to content

Conversation

@bep
Copy link
Member

@bep bep commented Feb 7, 2025

This is an empty struct for now, but we will most likely expand on that.

[contentTypes]
[contentTypes.'text/markdown']

The above means that only Markdown will be considered a content type. E.g. HTML will be treated as plain text.

Fixes #12274

@bep bep force-pushed the feat/contenttype-12274 branch 3 times, most recently from dd04b02 to f768337 Compare February 7, 2025 15:51
@bep bep marked this pull request as ready for review February 7, 2025 17:05
@bep bep requested a review from jmooring February 7, 2025 17:05
@jmooring
Copy link
Member

jmooring commented Feb 7, 2025

As documented above and in the commit message, this does not work:

[[contentTypes]]
[[contentTypes."text/markdown"]]

But this works as expected:

[contentTypes]
  [contentTypes.'text/markdown']
@jmooring
Copy link
Member

jmooring commented Feb 7, 2025

Also, I expect to complete gohugoio/hugoDocs#1888 early next week, and will include this key and explanation. So no need to document here.

@bep
Copy link
Member Author

bep commented Feb 7, 2025

As documented above and in the commit message, this does not work:

Yea, I wrote the example before I implemented it. I have spent thousands of hours with TOML, but I'm still pretty bad at it.

I will fix the commit message.

This is an empty struct for now, but we will most likely expand on that.

```
[contentTypes]
  [contentTypes.'text/markdown']
```

The above means that only Markdown will be considered a content type. E.g. HTML will be treated as plain text.

Fixes gohugoio#12274
@bep bep force-pushed the feat/contenttype-12274 branch from f768337 to fe52ea2 Compare February 7, 2025 18:46
Copy link
Member

@jmooring jmooring left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works great.

@bep bep merged commit c2fb221 into gohugoio:master Feb 8, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants