Publish your digital garden with Flowershow 🌷
Published: 2022-11-07 00:51:12

## What is Flowershow?

Flowershow 🌷 is a **free** and **open-source** tool for easily converting your markdown files into an elegant website. It's built on a standard, modern web stack – **React, Next.js, and Tailwind** and shipped with a basic default theme to get you started with just a few clicks🖱️.

https://flowershow.app/

Following the steps below, or using our [tutorial](https://flowershow.app/docs/publish-tutorial), you can turn your markdown notes into an elegant website and tailor it to your needs.

## 1. Prepare the content

> 🚧 Flowershow CLI is not yet supported on Windows
> ❕ Make sure you have [Node.js](https://nodejs.org/en/) installed

First, you'll need a folder with some markdown files you'd like to publish. You can use an existing one, e.g. your Obsidian vault. This folder should include at least a single `index.md` file at the root level, which will be used to generate the home page of your website. If it doesn't exist, Flowershow CLI will create it for you.

To create this folder from scratch, you can do:

```bash
mkdir my-digital-garden
cd my-digital-garden
echo 'Hello, world!' > index.md
```

You can create as many subfolders within your content folder as you want. Its directory tree will be reflected in URL paths on the published website, e.g.: `my-digital-garden/blog/hello.md` file content will be available under `<base-url-of-your-published-website>/blog/hello`.

Each folder can have its own `index.md` file, which will be available under its parent directory path, e.g. `my-content/blog/index.md` will be available under `<base-url-of-your-published-website>/blog`.

In order to embed files (e.g. images or pdfs) in your markdown files, you will also need to create a dedicated folder for them in your digital garden directory.

> If you're an Obsidian user, you can set this folder as an attachments folder, by right-clicking on it in the sidebar on the left hand side. This way all embedded files will be saved to this folder automatically when you copy them to your notes.

You can create this folder by running:

```bash
mkdir my-digital-garden/assets #this can be any other name
```

> If you don't use git version control system to track changes in your digital garden yet, we recommend setting it up. Check [GitHub quickstart](https://docs.github.com/en/get-started/quickstart) to learn more.

## 2. Install Flowershow template

In order to build your beautiful personal website out of your digital garden, you first need to install Flowershow template. This template will be linked to your digital garden after the installation process.

So, let's imagine you have the following folder structure:

```sh
some-parent-dir
├── my-digital-garden
│   ├── assets
│   └── index.md
└── ...
```

If you want to install Flowershow in `some-parents-dir` you can either:

1. go to that directory and run `npx flowershow@latest install`

```sh
cd some-parent-dir
npx flowershow@latest install
```

You'll be asked to confirm if you want to install it in the current directory.

```
? Create Flowershow project in current directory? Yes
```

2. ...or you can pass this directory as an argument to the install command.

```sh
npx flowershow@latest install some-parent-dir
```

After running the install command you'll be shown a set of prompts, that will allow you to properly set up Flowershow with your digital garden.

```
? Path to the folder with your content files
my-digital-garden

? Select a folder with your assets (attachments) (Use arrow keys)
❯ assets
  ──────────────
  I don't need assets folder
  Cancel

🌷 Installing Flowershow template in /home/me/some-parent-dir/.flowershow
⏳ Installing Flowershow dependencies...
```

At the end you should see `.flowershow` folder created in the target directory. In our example the folder structure will look like this:

```sh
some-parent-dir
├── my-digital-garden
│   ├── assets
│   ├── config.js
│   └── index.md
├── .flowershow
└── ...
```

Note that `config.js` and `index.md` files will be created automatically if they didn't exist in your digital garden folder yet. The config file will allow you to do some basic configurations of your Flowershow app.

## (Optional) customize your website

You can now customize your website by wrapping your content in custom layouts, using custom components in you Markdown files, importing data from files and more.

## Build your website

You can preview your website locally by running the following command in the directory where `.flowershow` has been installed:

```bash
npx flowershow preview
```

...or by passing this directory as a command argument:

```bash
npx flowershow preview some-parent-dir
```

After running this command, you will now be able to see your website on http://localhost:3000/ - it will reload every time you make some changes to your content.

If you're ready to publish your site, you can now build it with the following command:

```bash
npx flowershow build-static
# or npx flowershow build-static some-parent-dir
```

It will create a `.flowershow/out` folder with all the resulting static files.

## Feedback🙏

Please take it for a spin and let us know your feedback in the [github discussion](https://github.com/flowershow/flowershow/discussions) thread or our new [discord chat](https://discord.gg/vQ5Y2uUzt6) forum.