# استخدام ميزة الصفحة الرئيسية المخصصة الجديدة

**URL:** https://meta.discourse.org/t/using-the-new-custom-homepage-feature/302496
**Category:** Development
**Created:** [4 أبريل 2024، 9:43م UTC](https://meta.discourse.org/t/using-the-new-custom-homepage-feature/302496 "2024-04-04T21:43:02Z")
**Posts on this page:** 1
**Showing post:** 45

<div class="post-metadata">

### Author: ![manuel](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/manuel/32/468169_2.png) [@manuel](https://meta.discourse.org/u/manuel)
#### Post date: [24 مارس 2025، 10:19ص UTC](https://meta.discourse.org/t/using-the-new-custom-homepage-feature/302496/45 "2025-03-24T10:19:33Z")

</div>

لقد كنت أستخدم هذا كثيرًا، جنبًا إلى جنب مع مكون [Homepage Blocks](https://meta.discourse.org/t/homepage-blocks/347066) الخاص بي. اقتراحان:

## الفئات الافتراضية

لقد قمت بتعديل المكون بحيث يضيف دائمًا فئة _homepage_ إلى الجسم وفئة _active_ إلى رابط شريط جانبي مع `href=\"/custom\"`. هل يمكن أن تكون هذه الميزات افتراضيات للمعدل؟

```plaintext
  api.onPageChange(() => {
    const currentRoute = router.currentRoute.name;
    const customHomepageLink = document.querySelector(
      '.sidebar-section-link[href="/custom"]'
    );

    if (currentRoute === "discovery.custom") {
      document.body.classList.add("homepage");
      if (customHomepageLink) {
        customHomepageLink.classList.add("active");
      }
    } else {
      document.body.classList.remove("homepage");
      if (customHomepageLink) {
        customHomepageLink.classList.remove("active");
      }
    }
  });
});

```

_(في البداية أردت إضافة رابط الشريط الجانبي افتراضيًا، ولكن عدم القدرة على تعديل مثل هذا الرابط في الواجهة يبدو لي عيبًا حقيقيًا، انظر [How can I edit sidebar links that are added with api.addCommunitySectionLink?](https://meta.discourse.org/t/how-can-i-edit-sidebar-links-that-are-added-with-api-addcommunitysectionlink/357629))_

## عرض سريع لأول مرة

لن أعرف كيف أتعامل مع هذا من الناحية الفنية. لكنني أتساءل، إذا وصلنا إلى صفحة رئيسية مخصصة، والتي تعرض عادةً مجموعة محدودة من المحتوى، هل يمكننا تحسين FCP للصفحة الرئيسية وعرضها بالفعل أثناء تحميل بقية التطبيق؟ ربما أساء فهم طبيعة بنية التطبيق الواحد هنا.. إنه مجرد شعور مخيب للآمال بعض الشيء أن يتم تقديم الرسوم المتحركة للتحميل أولاً، ثم الوصول إلى صفحة بسيطة إلى حد ما، والتي يمكن أن تكون موجودة على الفور بحد ذاتها.

---

_[View the full topic](https://meta.discourse.org/t/using-the-new-custom-homepage-feature/302496)._
