minima icon indicating copy to clipboard operation
minima copied to clipboard

Broken link to /feed.xml out-of-the-box.

Open gsnedders opened this issue 9 years ago • 15 comments

Out of the box, minima produces a broken link to /feed.xml, because it requires jekyll-feed. Minima should either depend on jekyll-feed or not output the link to the feed.

gsnedders avatar Jan 04 '17 16:01 gsnedders

For reference, here is the offending line. We wouldn't want to use this with jekyll-feed anyway, since that generates Atom rather than application/rss+xml.

pathawks avatar Jan 04 '17 16:01 pathawks

@pathawks I was thinking of adding jekyll-feed as a runtime dependency ~~in the gemspec, modify example Gemfile and _config.yml and use feed meta instead in the include,~~ does this seem OK to you?

On a side note, an html-proofer test of the output wouldn't hurt to prevent this type of error.

DirtyF avatar Jan 04 '17 17:01 DirtyF

I seem to remember their being an intentional decision not to tie minima to jekyll-feed, as minima is supposed to be a minimal.

Can't find that thread now.

pathawks avatar Jan 04 '17 17:01 pathawks

I for one would rather it not be a dependency, FWIW, especially for sites which don't have any posts (i.e., consist merely of pages and collections).

gsnedders avatar Jan 04 '17 17:01 gsnedders

I agree with the line of thought that minima should not include jekyll-feed. Feeds could be easily added by those who need it.

And agree with the html-proofer test too. That's how I ran into this problem myself.

Edit: For now, I'm just running my tests with the following command:

htmlproofer --url-ignore /feed.xml ./_site

ricalo avatar Jan 04 '17 19:01 ricalo

As a workaround, I used this in _layouts/home.html:

  {% if site.gems contains "jekyll-feed" %}
    <p class="rss-subscribe">subscribe <a href="{{ "/feed.xml" | relative_url }}">via RSS</a></p>
  {% endif %}

alzeih avatar Jan 09 '17 23:01 alzeih

There's (only) one more place that references feed.xml:

_includes/head.htmlcontains

<link rel="alternate" type="application/rss+xml" title="{{ site.title | escape }}" href="{{ "/feed.xml" | relative_url }}">

So perhaps this should be guarded with a check also?

alzeih avatar Jan 27 '17 03:01 alzeih

If you use jekyll new, then you get the dependency for jekyll-feed:

See https://github.com/jekyll/jekyll/blob/af5d096/lib/site_template/_config.yml#L31

So someone just forgot to add that dependency when the theme was forked to this repo last year?

ashawley avatar May 29 '17 18:05 ashawley

@DirtyF: I was thinking of adding jekyll-feed as a runtime dependency @pathawks: ..an intentional decision not to tie minima to jekyll-feed as minima is supposed to be a minimal.

Is the above still valid, esp. since Minima will now come with jekyll-seo-tag included?

ashmaroli avatar Aug 17 '17 14:08 ashmaroli

I think minima should really be minimal, and not require jekyll-feed or jekyll-seo-tag (or any other jekyll plugins).

If that's not possible, I think it should at least degrade gracefully.

Maybe the default jekyll post could contain instructions (or a link to docs) for finding and installing plugins? https://github.com/jekyll/jekyll/blob/master/lib/site_template/_posts/0000-00-00-welcome-to-jekyll.markdown.erb

alzeih avatar Jan 16 '18 00:01 alzeih

Yeah, hopefully the "degrade gracefully" fix in #129 gets merged since jekyll new currently sets the theme to minima and adds jekyll-feed.

ashawley avatar Jan 16 '18 02:01 ashawley

@ashawley: I've asked for the remove option in #182, for the reasons I've outlined there.

If this patch gets accepted, and the minima gem is released with this patch, then the Jekyll site_template/_config.yml should probably drop jekyll-feed too. However the extra plugin probably won't break anything, so if this takes a while to be removed from the _config.yml it shouldn't be a problem. (or left there as an example of how to use plugins).

jekyll-feed's documentation is fairly good, as is Jekyll's on plugins. I think the effort in adding a plugin and configuring it is less effort than obtaining, modifying and maintaining two minima template files in every jekyll app that uses minima for OOTB to not 404. That does depend on whether most users use RSS or not though.

Graceful degradation is limited by some technical reasons of Jekyll. The one's I can think of off hand are the multiple places plugins are enabled (site.gems, site.plugins, Gemfile, _plugins), and something to do with how liquid handles missing tags guarded by if checks still crashes. These seem like issues that are much harder to solve right now, but if these are fixed then I'd be absolutely for graceful degradation.

alzeih avatar Jan 16 '18 03:01 alzeih

Last I checked, site.gems will work with Gemfile and is forwards compatible with the new site.plugins. But this should be taken up at #129 and discussed there. There's no disputing that minima is broken out of the box as this issue documents.

ashawley avatar Jan 16 '18 04:01 ashawley

Yep, you're right about site.gems and site.plugins. I've no idea how to query for plugins enabled in a Gemfile with the :jekyll-plugins group though.

alzeih avatar Jan 16 '18 05:01 alzeih

I've no idea how to query for plugins enabled in a Gemfile with the :jekyll-plugins group though.

The fact is that you cannot query for plugins activated via :jekyll_plugins group.. Its a convenience block.. same as how Jekyll 3.5 onwards will automatically activate a theme's whitelisted runtime_dependencies

ashmaroli avatar Jan 16 '18 05:01 ashmaroli