ActivityPub Network Reader cards in posts look bad? Check your 404s

I’ve been grumbling since getting my ActivityPub working that that the layouts of a lot of the cards seemed broken. Today, I discovered that it was me. Yep. The reader was making requests to {myadmindomain}/public/cards.min.js and -css. Which aren’t served from the admin domain. I got those requests correctly redirected over to the main site domain, and now things look better.

I still have concerns that javascript, custom styles, advertisements, embeds in html cards, and lots of other good stuff that works on web doesn’t work in the reader, but some of the problem was actually my self-hosting setup.

2 Likes

You aren’t saying that bookmark cards appear fine in the reader for you, are you? Cause for me they’ve always appeared broken (on Ghost(Pro)).

Website:

Reader:

And yes, I too think it would be great if embeds in HTML cards would work well in the reader (like those Manual Social Media Embeds for Ghost that I created), but do you think that can actually be expected?

Yeah, they actually are better for me now. Ghost wasn’t loading the cards styles. Do you see a 404 in your browser console? That was the big hint for me. Ghost was asking the admin domain for them. Oops.

(I still want all the other html & js embeds to work, mind you.)

@Stromfeldt - I know you have a bunch of custom code you use for bookmarks – you aren’t excluding bookmarks in your cardAssets in your config file by chance, are you?

1 Like

Yes, you’re correct @Cathy_Sarisky, as I’ve just noticed and recalled I am in fact excluding them. I had some issues with bookmark cards upon the release of 5.0, and so followed these instructions to insert the following into my package.json file.

  "config": {
    "card_assets": {
         "exclude": ["bookmark", "gallery"]
     }
  }

Having just re-seen this code, it may also be why galleries occasionally behave a bit wonky on my site. For both reasons I’m gonna have to tinker around a bit.

Thanks very much for inadvertently getting me to look at this, particularly in terms of the wonky galleries (which, being front-facing, are much more of an issue).

Well, after having removed the bookmark exclusion from the config (and then updated my theme’s CSS to take that into account), bookmark cards in the reader haven’t changed. They’re still broken. I even found a post that I’d never visited before just to confirm that the post and/or its styling hadn’t been cached in one way or another, but also no go.

That being said, I also removed the gallery exclusion from the config, and whad’ya know, but galleries now work properly on my site. Bonus!

Restart Ghost? That file gets cached a super long time otherwise.

No can do. This is on Ghost(Pro).

Try switching to another theme and back? That should reinitialize.

And clear browser cache is good, too. Depends on where the caching is!

Hmm, no go. I switched themes around, after which I then opened up Ghost admin in a browser it’s never been opened in before. Nope.

Perhaps this is some kind of a bug, as you mentioned?

¯\_(ツ)_/¯