Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Recent Blogs to Home Page #35

Conversation

anchalshivank
Copy link
Contributor

  • Updated blog plugin configuration.
  • Disabled the default blog plugin.
  • Implemented rendering of recent blogs on the home page (index.jsx).
  • Recent blog data sourced from recent-posts.json in the .docusaurus directory.

@anchalshivank anchalshivank force-pushed the feature/add-recent-blog-posts branch 2 times, most recently from f35ce06 to a28f3bb Compare August 4, 2024 09:55
Comment on lines 33 to 34
const fd = fs.openSync(`${dir}/recent-posts.json`, 'w');
fs.writeSync(fd, JSON.stringify(recentPosts));
Copy link
Member

Choose a reason for hiding this comment

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

I don't like this writing directly to the file system. Did you have a look at this example?

I also asked if there's a better way to do that in the most recent version of Docusaurus.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Understood, will look into this.

@sergefdrv sergefdrv linked an issue Aug 4, 2024 that may be closed by this pull request
- Deleted the default `src/pages/index.jsx` file.
- Added custom homepage component in `src/components/Home/index.js`.
- Updated routing to render the new custom homepage component.
- Added a custom blog plugin required for rendering the homepage component.

Signed-off-by: Shivank Anchal <[email protected]>
@anchalshivank anchalshivank force-pushed the feature/add-recent-blog-posts branch from a28f3bb to bc462be Compare August 5, 2024 14:42
Comment on lines -61 to -67
blogTitle: 'Replica_IO Blog',
blogDescription: 'Blog of the Replica_IO project - an open-source framework for building practical distributed replication mechanisms.',
showReadingTime: true,
showLastUpdateTime: true,
showLastUpdateAuthor: true,
// Remove this to remove the "edit this page" links.
editUrl: `${siteGitHubUrl}/edit/main/`,
Copy link
Member

Choose a reason for hiding this comment

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

Please preserve these properties.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok

@@ -175,4 +177,4 @@ const config = {
}),
};

export default config;
export default config;
Copy link
Member

Choose a reason for hiding this comment

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

Your formatter seems to be very aggressive: why you remove newlines at the end of files?

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.

2 participants