Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 73 additions & 0 deletions src/theme/BlogPostItem/Footer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,79 @@ export default function BlogPostItemFooterWrapper(props: Props): JSX.Element {
</section>
)}
{isBlogPostPage && <GiscusComments forceRender />}
{isBlogPostPage && (
<section className={styles.improveBanner} aria-label="Improve this blog post">
<div className={styles.improveIconWrap} aria-hidden="true">
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
>
<path d="M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7" />
<path d="M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z" />
</svg>
</div>
<div className={styles.improveContent}>
<h3 className={styles.improveTitle}>Improve this Blog Post</h3>
<p className={styles.improveDescription}>
All our blog posts are open source. Found a typo, want to add more
detail, or have a better explanation? Anyone can contribute and
make this post better for everyone.
</p>
<div className={styles.improveActions}>
{metadata.editUrl && (
<Link
className={styles.improveEditButton}
to={metadata.editUrl}
target="_blank"
rel="noopener noreferrer"
>
<svg
xmlns="http://www.w3.org/2000/svg"
width="16"
height="16"
viewBox="0 0 24 24"
fill="currentColor"
aria-hidden="true"
>
<path d="M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0 0 24 12c0-6.63-5.37-12-12-12z" />
</svg>
Edit this Post on GitHub
</Link>
)}
<Link
className={styles.improveGuidelinesButton}
to="https://www.recodehive.com/docs/Getting-Started"
target="_blank"
rel="noopener noreferrer"
>
<svg
xmlns="http://www.w3.org/2000/svg"
width="16"
height="16"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
aria-hidden="true"
>
<path d="M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z" />
<path d="M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z" />
</svg>
Contributing Guidelines
</Link>
</div>
</div>
</section>
)}
</>
);
}
114 changes: 114 additions & 0 deletions src/theme/BlogPostItem/Footer/styles.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -145,3 +145,117 @@
font-size: 1.25rem;
}
}

/* Improve this Blog Post banner */
.improveBanner {
width: 100%;
margin-top: 2rem;
padding: 1.5rem;
border-radius: 16px;
background: #e6f4f1;
background: color-mix(in srgb, var(--ifm-color-success-contrast-background, #e6f4f1) 60%, transparent);
border: 1px solid rgba(26, 122, 92, 0.2);
border: 1px solid color-mix(in srgb, var(--ifm-color-success) 20%, transparent);
display: flex;
align-items: flex-start;
gap: 1.25rem;
box-sizing: border-box;
}

.improveIconWrap {
flex-shrink: 0;
width: 48px;
height: 48px;
border-radius: 10px;
background: rgba(26, 122, 92, 0.15);
background: color-mix(in srgb, var(--ifm-color-success) 15%, transparent);
display: grid;
place-items: center;
color: var(--ifm-color-success-dark, #1e7a5c);
}

.improveContent {
min-width: 0;
flex: 1;
}

.improveTitle {
margin: 0 0 0.4rem;
font-size: 1.15rem;
font-weight: 700;
line-height: 1.3;
color: var(--ifm-font-color-base);
letter-spacing: -0.01em;
}

.improveDescription {
margin: 0 0 1rem;
font-size: 0.95rem;
line-height: 1.6;
color: var(--ifm-color-emphasis-800);
}

.improveActions {
display: flex;
flex-wrap: wrap;
gap: 0.65rem;
}

.improveEditButton {
display: inline-flex;
align-items: center;
gap: 0.45rem;
padding: 0.5rem 1.1rem;
border-radius: 8px;
background: var(--ifm-color-success-dark, #1a7a5c);
color: #fff !important;
font-size: 0.9rem;
font-weight: 600;
text-decoration: none !important;
border: none;
cursor: pointer;
transition: background 0.15s;
}

.improveEditButton:hover {
background: var(--ifm-color-success-darker, #155f47);
text-decoration: none !important;
}

.improveGuidelinesButton {
display: inline-flex;
align-items: center;
gap: 0.45rem;
padding: 0.5rem 1.1rem;
border-radius: 8px;
background: var(--ifm-background-color);
color: var(--ifm-font-color-base) !important;
font-size: 0.9rem;
font-weight: 600;
text-decoration: none !important;
border: 1px solid var(--ifm-color-emphasis-300);
cursor: pointer;
transition: background 0.15s, border-color 0.15s;
}

.improveGuidelinesButton:hover {
background: var(--ifm-color-emphasis-100);
text-decoration: none !important;
}

@media (max-width: 640px) {
.improveBanner {
flex-direction: column;
gap: 1rem;
padding: 1rem;
}

.improveActions {
flex-direction: column;
}

.improveEditButton,
.improveGuidelinesButton {
justify-content: center;
}
}
Loading