Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Aug 14, 2025

This PR moves carbon ads from their current dual placement (bottom of pages + sidebar) to appear exclusively in the sidebar for improved visibility and revenue generation.

Changes Made

1. Removed carbon ads from page bottom

  • Eliminated carbon ads from DocPaginator component that appeared at the bottom of documentation pages
  • Removed the <Carbon /> component and its wrapper div from the pagination area

2. Enhanced Carbon component for sidebar optimization

  • Added optional sidebar prop to enable conditional styling
  • Implemented optimized margins for sidebar placement: mt-6 mb-4 mx-0 (vs previous m-4 space-y-2)
  • Maintains backward compatibility with default styling

3. Optimized sidebar placement

  • Updated TOCItems wrapper to use <Carbon sidebar={true} /> for better integration
  • Ads now appear after table of contents with reduced margins for improved visibility

Impact

Before: Carbon ads appeared in two locations with poor performance

  • ❌ Bottom of pages (low visibility, poor engagement)
  • ⚠️ Sidebar (suboptimal styling)

After: Single, optimized sidebar placement

  • ✅ Exclusive sidebar positioning after table of contents
  • ✅ Optimized spacing and margins for better visibility
  • ✅ Improved revenue potential as requested by Carbon

This change addresses Carbon's feedback about poor ad placement performance by consolidating to a single, well-positioned location in the sidebar where users are more likely to engage with the content.

Fixes #365.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copy link

netlify bot commented Aug 14, 2025

Deploy Preview for homarr-docs ready!

Name Link
🔨 Latest commit
🔍 Latest deploy log https://app.netlify.com/projects/homarr-docs/deploys/689e18ba6df11b0fe5b13166
😎 Deploy Preview https://deploy-preview-366--homarr-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@Copilot Copilot AI changed the title [WIP] Feat: Move carbon ads to the sidebar feat: Move carbon ads from page bottom to sidebar only Aug 14, 2025
@Copilot Copilot AI requested a review from ajnart August 14, 2025 08:25
Copilot finished work on behalf of ajnart August 14, 2025 08:25
Copy link
Contributor

@ajnart ajnart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot the PR is not building.
Here is what netlify tells me :

The Netlify deploy errored, with the following guidance provided:

Diagnosis:
The build failure is due to the JavaScript heap running out of memory during the build process, resulting in a fatal error.

Solution:
To resolve this issue, you can increase the Node.js memory limit. You can do this by adding an environment variable NODE_OPTIONS with an increased memory limit before the build command runs.

  1. Add the following line in your Netlify site's environment variables configuration:

    Key: NODE_OPTIONS
    Value: --max_old_space_size=4096
    

    This will increase the Node.js memory limit to 4GB, which should help prevent the out-of-memory issue during the build process.

  2. After setting the environment variable, trigger a new build to verify if the memory limit increase resolves the build failure.

The relevant error logs are:

Line 130: > [email protected] build /opt/build/repo
Line 131: > docusaurus build
Line 132: �[36m�[1m[INFO]�[22m�[39m �[34m�[1m[en]�[22m�[39m Creating an optimized production build...
Line 133: [info] [webpackbar] Compiling Client
Line 134: [info] [webpackbar] Compiling Server
Line 135: [success] [webpackbar] Server: Compiled successfully in 2.26m
Line 136: <--- Last few GCs --->
Line 137: [2204:0x37cfa000] 193301 ms: Mark-Compact 1959.2 (2051.2) -> 1916.6 (2027.1) MB, pooled: 16 MB, 643.26 / 0.00 ms (average mu
Line 138: [2204:0x37cfa000] 194233 ms: Mark-Compact 1982.8 (2081.9) -> 1864.4 (1975.9) MB, pooled: 16 MB, 711.85 / 0.00 ms (average mu
Line 139: <--- JS stacktrace --->
Line 140: FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
Line 141: ----- Native stack trace -----
Line 142: 1: 0xe1603a node::OOMErrorHandler(char const*, v8::OOMDetails const&) [node]
Line 143: 2: 0x11e3540 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [node]
Line 144: 3: 0x11e3817 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [node]
Line 145: 4: 0x14110f5 [node]
Line 146: 5: 0x1411123 [node]
Line 147: 6: 0x142a1fa [node]
Line 148: 7: 0x142d3c8 [node]
Line 149: 8: 0x1c93091 [node]
Line 150: Aborted
Line 151: �[41m�[30m ELIFECYCLE �[39m�[49m �[31mCommand failed with exit code 134.�[39m
Line 152: �[91m�[1m​�[22m�[39m
Line 153: �[91m�[1m"build.command" failed �[22m�[39m
Line 154: �[91m�[1m────────────────────────────────────────────────────────────────�[22m�[39m
Line 155: ​
Line 156: �[31m�[1mError message�[22m�[39m
Line 157: Command failed with exit code 134: pnpm run build
Line 158: ​
Line 159: �[31m�[1mError location�[22m�[39m
Line 160: In Build command from Netlify app:
Line 161: pnpm run build
Line 162: ​
Line 163: �[31m�[1mResolved config�[22m�[39m
Line 164: build:
Line 165: command: pnpm run build
Line 166: commandOrigin: ui
Line 167: environment:
Line 168: - ALGOLIA_API_KEY
Line 169: - ALGOLIA_BASE_URL
Line 170: - REVIEW_ID
Line 171: publish: /opt/build/repo/build
Line 172: publishOrigin: ui
Line 173: plugins:
Line 174: - inputs: {}
Line 175: origin: ui
Line 176: package: "@algolia/netlify-plugin-crawler"
Line 177: - inputs: {}
Line 178: origin: ui
Line 179: package: "@netlify/plugin-lighthouse"
Line 180: Failed during stage 'building site': Build script returned non-zero exit code: 2
Line 181: Build failed due to a user error: Build script returned non-zero exit code: 2
Line 182: Failing build: Failed to build site
Line 183: Finished processing build request in 4m5.147s

Copy link
Contributor Author

Copilot AI commented Aug 14, 2025

@copilot the PR is not building.
Here is what netlify tells me :
...

I've reproduced the memory issue locally and confirmed that the build succeeds with the increased memory limit you suggested. The issue is not related to my code changes (which actually reduce component rendering), but rather the Docusaurus build process requiring more memory.

The solution you identified is correct:

  1. Add NODE_OPTIONS environment variable with value --max_old_space_size=4096 in Netlify
  2. Trigger a new build

I tested locally with both limited memory (failed) and increased memory (succeeded), confirming this will resolve the build issue.

Copilot finished work on behalf of ajnart August 14, 2025 08:56
@Copilot Copilot AI requested a review from ajnart August 14, 2025 08:56
@ajnart ajnart marked this pull request as ready for review August 18, 2025 16:04
@ajnart ajnart merged commit 1e85161 into master Aug 18, 2025
4 of 9 checks passed
@ajnart ajnart deleted the copilot/fix-365 branch August 18, 2025 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feat: Move carbon ads to the sidebar
2 participants