# gridsome-source-confluence

> Confluence source for Gridsome

Latest version **1.3.0** (published 2024-12-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install gridsome-source-confluence
pnpm add gridsome-source-confluence
yarn add gridsome-source-confluence
bun add gridsome-source-confluence
```

## Health

**Score 25/100 (F)** — status: maintenance-mode.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.3.0 |
| Published | 2024-12-11 |
| First published | 2021-08-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 6 |
| Unpacked size | 41.5 KB |
| Known vulnerabilities | 0 (+23 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Jeffrey van den Hondel |
| Maintainers | jeffreyhondel |
| Keywords | gridsome, gridsome-plugin, gridsome-source, confluence |

## Links

- npm: https://www.npmjs.com/package/gridsome-source-confluence
- Repository: https://github.com/jeffreyvdhondel/gridsome-source-confluence
- Homepage: https://github.com/jeffreyvdhondel/gridsome-source-confluence#readme
- Issues: https://github.com/jeffreyvdhondel/gridsome-source-confluence/issues
- npm.io page: https://npm.io/package/gridsome-source-confluence

## Dependencies (6)

- [axios](https://npm.io/package/axios.md) ^0.21.1
- [nanoid](https://npm.io/package/nanoid.md) ^3.1.25
- [slugify](https://npm.io/package/slugify.md) ^1.6.0
- [axios-retry](https://npm.io/package/axios-retry.md) ^4.4.1
- [confluence-api](https://npm.io/package/confluence-api.md) ^1.4.0
- [node-html-parser](https://npm.io/package/node-html-parser.md) ^4.1.3

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 1.3.0 (latest) — 2024-12-11
- 1.2.0 — 2024-12-11
- 1.1.0 — 2024-07-09
- 1.0.15 — 2021-12-29
- 1.0.14 — 2021-09-08
- 1.0.13 — 2021-09-08
- 1.0.12 — 2021-09-08
- 1.0.11 — 2021-09-07
- 1.0.10 — 2021-09-06
- 1.0.9 — 2021-09-02
- 1.0.8 — 2021-09-02
- 1.0.7 — 2021-09-02
- 1.0.6 — 2021-09-02
- 1.0.5 — 2021-08-27
- 1.0.4 — 2021-08-27
- … 4 more at https://npm.io/package/gridsome-source-confluence/versions

## README

# gridsome-source-confluence

> Confluence source for Gridsome.

- [gridsome-source-confluence](#gridsome-source-confluence)
  - [Install](#install)
  - [Usage](#usage)
  - [Options](#options)
  - [Creating pages](#creating-pages)

## Install
yarn:
```bash
yarn add gridsome-source-confluence
```
npm:
```bash
npm install gridsome-source-confluence
```

## Usage

`gridsome.config.js`
```js
module.exports = {
  plugins: [
    {
      use: 'gridsome-source-confluence',
      options: {
        base_url:  "https://example.atlassian.net",
        space_key: "AS",
        debug: true,
        public_only: true,
        retry_request: true 
        download_images: true
      }
    }
  ],
}
```

## Options

| Option | Explanation | Default | Example | Required |
|-|-|-|-|-|
| `base_url` | The base URL of your Confluence instance | - | https://example.atlassian.net | <input type="checkbox" disabled checked /> |
| `space_key` | Force spaceKey(s) comma separated | - | "AX,BG" | <input type="checkbox" disabled /> |
| `public_only` | Only retrieve public confluence pages | false | false | <input type="checkbox" disabled /> |
| `prefix` | Prefix of all types | Confluence | false | <input type="checkbox" disabled /> |
| `download_images` | Download images and replace img url | false | true | <input type="checkbox" disabled /> |
| `username` | Username for the private confluence page | - | johndoe@atlassian.net | required if public_only is false|
| `password` | Password for the private confluence page | - | supersecretpassword | required if public_only is false|
| `retry_request` | Retry failed request | false | true |<input type="checkbox" disabled /> |
| `debug` | Show debug information | false | true | <input type="checkbox" disabled /> |


## Creating pages

You can automaticly create pages based on the Confluence data.

`gridsome.server.js`
```js
module.exports = function (api) {
  api.createPages(async ({ graphql, createPage }) => {
    const { data } = await graphql(`{
      allConfluenceParent {
        edges {
          node {
            title
            body
            slug
          }
        }
      }
      allConfluenceChild {
        edges {
          node {
            title
            body
            slug
          }
        }
      }
    }`)

    data.allConfluenceParent.edges.forEach(({ node }) => {
      createPage({
        path: `${node.slug}`,
        component: './src/templates/ConfluenceBody.vue',
        context: {
          body: node.body,
          title: node.title
        }
      })
    })

    data.allConfluenceChild.edges.forEach(({ node }) => {
      createPage({
        path: `${node.slug}`,
        component: './src/templates/ConfluenceBody.vue',
        context: {
          body: node.body,
          title: node.title
        }
      })
    })
  })
}
```

`src/templates/ConfluenceBody.vue`
```html
<template>
  <Layout>
    <h1>{{ $context.title }}</h1>
    <div v-html="$context.body"></div>
  </Layout>
</template>
```

---
_Source: https://npm.io/package/gridsome-source-confluence · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
