Skip to content

Add "Improve this Blog Post" banner after Giscus comments on individual blog posts#1663

Merged
sanjay-kv merged 3 commits into
mainfrom
copilot/add-banner-feature-individual-posts
May 23, 2026
Merged

Add "Improve this Blog Post" banner after Giscus comments on individual blog posts#1663
sanjay-kv merged 3 commits into
mainfrom
copilot/add-banner-feature-individual-posts

Conversation

Copilot AI commented May 23, 2026

Copy link
Copy Markdown
Contributor

Adds a contribution CTA banner to individual blog post pages, rendered after the Giscus comments section. The banner provides direct links to edit the post on GitHub and view contributing guidelines.

Type of Change

  • New feature (e.g., new page, component, or functionality)
  • Bug fix (non-breaking change that fixes an issue)
  • UI/UX improvement (design, layout, or styling updates)
  • Performance optimization (e.g., code splitting, caching)
  • Documentation update (README, contribution guidelines, etc.)
  • Other (please specify):

Changes Made

src/theme/BlogPostItem/Footer/index.tsx

  • Appended an <section class="improveBanner"> block after <GiscusComments forceRender />, gated on isBlogPostPage
  • "Edit this Post on GitHub"metadata.editUrl (Docusaurus auto-generates this per post from blog.editUrl in docusaurus.config.ts)
  • "Contributing Guidelines"https://www.recodehive.com/docs/Getting-Started

src/theme/BlogPostItem/Footer/styles.module.css

  • Added layout/style classes for the banner: .improveBanner, .improveIconWrap, .improveContent, .improveTitle, .improveDescription, .improveActions, .improveEditButton, .improveGuidelinesButton
  • Static fallback colors precede each color-mix() call for older browser compatibility
  • Mobile breakpoint (≤640px): banner stacks vertically, buttons stretch full-width
{isBlogPostPage && (
  <section className={styles.improveBanner} aria-label="Improve this blog post">
    {/* pencil icon */}
    <div className={styles.improveContent}>
      <h3 className={styles.improveTitle}>Improve this Blog Post</h3>
      <p className={styles.improveDescription}>...</p>
      <div className={styles.improveActions}>
        {metadata.editUrl && (
          <Link className={styles.improveEditButton} to={metadata.editUrl} target="_blank">
            {/* GitHub SVG */} Edit this Post on GitHub
          </Link>
        )}
        <Link className={styles.improveGuidelinesButton} to="https://www.recodehive.com/docs/Getting-Started" target="_blank">
          {/* book SVG */} Contributing Guidelines
        </Link>
      </div>
    </div>
  </section>
)}

Dependencies

  • No new dependencies. Uses existing Docusaurus useBlogPost() hook — metadata.editUrl is populated automatically when blog.editUrl is set in config (already configured).

Checklist

  • My code follows the style guidelines of this project.
  • I have tested my changes across major browsers and devices
  • My changes do not generate new console warnings or errors .
  • I ran npm run build and attached screenshot(s) in this PR.
  • This is already assigned Issue to me, not an unassigned issue.

@vercel

vercel Bot commented May 23, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
recode-website Ready Ready Preview, Comment May 23, 2026 3:56am

Copilot AI changed the title [WIP] Add banner feature on individual blog posts Add "Improve this Blog Post" banner after Giscus comments on individual blog posts May 23, 2026
Copilot AI requested a review from sanjay-kv May 23, 2026 03:56
@sanjay-kv sanjay-kv marked this pull request as ready for review May 23, 2026 04:07
@sanjay-kv sanjay-kv merged commit 011a16f into main May 23, 2026
7 checks passed
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.

New banner feature on indivitual blog posts

2 participants