# Target lib.rs

**URL:** <https://zola.discourse.group/t/target-lib-rs/2849>\
**Category:** Uncategorized\
**Created:** [August 26, 2025, 12:49pm UTC](https://zola.discourse.group/t/target-lib-rs/2849 "2025-08-26T12:49:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![kbvernon](https://yyz2.discourse-cdn.com/free1/user_avatar/zola.discourse.group/kbvernon/32/1525_2.png) [@kbvernon](https://zola.discourse.group/u/kbvernon)\
**Post date:** [August 26, 2025, 12:50pm UTC](https://zola.discourse.group/t/target-lib-rs/2849/1 "2025-08-26T12:50:00Z")

</div>

I would like to wrap zola with [extendr](https://extendr.rs/) to make it available in R. However, to do this, we would need access to zola as a library. This has been discussed a few times before, like [here](https://zola.discourse.group/t/using-zola-as-a-library/1823). Would this be something the zola team is willing to support? Happy to offer a PR if so.

---

<div class="post-metadata">

**Author:** ![bemyak](https://yyz2.discourse-cdn.com/free1/user_avatar/zola.discourse.group/bemyak/32/1106_2.png) [@bemyak](https://zola.discourse.group/u/bemyak)\
**Post date:** [September 2, 2025, 7:46am UTC](https://zola.discourse.group/t/target-lib-rs/2849/2 "2025-09-02T07:46:48Z")

</div>

Since Zola is pretty modular, you can depend on various subcrates of it like this in your Cargo.toml:

```ini
[dependencies]
zola_site = { git = "https://github.com/getzola/zola", rev = "v0.20.0", package = "site" }
zola_utils = { git = "https://github.com/getzola/zola", rev = "v0.20.0", package = "utils" }

```

You check the full example here: [Cargo.toml · 4608c7e710c0cdbc17f0dd08bde4582bcfea5d35 · bemyak / zola-new · GitLab](https://gitlab.com/bemyak/zola-new/-/blob/4608c7e710c0cdbc17f0dd08bde4582bcfea5d35/Cargo.toml#L8-9)

---

<div class="post-metadata">

**Author:** ![susprisedpoultry](https://yyz2.discourse-cdn.com/free1/user_avatar/zola.discourse.group/susprisedpoultry/32/1611_2.png) [@susprisedpoultry](https://zola.discourse.group/u/susprisedpoultry)\
**Post date:** [April 29, 2026, 2:33pm UTC](https://zola.discourse.group/t/target-lib-rs/2849/3 "2026-04-29T14:33:42Z")

</div>

I am considering using Zola as the generator for a simple CMS UI that I am working on. The idea is to get something similar to [Publii](https://getpublii.com) where everything is included in a single binary.

I would love to use zola as a lib as to offer live preview of changes and automatic building of the site before upload.

Right now, I’ve [forked and made a branch](https://github.com/susprisedpoultry/zola/tree/command) that I use as a submodule and it works really well. I would really love “official” support for this if this fits your plans for Zola.

---

<div class="post-metadata">

**Author:** ![keats](https://avatars.discourse-cdn.com/v4/letter/k/34f0e0/32.png) [@keats](https://zola.discourse.group/u/keats)\
**Post date:** [April 29, 2026, 2:42pm UTC](https://zola.discourse.group/t/target-lib-rs/2849/4 "2026-04-29T14:42:11Z")

</div>

Zola is pretty much a library with a CLI frontend already. As for the fork, you probably want to write your version of that code? I doubt your backend would be ok with `std::process::exit(1);` in it and it’s pretty much standalone

---

<div class="post-metadata">

**Author:** ![susprisedpoultry](https://yyz2.discourse-cdn.com/free1/user_avatar/zola.discourse.group/susprisedpoultry/32/1611_2.png) [@susprisedpoultry](https://zola.discourse.group/u/susprisedpoultry)\
**Post date:** [April 29, 2026, 2:48pm UTC](https://zola.discourse.group/t/target-lib-rs/2849/5 "2026-04-29T14:48:47Z")

</div>

Fair enough, re-implementing the serve myself would get rid of this potential issue with the `exit`.

At least, the little fork did well as a proof of concept.

Thanks for the quick answer.
