-
Notifications
You must be signed in to change notification settings - Fork 16
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
Conversation
|
There was a problem hiding this 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. |
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 ...
examples/nextjs-blog/README.md
Outdated
Inside the content folder, create three sample blog posts using markdown, such as: | ||
|
||
```bash | ||
- post-1.md |
There was a problem hiding this comment.
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 ...)
examples/nextjs-blog/README.md
Outdated
└── post-3.md | ||
``` | ||
|
||
## Step 4: Explore the SQLite Database |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is irrelevant IMO ... ...
examples/nextjs-blog/README.md
Outdated
const BlogList = () => { | ||
const [posts, setPosts] = useState([]); | ||
|
||
useEffect(() => { |
There was a problem hiding this comment.
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 ...
Comments yesterday were:
|
There was a problem hiding this 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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 ...
examples/nextjs-blog/README.md
Outdated
|
||
Edit `pages/index.js`. Use the following code snippet: | ||
|
||
**Component 1: BlogList** |
There was a problem hiding this comment.
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}> |
There was a problem hiding this comment.
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 ...
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 ...
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 ...
No description provided.