-
Notifications
You must be signed in to change notification settings - Fork 553
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
use absolute URLs in atom.xml and fix broken URL #23
Open
MichaelCurrin
wants to merge
2
commits into
tocttou:master
Choose a base branch
from
MichaelCurrin:patch-1
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Here is the full output when I ran locally. Just the URLs matter. Note that I don't have author set up on my site. <?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>Jekyll Blog Demo</title>
<description>Starter for a static website or blog - built with Jekyll, a minimal theme and GH Pages</description>
<link>https://michaelcurrin.github.io/jekyll-blog-demo/</link>
<atom:link href="https://michaelcurrin.github.io/jekyll-blog-demo/atom.xml" rel="self" type="application/rss+xml" />
<author>
<name></name>
<email></email>
<uri></uri>
</author>
<item>
<title>First post!</title>
<description><p>This is my first post after the one created as part of the blog template.</p>
</description>
<pubDate>Sat, 22 Dec 2018 00:00:00 +0200</pubDate>
<link>https://michaelcurrin.github.io/jekyll-blog-demo/2018/12/22/first-post/</link>
<link href="https://michaelcurrin.github.io/jekyll-blog-demo/2018/12/22/first-post/"/>
<guid isPermaLink="true">https://michaelcurrin.github.io/jekyll-blog-demo/2018/12/22/first-post/</guid>
</item>
<item>
<title>Welcome to Jekyll!</title>
<description><p>You’ll find this post in your <code class="language-plaintext highlighter-rouge">_posts</code> directory. Go ahead and edit it and re-build the site to see your changes. You can rebuild the site in many different ways, but the most common way is to run <code class="language-plaintext highlighter-rouge">jekyll serve</code>, which launches a web server and auto-regenerates your site when a file is updated.</p>
<p>To add new posts, simply add a file in the <code class="language-plaintext highlighter-rouge">_posts</code> directory that follows the convention <code class="language-plaintext highlighter-rouge">YYYY-MM-DD-name-of-post.ext</code> and includes the necessary front matter. Take a look at the source for this post to get an idea about how it works.</p>
<p>Jekyll also offers powerful support for code snippets.</p>
<p>Using backticks.</p>
<div class="language-ruby highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="k">def</span> <span class="nf">print_hi</span><span class="p">(</span><span class="nb">name</span><span class="p">)</span>
<span class="nb">puts</span> <span class="s2">"Hi, </span><span class="si">#{</span><span class="nb">name</span><span class="si">}</span><span class="s2">"</span>
<span class="k">end</span>
<span class="n">print_hi</span><span class="p">(</span><span class="s1">'Tom'</span><span class="p">)</span>
<span class="c1">#=&gt; prints 'Hi, Tom' to STDOUT.</span>
</code></pre></div></div>
<p>Using <code class="language-plaintext highlighter-rouge">highlight</code>.</p>
<figure class="highlight"><pre><code class="language-ruby" data-lang="ruby"><span class="k">def</span> <span class="nf">print_hi</span><span class="p">(</span><span class="nb">name</span><span class="p">)</span>
<span class="nb">puts</span> <span class="s2">"Hi, </span><span class="si">#{</span><span class="nb">name</span><span class="si">}</span><span class="s2">"</span>
<span class="k">end</span>
<span class="n">print_hi</span><span class="p">(</span><span class="s1">'Tom'</span><span class="p">)</span>
<span class="c1">#=&gt; prints 'Hi, Tom' to STDOUT.</span></code></pre></figure>
<p>Check out the <a href="https://jekyllrb.com/docs/home">Jekyll docs</a> for more info on how to get the most out of Jekyll. File all bugs/feature requests at <a href="https://github.com/jekyll/jekyll">Jekyll’s GitHub repo</a>. If you have questions, you can ask them on <a href="https://talk.jekyllrb.com/">Jekyll Talk</a>.</p>
</description>
<pubDate>Tue, 18 Dec 2018 18:24:52 +0200</pubDate>
<link>https://michaelcurrin.github.io/jekyll-blog-demo/jekyll/update/2018/12/18/welcome-to-jekyll/</link>
<link href="https://michaelcurrin.github.io/jekyll-blog-demo/jekyll/update/2018/12/18/welcome-to-jekyll/"/>
<guid isPermaLink="true">https://michaelcurrin.github.io/jekyll-blog-demo/jekyll/update/2018/12/18/welcome-to-jekyll/</guid>
</item>
</channel>
</rss> |
MichaelCurrin
changed the title
refactor: use absolute URLs in atom.xml
use absolute URLs in atom.xml and fix broken URL
Sep 17, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Refactor
Adding
site.url
is not a good pattern in Jekyll.In particular, if someone uses this repo on a subpath, the code would break, because
site.url
does not includesite.baseurl.
If you do this:
That uses the site.url and site.baseurl values for you
e.g. I tested locally and got:
I also refactored the other parts not around posts, to use
absolute_url
.Note that when running locally you should do this, so that
site.url
is used as domain instead of localhost.JEKYLL_ENV=production bundle exec jekyll build --trace
Fix
I replaced feed.xml with atom.xml in the file.