Skip to content

Sidebar

The sidebar layout configuration controls the sidebar display position and component arrangement.

Config File

src/config/sidebarConfig.ts

Layout Configuration

PropertyTypeDefaultDescription
enablebooleantrueEnable sidebar
positionstring"both"Sidebar position: "left", "right", "both"
tabletSidebarstring"left"Which sidebar to show on tablet (769-1279px), only for "both"
showBothSidebarsOnPostPagebooleantrueShow both sidebars on post pages when using single sidebar

Component Configuration

Each sidebar component supports:

PropertyTypeRequiredDescription
typestringYesComponent type
enablebooleanYesWhether enabled
positionstringYesPosition: "top" fixed, "sticky" sticky
showOnPostPagebooleanNoShow on post detail pages
showOnNonPostPagebooleanNoShow on non-post pages
configIdstringNoConfig ID (for advertisement component)
responsiveobjectNoResponsive configuration

Available Component Types

TypeDescription
"profile"User profile
"announcement"Announcement
"music"Music player
"categories"Categories
"tags"Tags
"stats"Site statistics
"calendar"Calendar
"sidebarToc"Table of contents (post pages only)
"advertisement"Advertisement

TIP

Component rendering order depends on their position in the config array, but position: "top" components render before position: "sticky" components.

ts
leftComponents: [
  {
    type: "profile",
    enable: true,
    position: "top",
    showOnPostPage: true,
  },
  {
    type: "categories",
    enable: true,
    position: "sticky",
    showOnPostPage: true,
    responsive: {
      collapseThreshold: 5,
    },
  },
],
ts
rightComponents: [
  {
    type: "stats",
    enable: true,
    position: "top",
    showOnPostPage: true,
  },
  {
    type: "sidebarToc",
    enable: true,
    position: "sticky",
    showOnPostPage: true,
    showOnNonPostPage: false,
  },
],

Mobile Bottom Components

On mobile (< 768px), sidebar components display at the bottom of the page. Configure separately with mobileBottomComponents:

ts
mobileBottomComponents: [
  { type: "profile", enable: true, showOnPostPage: true },
  { type: "categories", enable: true, showOnPostPage: true, responsive: { collapseThreshold: 5 } },
  { type: "stats", enable: true, showOnPostPage: true },
],

WARNING

Mobile bottom components are configured independently from left/right sidebars.