-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
Add XML as a support data format #4470
Comments
@bzerangue This would be fantastic. Not sure if something like https://github.com/beevik/etree would help said efforts... |
This issue has been automatically marked as stale because it has not had recent activity. The resources of the Hugo team are limited, and so we are asking for your help. |
+1 on this. Type "XML" could then act as a flag to invoke DOCTYPE parsing and optional validation. |
Having a
Not just the |
This looks promising: https://github.com/clbanning/mxj But note that mapping arbitrary XML into a map isn't trivial. |
This'll be great for surfacing RSS from other sources like Medium |
+1 from me, too - I'd like to be able to include references from the RFC index, but it's only published in XML format. |
I'm working on a Go library to parse mixed content. If anyone can propose an API (i.e. interfaces) that would be useful for Hugo, I could give it a whack. |
On the RSS specific side, I currently leverage a site that parses RSS to JSON for consumption
|
https://github.com/antchfx/xmlquery seems to be a good fit to add XML data source support.
I created a simple PR with a working implementation: #9031 |
#9044 is another attempt to get XML data support While this implementation provides less flexibility than my previous implementation using Sample usage:
A common usage:
|
It would also be good for reading RSS feeds. |
Example: ``` {{ with resources.Get "https://example.com/rss.xml" | transform.Unmarshal }} {{ range .channel.item }} <strong>{{ .title | plainify | htmlUnescape }}</strong><br /> <p>{{ .description | plainify | htmlUnescape }}</p> {{ $link := .link | plainify | htmlUnescape }} <a href="{{ $link }}">{{ $link }}</a><br /> <hr> {{ end }} {{ end }} ``` Closes #4470
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
It would be nice to provide XML as an available data type to load.
Currently, Hugo accepts, TOML, YAML, JSON, and CSV. Is there any reason why XML is NOT amongst the available formats?
It would be great to add XML as an available data type for the
/data
folder.The text was updated successfully, but these errors were encountered: