How to read an OPML file as data in a Jekyll template?


#1

Update: Since you can’t read OPML files (I misread the docs), consider this question not asked…

Hi,

I have an OPML file I want to use as a datafile on my Jekyll site. I am looking for the documentation how to parse the output in a template file?

Here’s a sample OPML file

<opml version="2.0">
	<head>
		<title>HackerNews</title>
		</head>
	<body text="lists/hn.opml">
		<outline htmlUrl="https://news.ycombinator.com/newest" name="hackerNewsFirehose" text="Hacker News Firehose" title="Hacker News Firehose" type="rss" xmlUrl="http://hn.geekity.com/newstories.xml"></outline>
		</body>
	</opml>

How can I parse this is a template file? I tried various variations of the code below

<ul>
{% for feed in site.data.feeds %}
  <li>
      {{ feed.opml.body.outline[title] }}
    </a>
  </li>
{% endfor %}
</ul>

Especially the part {{ feed.opml.body.outline[title] }}, what should that be?

Thanks
Frank