hugo-theme-more-contentful/articles/rss-atom-and-json-feed-support/index.html

255 lines
10 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="en-us"><title>RSS, Atom, and JSON Feed Support | Contentful</title>
<link rel="stylesheet" href="https://foo-dogsquared.github.io/hugo-theme-more-contentful/css/main.min.e06bc29e2cb00a8f461bfefc0ea9543b9bf61688266d3ca51fcb4d2121242b0a.css" /><meta name="generator" content="Hugo 0.76.0" />
<meta charset="utf-8">
<meta name="author" content="John Doe" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="referrer" content="no-referrer" />
<meta name="description" content="Web feeds are one of the most common ways for a visitor to keep up with someone who creates content. Nowadays, most social media has that feature such as the subscribing YouTube channels, following Twitter accounts, and watching Deviantart artists. Outside of those, we have simpler things like RSS and JSON feeds where they are just plain text files describing the content.
The Contentful theme doesnt have a web feed export but we can have it with theme components." /><meta name="twitter:card" content="summary"/>
<meta name="twitter:title" content="RSS, Atom, and JSON Feed Support"/>
<meta name="twitter:description" content="Web feeds are one of the most common ways for a visitor to keep up with someone who creates content. Nowadays, most social media has that feature such as the subscribing YouTube channels, following Twitter accounts, and watching Deviantart artists. Outside of those, we have simpler things like RSS and JSON feeds where they are just plain text files describing the content.
The Contentful theme doesnt have a web feed export but we can have it with theme components."/>
<meta property="og:title" content="RSS, Atom, and JSON Feed Support" />
<meta property="og:description" content="Web feeds are one of the most common ways for a visitor to keep up with someone who creates content. Nowadays, most social media has that feature such as the subscribing YouTube channels, following Twitter accounts, and watching Deviantart artists. Outside of those, we have simpler things like RSS and JSON feeds where they are just plain text files describing the content.
The Contentful theme doesnt have a web feed export but we can have it with theme components." />
<meta property="og:type" content="article" />
<meta property="og:url" content="https://foo-dogsquared.github.io/hugo-theme-more-contentful/articles/rss-atom-and-json-feed-support/" />
<meta property="article:published_time" content="2019-09-04T17:22:44+08:00" />
<meta property="article:modified_time" content="2020-11-02T23:58:07+08:00" />
<link rel="canonical" type="text/html" href="https://foo-dogsquared.github.io/hugo-theme-more-contentful/articles/rss-atom-and-json-feed-support/" />
<script>
let theme = window.localStorage.getItem('theme');
if (theme) {
document.documentElement.dataset.theme = theme;
}
</script>
<body>
<div class="site__theme-btn" aria-label="Theme toggle">
<svg>
<use href="https://foo-dogsquared.github.io/hugo-theme-more-contentful/icons/generic/color-swatch.svg#color-swatch"></use>
</svg>
<div class="site__theme-dropdown">
<div class="site__theme-item" >Default Dark (default)</div>
<div class="site__theme-item" data-theme="Dracula">Dracula</div>
<div class="site__theme-item" data-theme="Nord">Nord</div>
</div>
</svg>
</div>
<script defer>
const themeDropdown = document.querySelector('.site__theme-btn');
themeDropdown.addEventListener('click', (event) => {
const { target } = event;
if (target.classList.contains("site__theme-item")) {
if (target.dataset.theme) {
theme = target.dataset.theme;
window.localStorage.setItem("theme", theme);
document.documentElement.dataset.theme = theme;
} else {
window.localStorage.removeItem("theme");
delete document.documentElement.dataset.theme;
}
}
});
</script><nav aria-label="Primary navigation">
<a class="site__title" href="https://foo-dogsquared.github.io/hugo-theme-more-contentful">Contentful</a>
<div class="list site__links">
<a href="https://foo-dogsquared.github.io/hugo-theme-more-contentful/about/">About</a>
<a href="https://foo-dogsquared.github.io/hugo-theme-more-contentful/categories/">Categories</a>
<a href="https://foo-dogsquared.github.io/hugo-theme-more-contentful/recipes/">Recipes</a>
<a href="https://foo-dogsquared.github.io/hugo-theme-more-contentful/tags/">Tags</a>
</div>
</nav>
<article class="post--single">
<header>
<h1>RSS, Atom, and JSON Feed Support</h1>
</header>
<div class="list post__meta"><time datetime="2019-09-04 17:22:44 &#43;0800 &#43;0800">
<svg>
<use href="https://foo-dogsquared.github.io/hugo-theme-more-contentful/icons/generic/calendar.svg#calendar"></use>
</svg>
<span style="margin-left: 0.5em;">2019-09-04</span>
</time>
<time datetime="2020-11-02 23:58:07 &#43;0800 &#43;0800">
<svg>
<use href="https://foo-dogsquared.github.io/hugo-theme-more-contentful/icons/generic/refresh.svg#refresh"></use>
</svg>
<span style="margin-left: 0.5em;">2020-11-02</span>
</time>
<span data-authors="[{&#34;name&#34;:&#34;John Doe&#34;},{&#34;name&#34;:&#34;Jane Doe&#34;}]">
<svg>
<use href="https://foo-dogsquared.github.io/hugo-theme-more-contentful/icons/generic/pencil.svg#pencil"></use>
</svg>
<span style="margin-left: 0.5em;">
John Doe, et al.
</span>
</span>
</div>
<main>
<div class="paragraph">
<p>Web feeds are one of the most common ways for a visitor to keep up with someone who creates content.
Nowadays, most social media has that feature such as the subscribing YouTube channels, following Twitter accounts, and watching Deviantart artists.
Outside of those, we have simpler things like <a href="https://www.rssboard.org/rss-2-0-1">RSS</a> and <a href="https://www.jsonfeed.org/">JSON</a> feeds where they are just plain text files describing the content.</p>
</div>
<div class="paragraph">
<p>The Contentful theme doesnt have a web feed export but we can have it with <a href="https://gohugo.io/hugo-modules/theme-components/">theme components</a>.
For this demo, well use the <a href="https://github.com/foo-dogsquared/hugo-web-feeds">web feed component</a> created by <a href="https://foo-dogsquared.github.io/">foo-dogsquared</a>.</p>
</div>
<div class="paragraph">
<p>If youre settling with this option, heres an example template for installing the web feed module and exporting all of the feed formats all in one fell swoop.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlight"><code class="language-toml" data-lang="toml">[[module.imports]]
path = &#34;github.com/foo-dogsquared/hugo-web-feeds&#34;
# Visit the following for more information:
# https://gohugo.io/templates/output-formats
# Defining the media type of the output formats
# For JSON format, it doesn&#39;t need to be since it&#39;s already built-in into Hugo
[mediaTypes]
[mediaTypes.&#34;application/atom+xml&#34;]
suffixes = [&#34;atom&#34;, &#34;atom.xml&#34;] # You can remove the &#34;atom.xml&#34; if you want
# Redefining RSS media type for the additional suffix
[mediaTypes.&#34;application/rss+xml&#34;]
suffixes = [&#34;rss&#34;, &#34;rss.xml&#34;] # You can remove the &#34;rss.xml&#34; if you want
[mediaTypes.&#34;application/feed+json&#34;]
suffixes = [&#34;json&#34;] # You can remove the &#34;rss.xml&#34; if you want
# Including all of the feed output formats in the build
[outputFormats]
[outputFormats.Rss]
mediaType = &#34;application/rss+xml&#34;
baseName = &#34;feed&#34;
[outputFormats.Atom]
mediaType = &#34;application/atom+xml&#34;
baseName = &#34;feed&#34;
[outputFormats.Json]
mediaType = &#34;application/feed+json&#34;
baseName = &#34;feed&#34;
# Indicating what output formats shall be included
# for the following kinds
[outputs]
# .Site.BaseURL/index.* is available
home = [&#34;HTML&#34;, &#34;JSON&#34;, &#34;RSS&#34;, &#34;ATOM&#34;]
# .Site.BaseURL/$section/index.* is available
section = [&#34;HTML&#34;, &#34;JSON&#34;, &#34;RSS&#34;, &#34;ATOM&#34;]</code></pre>
</div>
</div>
</main>
<hr>
<div class="post__meta--single">
<p data-content-author="[&#34;John Doe&#34;,&#34;Jane Doe&#34;]">Authors: John Doe and Jane Doe</p>
<p data-content-publication-date="2019-09-04 17:22:44 &#43;0800 &#43;0800">Created: <time datetime="2019-09-04">2019-09-04</time></p>
<p data-content-modification-date="2020-11-02 23:58:07 &#43;0800 &#43;0800">Updated: <time datetime="2020-11-02">2020-11-02</time></p>
<p data-content-translations="[&#34;Tagalog&#34;]">Translations: <a href=https://foo-dogsquared.github.io/hugo-theme-more-contentful/tl/articles/rss-atom-and-json-feed-support/>Tagalog</a></p>
</div>
</article>
<hr>
<footer>
<p><a href="#top">Back to top</a></p>
<p>Available in other languages:
<span class="list site__languages">
<a href="/hugo-theme-more-contentful/en" hreflang="en">English</a>
<a href="/hugo-theme-more-contentful/tl" hreflang="tl">Tagalog</a>
</span>
</p>
<ul class="list site__socials">
<li>
<a class="site__social-icon" rel="me" href="https://keybase.io/foo_dogsquared" aria-label="Keybase">
<svg>
<use href="https://foo-dogsquared.github.io/hugo-theme-more-contentful/icons/brand/keybase.svg#keybase"></use>
</svg>
</a>
</li><li>
<a class="site__social-icon" rel="me" href="https://github.com/foo-dogsquared/" aria-label="GitHub">
<svg>
<use href="https://foo-dogsquared.github.io/hugo-theme-more-contentful/icons/brand/github.svg#github"></use>
</svg>
</a>
</li><li>
<a class="site__social-icon" rel="me" href="https://gitlab.com/foo-dogsquared/" aria-label="GitLab">
<svg>
<use href="https://foo-dogsquared.github.io/hugo-theme-more-contentful/icons/brand/gitlab.svg#gitlab"></use>
</svg>
</a>
</li><li>
<a class="site__social-icon" rel="me" href="https://twitter.com/foo_dogsquared" aria-label="Twitter">
<svg>
<use href="https://foo-dogsquared.github.io/hugo-theme-more-contentful/icons/brand/twitter.svg#twitter"></use>
</svg>
</a>
</li></ul>
<p>© 2021 Contentful</p>
</footer>
</body>
</html>