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 basic blog example in the readme #76

Merged
merged 10 commits into from
Nov 30, 2023
Merged

Add basic blog example in the readme #76

merged 10 commits into from
Nov 30, 2023

Conversation

mohamedsalem401
Copy link
Contributor

No description provided.

Copy link

changeset-bot bot commented Nov 28, 2023

⚠️ No Changeset found

Latest commit: 4214a4f

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Member

@rufuspollock rufuspollock left a comment

Choose a reason for hiding this comment

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

Great start. I'd suggest being close to our outline and starting with the getStaticProps

I'd start with actually having a blank index page with an getStaticprops that returns an empty list for now ...

@@ -0,0 +1,132 @@
# MarkdownDB Next.js Blog Tutorial

This tutorial guides you through creating a simple Next.js-based blog using MarkdownDB. MarkdownDB empowers you to treat markdown files as a database, simplifying content management and querying.
Copy link
Member

Choose a reason for hiding this comment

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

I'd add a bit more about the cool things it will allow us to do ...


## Step 3: Index Markdown Files into SQLite Database

After preparing markdown files, store their metadata in a database using the MarkdownDB CLI. Execute the following command:
Copy link
Member

Choose a reason for hiding this comment

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

I think we maybe want to go the simple json files route?

Copy link
Member

Choose a reason for hiding this comment

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

Why don't we follow the structure we set out in the issue ...

Inside the content folder, create three sample blog posts using markdown, such as:

```bash
- post-1.md
Copy link
Member

Choose a reason for hiding this comment

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

I'd just have 2 posts ...

And i'd add some content here ... (we are going to at least need the front matter ...)

└── post-3.md
```

## Step 4: Explore the SQLite Database
Copy link
Member

Choose a reason for hiding this comment

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

This is irrelevant IMO ... ...

const BlogList = () => {
const [posts, setPosts] = useState([]);

useEffect(() => {
Copy link
Member

Choose a reason for hiding this comment

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

Surely we are doing getStaticProps ...

@rufuspollock
Copy link
Member

Comments yesterday were:

  • KISS: do minimum needed (and no more and no less)
    • Look at nextjs example: they just blog index page initially
    • => remove blog rendering and remark-react (why use reactremark when you already remark installed! 😉)
  • Flag: not much more than you could do by hand ... but end on a positive note e.g. this is a simple well-tested lightweight library which also has many more features e.g. ... (list them) [and then we can them later]

Copy link
Member

@rufuspollock rufuspollock left a comment

Choose a reason for hiding this comment

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

Some minor last fixes before we merge.

Copy link
Member

Choose a reason for hiding this comment

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

i wouldn't commit all of the boilerplate we have for a nextjs app - we can keep it simpler.

Copy link
Member

Choose a reason for hiding this comment

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

Again this is nextjs boilerplate you can ignore. Just delete it ...


Edit `pages/index.js`. Use the following code snippet:

**Component 1: BlogList**
Copy link
Member

Choose a reason for hiding this comment

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

Use a heading rather than bold.

export default function Home({ posts }) {
return (
<>
<main className={styles.main}>
Copy link
Member

Choose a reason for hiding this comment

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

i thought we were going to remove the styles stuff ...

Copy link
Member

Choose a reason for hiding this comment

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

i think we can delete this stuff in styles

Copy link
Member

Choose a reason for hiding this comment

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

ditto let's delete this ...

Copy link
Member

Choose a reason for hiding this comment

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

i think we can delete these images in the public directory. remember cleaner is simpler.

@@ -0,0 +1,29 @@
---
title: Embracing-Minimalism-in-Everyday-Life
Copy link
Member

Choose a reason for hiding this comment

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

Odd to have - in the title ...

@rufuspollock rufuspollock merged commit 180cff8 into main Nov 30, 2023
2 of 3 checks passed
@mohamedsalem401 mohamedsalem401 deleted the nextjs-blog branch February 8, 2024 02: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.

2 participants