Plugins not working!

Hello everybody, I’m getting crazy: on my website some plugins work and some don’t. I tried using them separately in another test blog, and they do work, but most of the ones I use right now on my website don’t work. I am sure everything is installed correctly and every dependency is where it should be. I already tried uninstalling and reinstalling from scratch Ruby, Jekyll and Bundler, with no success. I also deleted my Gemfile and built a new one from scratch. Please, help me! I have no idea what to do!

Here is my plugins list in _config.yml:

plugins:
  - jekyll-feed
  - jekyll-seo-tag
  - jekyll-sitemap
  - jekyll-last-modified-at
  - jekyll-target-blank
  - jekyll-redirect-from

(the only one which works, right now, is the seo one)

If it can be useful, I can provide any further info.

Thakns a lot in advance, any help could actually save me!

Tommi

Let’s start with site map

Is that in your Gemfile?
When you install it locally are there errors?
When you build, are there errors?
Does it show up in bundle list?

And if it works locally, is the problem only on the remote site?

1 Like

Share a Gemfile please. Your config looks fine.

1 Like

Thanks a lot for your interest, @MichaelCurrin.

  1. This is my Gemfile:

    source "https://rubygems.org"
    
    gem "jekyll"
    
    group :jekyll_plugins do
        gem "jekyll-feed"
        gem "jekyll-seo-tag"
        gem "jekyll-sitemap"
        gem "jekyll-last-modified-at"
        gem "jekyll-redirect-from"
        gem "jekyll-target-blank"
    end
    
    install_if -> { RUBY_PLATFORM =~ %r!mingw|mswin|java! } do
        gem "tzinfo"
        gem "tzinfo-data"
    end
    
  2. Plugins don’t work neither locally or online (I use Netlify to deploy the website).

  3. When I build, there are no errors. This is what I get when I run bundle exec jekyll or jekyll serve:

        Configuration file: /Users/xplosionmind/programming/xplosionmind/_config.yml
                Source: /Users/xplosionmind/programming/xplosionmind
           Destination: /Users/xplosionmind/programming/xplosionmind/_site
     Incremental build: disabled. Enable with --incremental
          Generating...
           Jekyll Feed: Generating feed for posts
    
                        done in 10.609 seconds.
     Auto-regeneration: enabled for '/Users/xplosionmind/programming/xplosionmind'
    LiveReload address: http://127.0.0.1:35729
        Server address: http://127.0.0.1:4000//
      Server running... press ctrl-c to stop.
    
  4. And this is what I get when typing bundle list:

    Gems included by the bundle:
      * addressable (2.7.0)
      * colorator (1.1.0)
      * concurrent-ruby (1.1.7)
      * em-websocket (0.5.1)
      * eventmachine (1.2.7)
      * ffi (1.13.1)
      * forwardable-extended (2.6.0)
      * http_parser.rb (0.6.0)
      * i18n (1.8.5)
      * jekyll (4.1.1)
      * jekyll-feed (0.15.0)
      * jekyll-last-modified-at (1.3.0)
      * jekyll-redirect-from (0.16.0)
      * jekyll-sass-converter (2.1.0)
      * jekyll-seo-tag (2.6.1)
      * jekyll-sitemap (1.4.0)
      * jekyll-target-blank (2.0.0)
      * jekyll-watch (2.2.1)
      * kramdown (2.3.0)
      * kramdown-parser-gfm (1.1.0)
      * liquid (4.0.3)
      * listen (3.2.1)
      * mercenary (0.4.0)
      * mini_portile2 (2.4.0)
      * nokogiri (1.10.10)
      * pathutil (0.16.2)
      * posix-spawn (0.3.15)
      * public_suffix (4.0.5)
      * rb-fsevent (0.10.4)
      * rb-inotify (0.10.1)
      * rexml (3.2.4)
      * rouge (3.22.0)
      * safe_yaml (1.0.5)
      * sassc (2.4.0)
      * terminal-table (1.8.0)
      * unicode-display_width (1.7.0)
    Use `bundle info` to print more detailed information about a gem
    

For completeness (and also because it’s like hell, everything seems to be ok) I’m pasting my whole _config.yml below:

title: xplosionmind
email: tommiboom@protonmail.com
description: >- # this means to ignore newlines until "baseurl:"
  A web version of the mess inside Tommi Boom’s mind
baseurl: "/" # the subpath of your site, e.g. /blog
url: "https://tommi.space" # the base hostname & protocol for your site, e.g. http://example.com
twitter_username: xplosionmind
github_username: xplosionmind
git_repository: xplosionmind
future: true
profile: true
livereload: true
strict_front_matter: true

collections:
  posts:
    excerpt_separator: "<!--more-->"
    redirect_from:
      - "/:date/:title"
      - "/:categories/:title"
      - "/:categories/:date/:title"
  categories:
    output: true
  poetry:
    output: true
  stuff:
    output: true
  jar:
    output: true
    layout: "jar"
    permalink: "/:title"
    lang: "en"
    redirect_from: "/:title"
    toc: "true"
  filinge:
    output: true

kramdown:
  syntax_highlighter_opts:
    default_lang: zsh

plugins:
  - jekyll-feed
  - jekyll-seo-tag
  - jekyll-sitemap
  - jekyll-last-modified-at
  - jekyll-target-blank
  - jekyll-redirect-from

sass:
    style: compressed

defaults:
  -
    scope:
      path: ""
    values:
      layout: "wrapper"
      ref: "/:title"
      permalink: "/:title"
    
  -
    scope:
      path: ""
      type: "posts"
    values:
      layout: "post"
      lang: "it"
      permalink: "/:title"
      excerpt_separator: "<!--more-->"
      redirect_from:
        - "/:date/:title"
        - "/:categories/:title"
        - "/:categories/:date/:title"

  -
    scope:
      path: ""
      type: "categories"
    values:
      layout: "category"
      permalink: "/category/:title"

  -
    scope:
      path: ""
      type: "poetry"
    values:
      layout: "poetry"
      lang: "it"
  -
    scope:
      path: "/visioni"
    values:
      image: true
  -
    scope:
      path: ""
      type: "jar"
    values:
      layout: "jar"
      permalink: "/:title"
      lang: "en"
      redirect_from: "/:title"
      toc: "true"

  -
    scope:
      path: ""
      type: "filinge"
    values:
      layout: "post"
      lang: "it"
      primary: "var(--green)"
      style: "true"

Thanks for sharing.

I ran those files locally.

There’s nothing wrong with your plugin setup.

Here is robots.txt for example

Sitemap: http://localhost:4000/sitemap.xml

As a small thing, I set baseurl to "" and not "/" to take off the slash here:

LiveReload address: http://127.0.0.1:35729
    Server address: http://127.0.0.1:4000//
1 Like

But, your use of permalink is breaking the site for me, if I use your config as is…

Screen Shot 2020-08-14 at 10.07.31 am

You set default permalink here and uncomment your use of permalink in a scope (that’s how I got it to work in my previous answer).

defaults:
  - scope:
      path: ""
    values:
      layout: "wrapper"
      ref: "/:title"
      permalink: "/:title"

The preferred way to set permalinks it not using “defaults” section but like this at the top level:

permalink: "/:title"

defaults:
  - scope:
      path: ""
    values:
      layout: "wrapper"
      ref: "/:title"
      # permalink: "/:title"

The other permalink sections might be okay, but you can uncomment them if you have issues.


Further notes

You can also use “pretty”`. See list here in docs for reference https://jekyllrb.com/docs/permalinks/ Note that the short names like pretty only work in the top level field and not at a lower level like on a page.

Also defaults are meant to be set in order of priority and matching as they go down the list, so you might to move your first default option to the end are posts, poetry etc.

1 Like

Here is my go-to Makefile I use across projects. It includes livereload so I don’t need it in the config. And then it is easy to change by having to make commands - one with and without reload.

I find --trace is great for debugging errors.

You can use --profile to match your profile setting but I rarely use it

Oh, wow. This is great. Thank you so much, @MichaelCurrin!

I fixed a few things, but, unfortunately, the Jekyll target blank plugin still isn’t working.

I’m having trouble with this plugin since the beginning, it never worked. I opened an issue on the GitHub page of the project and we came to the conclusion it’s a problem of my site, not of the plugin, since it works if I install it on a fresh/blank website.

Do you have any idea what could be the problem? If you solve this, too, I’m gonna mention you on the website. You would’ve literally saved me.

I’m sorry, I’m quite new to Jekyll and I definitely know nothing about Ruby. What’s a Makefile? How should I use it and what’s it useful for?

Thanks again, a lot!

I’ll check out target blank. Haven’t used it before.

I started writing a long answer on Makefile and then turned it into a blog post…

1 Like

Ahah wow, this is nice. Glad to be the inspirator.

Thanks a lot for Target Blank, lemme know if you find any solution.

Using your setup, Target Blank is working fine for me based on installing and configuring. I have 2.0.0 as you do.

My index.md page

---
title: Test
---

Hello world


[External link](https://example.com)

Compiled to

<h1>Test</h1>

<p>Hello world</p>

<p><a href="https://example.com" target="_blank" rel="noopener noreferrer">External link</a></p>

I might use Target Blank for my own projects! Though I’d also look at adding an arrow symbol so users know they are going to an outbound link.

So maybe you are just triggering it incorrectly.

You need https:// in general to signify an external link for markdown

[link](example.com)

That compiles to

<p><a href="example.com">External link</a></p>

Which means mywebsite.com/example.com

So always use https:// (or http://) for external URLs.

Yep, I’m doing that… sh*t. There’s no way I can make it work…

I’ll try to reinstall everything from scratch again, but I have no hope… never worked before, it’s not gonna work now.

Try make a fresh repo with the configs and a layout and index.md page and then test the link that is generated. As that is what I did.

If it works then it means there are other things in your project like in plugins dir which are breaking it.

If it doesn’t work then it means there’s a problem on the system level despite trying to rebuild gems afresh.

You can also try the minimal file setup as a feature branch as Netlify builds feature branches to preview URLs.

You can also use the verbose flag to see line by line when the gem gets called and if there are any errors or weird log messages.

You can also just leave that gem out and get by with using the others.

1 Like