Skip to content

blog: add header#44

Merged
gapry merged 1 commit intomainfrom
header
Mar 5, 2026
Merged

blog: add header#44
gapry merged 1 commit intomainfrom
header

Conversation

@gapry
Copy link
Owner

@gapry gapry commented Mar 5, 2026

No description provided.

Copy link

@amazon-q-developer amazon-q-developer bot left a comment

Choose a reason for hiding this comment

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

The PR successfully adds a header component with navigation to an About page. The implementation is functional with proper routing, styling, and configuration updates. No blocking defects identified - the code changes work correctly and can be merged.


You can now have the agent implement changes and create commits directly on your pull request's source branch. Simply comment with /q followed by your request in natural language to ask the agent to make changes.

@gemini-code-assist
Copy link

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the blog by adding a new 'About Me' page, improving site navigation with a dedicated header component, and updating the site's branding. These changes aim to provide more personal content and a more polished user experience.

Highlights

  • New 'About Me' Page: A new '/about' page has been introduced, displaying content from a dedicated Markdown file. This page is now accessible via the site's navigation.
  • Header Component Integration: A new Header React component has been created and integrated into the main application layout, providing consistent site navigation including a link to the new 'About Me' page.
  • Site Branding Update: The site's name has been updated in the configuration from 'Gapry's Technical Writing' to 'Gapry's Blog', reflecting a broader scope.
  • Styling Adjustments: New CSS has been added for the Header component, and the font size of the home page title has been slightly reduced for aesthetic purposes.
Changelog
  • post.config.js
    • Formatted the fs.mkdirSync call for better readability.
    • Added a new fs.copyFileSync operation to generate about.html from index.html during the build process.
  • public/about.md
    • Added initial Markdown content for the new 'About Me' page.
  • src/App.jsx
    • Imported the new Header component.
    • Implemented routing logic to fetch and display content from about.md when the '/about' path is accessed.
    • Integrated the Header component into the main application's render structure.
  • src/components/Header/Header.css
    • Added comprehensive CSS styles for the new Header component, including layout, logo styling, and navigation menu appearance.
  • src/components/Header/Header.jsx
    • Created a new React functional component for the site's header, which includes the site name and a navigation link to the 'About Me' page.
  • src/data/config.json
    • Updated the siteName property from 'Gapry's Technical Writing' to 'Gapry's Blog'.
  • src/pages/Home/Home.css
    • Adjusted the font-size property for the .home-title class from 2rem to 1.5rem.
Activity
  • No human activity has been recorded on this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request adds a header component and an 'About Me' page. The implementation introduces some good features, but there are a few areas for improvement. I've identified a high-severity issue with client-side navigation that causes full page reloads, which should be addressed. I've also left comments regarding code duplication, accessibility, and maintainability for hardcoded values and routing logic. Please review the suggestions to improve the code quality.

Comment on lines +8 to +18
<div className="header-left">
<a href="/" className="logo">
{siteConfig.siteName}
</a>
</div>

<nav className="header-right">
<ul className="nav-menu">
<li><a href="/about">About Me</a></li>
</ul>
</nav>

Choose a reason for hiding this comment

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

high

The links in the header (logo and nav-menu) use standard <a> tags, which will cause a full page reload on navigation. This is inefficient for a Single Page Application (SPA) and provides a poor user experience. You should implement client-side routing. Since you are not using a routing library, you can achieve this by:

  1. Adding onClick handlers to your links.
  2. In the handlers, call event.preventDefault() to stop the reload.
  3. Use window.history.pushState() to update the URL.
  4. Modify the App component to listen for popstate events and re-render the content accordingly.

Comment on lines +74 to +77
fs.copyFileSync(
path.join(distDir, 'index.html'),
path.join(distDir, 'about.html')
);

Choose a reason for hiding this comment

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

medium

This adds another fs.copyFileSync call to copy index.html. There is now duplicated logic for copying index.html to 404.html and about.html. Consider refactoring this to use a loop to improve maintainability and avoid repetition, for example:

['404.html', 'about.html'].forEach(file => {
  fs.copyFileSync(
    path.join(distDir, 'index.html'),
    path.join(distDir, file)
  );
});

@@ -0,0 +1,3 @@
Hi, I'm Gapry. Nice to meet you! I love drinking coffee.

![](/assets/pic.png) No newline at end of file

Choose a reason for hiding this comment

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

medium

The image is missing alternative text (alt text). Alt text is crucial for accessibility, as it provides a description of the image for screen readers and is displayed if the image fails to load. Please add a descriptive alt text.

Suggested change
![](/assets/pic.png)
![A picture of Gapry](/assets/pic.png)

Comment on lines +36 to +45
if (parts.length === 1 && parts[0] === 'about') {
fetch('/about.md')
.then(res => res.text())
.then(text => {
setContent(text);
setStatus('post');
})
.catch(() => setStatus('404'));
return;
}

Choose a reason for hiding this comment

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

medium

The routing logic for the /about page is hardcoded. If you plan to add more static pages in the future, this approach will lead to a chain of if/else if statements, which is not easily maintainable. Consider abstracting this into a more scalable solution, for example by using a configuration object for static pages.

        const staticPages = {
          'about': '/about.md'
        };

        if (parts.length === 1 && staticPages[parts[0]]) {
          fetch(staticPages[parts[0]])
            .then(res => res.text())
            .then(text => {
              setContent(text);
              setStatus('post');
            })
            .catch(() => setStatus('404'));
          return;
        }

display: flex;
justify-content: space-between;
align-items: flex-end;
max-width: 800px;

Choose a reason for hiding this comment

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

medium

The max-width value of 800px is hardcoded here. This same value is used in other files like src/styles/App.css and src/pages/Home/Home.css. To improve maintainability and ensure consistency, it's best to define this as a CSS custom property (variable) in a global scope (e.g., in :root in src/styles/App.css) and reuse it across all relevant components.

@gapry gapry merged commit f0b956c into main Mar 5, 2026
2 checks passed
@gapry gapry deleted the header branch March 5, 2026 10:27
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.

1 participant