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 documentation #3

Merged
merged 2 commits into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Contribute to Hive Astro Loader

`@onhive.io/astro-loader` is an open-source project, and we welcome contributions of all kinds.
It is build with TypeScript and bundled with [Bun]((https://bun.sh/).

## Project Structure

- `src/index.ts`: The main entry point for the package.
- `src/adapters/`: Adapters between data from the Hive API and the export types of the package.
- `src/api/`: API callers for the Hive API.
- `src/loaders/`: Hive Loaders implementation. This is what is exposed to the Astro user.
- `src/schema/`: Types and Zod schemas.

## Development

Fork and clone the repository, install dependencies with `bun install` and run dev mode with `bun dev`.
You can write automated tests and run them with `bun test`. Optionally, use `npm link` to locally test your changes.

We've got some tools aiming to improve the development experience:

- [eslint](https://eslint.org/) for linting and code formatting.
- [prettier](https://prettier.io/) for code formatting.
- [husky](https://typicode.github.io/husky/#/) for pre-commit hooks.
- [lint-staged](https://github.com/okonet/lint-staged) for running linters and formatters on staged files.

## Submitting a Pull Request

- When you're ready to submit a pull request, create a new branch with a descriptive name (e.g., `feat/add-new-feature`).
- Make your changes and commit them with clear and descriptive commit messages.
- Write tests to cover your changes if applicable.
- Create a pull request to the `main` branch of the repository.
- Provide a clear and concise description of your changes in the pull request.
- If your changes are related to an open issue, reference it in the pull request.
- Wait for the project maintainers to review and merge your pull request.
44 changes: 43 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,45 @@
# hive-astro-loader
[![NPM Version](https://img.shields.io/npm/v/%40onhive.io%2Fastro-loader)](https://npmjs.com/package/@onhive.io/astro-loader)
[![codecov](https://codecov.io/gh/instytutfi/hive-astro-loader/graph/badge.svg?token=4dM1Jykhr4)](https://codecov.io/gh/instytutfi/hive-astro-loader)
[![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)
[![Follow on Hive](https://img.shields.io/badge/follow-%40hive.coding-%23E31337?style=flat&logo=hive_blockchain&labelColor=%23111111)](https://ecency.com/@hive.coding)
![GitHub License](https://img.shields.io/github/license/instytutfi/hive-astro-loader)

# Hive Astro Loader

Astro Content Layer loader for the Hive blockchain

## Installation

```bash
npm install @onhive.io/astro-loader
```

Or use our favorite package manager.

## Usage

### Hive Blog Loader

In your Astro project, edit the `/src/content/config.ts`:

```ts
import { defineCollection } from "astro:content";
import { hiveBlogLoader } from "@onhive.io/astro-loader";

export const collections = {
blog: defineCollection({
type: "content_layer",
loader: hiveBlogLoader("hive.coding") // Selected username
})
};
```

For now only `hiveBlogLoader` is available, more coming soon!

## Contributing

See [CONTRIBUTING.md](CONTRIBUTING.md) for more information.

## License

This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for more information.
Loading