Local Filesystem Demo
Updated by local on October 20, 2018
Local Filesystem Demo
This article is served directly from the local filesystem using simple-git to extract commit metadata.
How It Works
The LocalFsDataProvider reads markdown files from a directory and uses git to get:
- Last modified date - from the most recent commit
- Author name - from the commit author
- File history - tracked via git SHA
Use Cases
| Use Case | Benefit |
|---|---|
| Local development | Preview posts before pushing |
| Static site generation | Build at deploy time |
| Self-hosted blogs | No GitHub API dependency |
| Offline editing | Write anywhere |
Quick Start
import { LocalFsDataProvider } from 'madea-blog-core/providers/local-fs';
const provider = new LocalFsDataProvider({
contentDir: './posts',
authorName: 'Your Name',
});
const articles = await provider.getArticleList();
const article = await provider.getArticle('hello-world.md');
Task List
- Create LocalFsDataProvider
- Integrate simple-git for metadata
- Add /local demo route
- Write documentation
Learn More
"The best way to predict the future is to invent it." ā Alan Kay