Skip to main content
ArcBlock Community

Discussion Kit embed question

Twelve
Developers
discuss-kitdiscussion

While embedding discuss kit into pages kit, is it possible to have the blogs have navigation buttons?

It seems like right now In my phone, only one blog posts shows up. This makes the page less dynamic.

Would be great if users could swipe through the blogs that have been embedded.

Also depending on the view, sometimes the title is cut off in my phone.

IMG_8504.png

6 replies

wangqi14 months ago(edited)

There are two ways to embed blogs into a PagesKit page:

  1. Go to "Add Component" > "Basic" > "Embed", enter the URL of the DiscussKit blog, and select the Blog Card option
  2. Install the "DiscussKit Components" Blocklet, then go to "Add Component" > "Resource", search for "blog" and select DiscussKit Blog List.

It looks like you're using the first method, which we haven’t focused on as much, we’ve primarily been supporting the second approach.

However, neither method currently supports the navigation buttons you mentioned. We’ll consider adding this feature in the future.

Additionally, you can create your own blog list component using the PagesKit component functionality.

Thanks for your feedback

Twelve13 months ago(edited)

Hi team,

I’m building a custom homepage component for my site that automatically displays the latest blog posts from Discuss Kit — including the cover image and title.

When I call:

javascriptCopy
bash
CopyEditGET /discuss-kit/api/blogs?page=1&size=20&locale=en&tagMatchStrategy=all&sort=-publishTime

The cover field in each blog item is just a path, e.g.:

javascriptCopy
arduino
CopyEdit"/8821de773b94ad0f28f127250f96ccdc.png"

I need to know the exact base URL to prepend to that path so the images load outside the blog page.

Could you confirm whether the correct pattern is one of these:

javascriptCopy
swift
CopyEdit/discuss-kit/<cover>
/.blocklet/proxy/<did-comments componentId>/<cover>
/.well-known/service/media/blocklet-service/<cover>
/discuss-kit/api/files/<cover>

…or something else entirely?

Once I have the correct base path, I can plug it into my component so the blog thumbnails display correctly on the homepage.

Thanks!

Twelve13 months ago

One other thing — would you consider making the DiscussKit Components Blocklet open source? It’s already such a useful bridge between DiscussKit and PagesKit, and if the community could fork/customize it, we could:

  • Add features (like navigation arrows, alternate layouts, responsive tweaks)
  • Help improve and maintain the component
  • Share back new layouts or functionality for other users

This would keep the official component simple while letting advanced users extend it for their own needs without re-inventing the wheel.

Happy to help with testing or contributing if you do decide to open it up.

Twelve13 months ago

Hello z1ed9VLnQ2zKph3ecTdBoAhvy6xGvXEexpy any ideas on how to build this?

wangqi13 months ago(edited)

可以尝试使用以下代码获取完整的封面图 URL

javascriptCopy
import { getComponentMountPoint, joinURL } from '@blocklet/pages-kit/builtin/utils'

const discussKitMountPoint = getComponentMountPoint('did-comments');
const cover = '/0218b85a4c2e1306852dc15a558fb93d.jpeg';
const coverUrl = joinURL(window.location.origin, discussKitMountPoint, 'uploads', cover);
console.log(coverUrl)  

image.png

Twelve13 months ago

Thank you.

Reply