Skip to content

Commit 4e89d9c

Browse files
authored
Add documentation (#3)
1 parent 9f6319a commit 4e89d9c

File tree

2 files changed

+77
-1
lines changed

2 files changed

+77
-1
lines changed

CONTRIBUTING.md

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Contribute to Hive Astro Loader
2+
3+
`@onhive.io/astro-loader` is an open-source project, and we welcome contributions of all kinds.
4+
It is build with TypeScript and bundled with [Bun]((https://bun.sh/).
5+
6+
## Project Structure
7+
8+
- `src/index.ts`: The main entry point for the package.
9+
- `src/adapters/`: Adapters between data from the Hive API and the export types of the package.
10+
- `src/api/`: API callers for the Hive API.
11+
- `src/loaders/`: Hive Loaders implementation. This is what is exposed to the Astro user.
12+
- `src/schema/`: Types and Zod schemas.
13+
14+
## Development
15+
16+
Fork and clone the repository, install dependencies with `bun install` and run dev mode with `bun dev`.
17+
You can write automated tests and run them with `bun test`. Optionally, use `npm link` to locally test your changes.
18+
19+
We've got some tools aiming to improve the development experience:
20+
21+
- [eslint](https://eslint.org/) for linting and code formatting.
22+
- [prettier](https://prettier.io/) for code formatting.
23+
- [husky](https://typicode.github.io/husky/#/) for pre-commit hooks.
24+
- [lint-staged](https://github.com/okonet/lint-staged) for running linters and formatters on staged files.
25+
26+
## Submitting a Pull Request
27+
28+
- When you're ready to submit a pull request, create a new branch with a descriptive name (e.g., `feat/add-new-feature`).
29+
- Make your changes and commit them with clear and descriptive commit messages.
30+
- Write tests to cover your changes if applicable.
31+
- Create a pull request to the `main` branch of the repository.
32+
- Provide a clear and concise description of your changes in the pull request.
33+
- If your changes are related to an open issue, reference it in the pull request.
34+
- Wait for the project maintainers to review and merge your pull request.

README.md

+43-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,45 @@
1-
# hive-astro-loader
1+
[![NPM Version](https://img.shields.io/npm/v/%40onhive.io%2Fastro-loader)](https://npmjs.com/package/@onhive.io/astro-loader)
2+
[![codecov](https://codecov.io/gh/instytutfi/hive-astro-loader/graph/badge.svg?token=4dM1Jykhr4)](https://codecov.io/gh/instytutfi/hive-astro-loader)
3+
[![GitHub Issues or Pull Requests](https://img.shields.io/github/issues-raw/instytutfi/hive-astro-loader)](https://github.com/instytutfi/hive-astro-loader/issues?q=sort%3Aupdated-desc+is%3Aissue+is%3Aopen)
4+
[![Follow on Hive](https://img.shields.io/badge/follow-%40hive.coding-%23E31337?style=flat&logo=hive_blockchain&labelColor=%23111111)](https://ecency.com/@hive.coding)
5+
![GitHub License](https://img.shields.io/github/license/instytutfi/hive-astro-loader)
6+
7+
# Hive Astro Loader
28

39
Astro Content Layer loader for the Hive blockchain
10+
11+
## Installation
12+
13+
```bash
14+
npm install @onhive.io/astro-loader
15+
```
16+
17+
Or use our favorite package manager.
18+
19+
## Usage
20+
21+
### Hive Blog Loader
22+
23+
In your Astro project, edit the `/src/content/config.ts`:
24+
25+
```ts
26+
import { defineCollection } from "astro:content";
27+
import { hiveBlogLoader } from "@onhive.io/astro-loader";
28+
29+
export const collections = {
30+
blog: defineCollection({
31+
type: "content_layer",
32+
loader: hiveBlogLoader("hive.coding") // Selected username
33+
})
34+
};
35+
```
36+
37+
For now only `hiveBlogLoader` is available, more coming soon!
38+
39+
## Contributing
40+
41+
See [CONTRIBUTING.md](CONTRIBUTING.md) for more information.
42+
43+
## License
44+
45+
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for more information.

0 commit comments

Comments
 (0)