Can't seem to Publish All

I’ve installed the Pub plug, and when I run the “Publish All” command it shows the “Publishing…” notification, but there is nothing in _public. I’ve literally copied the contents of the sample SETTINGS.md in my main settings yaml:

indexPage: "[[index]]"
libraries:
- import: "[[!silverbullet.md/Library/Core/*]]"
publish:
  # indexPage specific to the published site
  indexPage: README
  # Site title
  title: SilverBullet Publish
  # publishServer: https://zef-pub.deno.dev
  # Page containing the handlebars template to use to render pages
  # defaults to "!pub.silverbullet.md/template/page"
  template: template/page
  # Destination prefix for where to write the files to (has to be inside the space), defaults to public/
  destPrefix: _public/
  # Remove hashtags from the output
  removeHashtags: true
  # Entirely remove page links to pages that are not published 
  removeUnpublishedLinks: false
  # Publish ALL pages in this space (defaults to false)
  publishAll: true
  # Publish all pages with a specifix prefix only (assuming publishAll is off)
  #prefixes:
  #- /public
  # Publish all pages with specific tag only (assuming publishAll is off)
  tags:
  - public

I attempted to test the CLI version, but I have Silverbullet installed in a docker container, and when I drop into it the “silverbullet” command is not found, which means I’m not doing that properly of course.

What am I doing wrong?

Well, I managed to run the command line version from within the container (using deno). It shows a lot of output that looks good, even Publishing [(list of files)], but it ends with

An exception was thrown as a result of invoking function publishAll error: Not found
Not found

I don’t give up! Now I’m running silverbullet interactively (using docker run), and when I run the “Publish All” command, the output is:

Requested file template/page.md
Error GETting file template/page.md Not found

Do I have to create that template to get to publish? I tried creating a template/page.md file which is a template, but the error stays the same.

Well, the previous error was because in SETTINGS.md I had a custom page template to publish, so I got rid of it, now the error is:

An exception was thrown as a result of invoking function publishAll error: Cannot read properties of undefined (reading 'replaceAll')

Glad you figured it out in the end. The pub plug could use some love. Haven’t looked much at it recently.

Eventually figured it out, with the help of my wife. The problem was that the remote template at https://pub.silverbullet.md/template/page.md times out with a 522 error. We basically took that template from archive.org, copied it locally, and then it all worked, so it’s not a bug or anything like that, it’s just that the resource either isn’t there or the server doesn’t respond.

I know it’s probably not a popular plug, but the ability to export and convert things like dynamic tag lists to actual markdown (so they will still work without silverbullet) is pretty nice to future proof.