IndieConnector questions: Text from post instead of description, and posting without remote panel

Hi,

I’m playing around with IndieConnector, to use it to post to Mastodon. I’m using Kirby 4.5, the ZOON theme, the latest version of IndieConnector and on a local installation.

I have two questions:

1. How can I get IndieConnector to just grab the first few hundred characters from my post?

I tried using 'mauricerenck.indieConnector.post.textfields' => ['description'], but I think because in ZOON, the description field in the yml is extends: fields/writer, what shows up in my Mastodon post is <p>My description text</p>, so that didn’t work.

The content in my article.txt looks like the following:

Layout: [{"attrs":{"background":[],"overlay":0.5,"blur":"false","panel":"","autogrid":"false","class":""},"columns":[{"blocks":[{"content":{"text":"Lorem ipsum dolor sit amet, consectetur adipiscing elit.","class":""},"id":"7daed9a0-dae6-4e03-9801-42955d55fff2","isHidden":false,"type":"markdown"}],"id":"e2f9635b-f8a0-44e5-8b45-53dd37c87d28","width":"1/1"}],"id":"4b2fc629-482a-44bc-ac65-1fd08b46ac25"}]

If I use'mauricerenck.indieConnector.post.textfields' => ['layout'],, I get all of the above in my Mastodon post.

However, if I use 'mauricerenck.indieConnector.post.textfields' => ['content'], or 'mauricerenck.indieConnector.post.textfields' => ['text'],, I just get the post title instead.

2. Does posting work without panel enabled on remote server?

I noticed that IndieConnector posts from localhost, however that means that my post will be posted to Mastodon before I manage to upload it via FTP. Does using IndieConnector mean I have to enable the Panel on my remote server? I was originally going to work without it.

Thank you for any advice!

Hey there,

IndieConnector uses a Kirby Hook which is fired when a page is published. IndieConnector then sends a post to Mastodon or Bluesky. When you use the panel only on your local machine and upload your markdown afterwards, the plugin has no trigger to listen to on the remote machine, so this won’t work.

You should disable posting to mastodon or even sending webmentions from your local machine, you can do this with a config.php for your local machine. Our set your local domain in the config 'mauricerenck.indieConnector.localhosts' => ['your-hostname.dev'].

It might be possible to trigger posting after uploading the files by triggering a Webhook. I’ll think about it, currently this is not possible. If you upload your file as a draft and then programmatically publish it on the remote machine, the hook should be triggered and IC will start working, this might be another solution.

IC currently only supports simple text(area) fields for posting to external services. So you may need to add a field to your blueprint where you can write a short summary. If you configure a field the plugin cannot read for whatever reason, it’ll fallback to the title. When you configure a layout field, the plugin will simply use the value of this field, which is the JSON code you described, so you don’t want that.

I’ll put sending from other field types on my to do list. For now I would recommend the described textarea or text field for posting.

Maurice

1 Like

Thank you! Yes, I had figured out to create a new field called summary and that worked. And for posting, I may just change my plans and enable Panel online when I do put my website live. Thank you again.

1 Like