Skip to content

Commit a7f157a

Browse files
committed
Improve README for v2.
1 parent ee275cc commit a7f157a

File tree

2 files changed

+39
-34
lines changed

2 files changed

+39
-34
lines changed

CHANGELOG.md

Lines changed: 0 additions & 17 deletions
This file was deleted.

README.md

Lines changed: 39 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,18 @@
66
[![codecov][codecov-src]][codecov-href]
77
[![License][license-src]][license-href]
88

9-
> Connects Nuxt.js with Drupal via the [Lupus Custom Elements Renderer](https://www.drupal.org/project/lupus_ce_renderer)
9+
> Connects Nuxt v3 with Drupal via the [Lupus Custom Elements Renderer](https://www.drupal.org/project/lupus_ce_renderer)
1010
11-
Please refer to https://stack.lupus.digital for more info.
11+
Please refer to https://www.drupal.org/project/lupus_decoupled for more info.
12+
13+
The 2.x version of the module is compatible with Nuxt 3. For a Nuxt 2 compatible version, please checkout the [1.x version](https://github.com/drunomics/nuxtjs-drupal-ce/tree/1.x)
1214

13-
[📖 **Release Notes**](./CHANGELOG.md)
1415

1516
## Pre-requisites
1617

1718
* A [Drupal](https://drupal.org) backend with the
1819
[Lupus Custom Elements Renderer](https://www.drupal.org/project/lupus_ce_renderer)
19-
module installed.
20+
module or [Lupus Decoupled Drupal](https://www.drupal.org/project/lupus_decoupled) installed.
2021

2122
## Setup
2223

@@ -40,11 +41,30 @@ export default defineNuxtConfig({
4041
})
4142
```
4243

44+
The module defaults work well with [Lupus Decoupled Drupal](https://www.drupal.org/project/lupus_decoupled), so setting the `baseURL` is usually enough.
45+
46+
47+
## Features
48+
49+
* Fetches pages via the custom elements API provided by the [Lupus Custom Elements Renderer](https://www.drupal.org/project/lupus_ce_renderer)
50+
* Provides a Nuxt-wildcard route, so all Drupal pages can be rendered via Nuxt.js and vue-router.
51+
* Integrates page metadata and the page title with Nuxt.
52+
* Supports breadcrumbs and local tasks ("Tabs")
53+
* Supports authenticated requests. Cookies are passed through to Drupal by default.
54+
* Supports display of Drupal messages in the frontend.
55+
* Provides unstyled skeleton components for getting started quickly.
56+
* Supports fetching and display of Drupal menus via the [Rest menu items](https://www.drupal.org/project/rest_menu_items) module.
57+
4358
## Options
4459

4560
- `baseURL`: The Drupal base URL. Defaults to the `DRUPAL_BASE_URL`
4661
environment variable if provided, otherwise to `http://localhost:8888`.
4762

63+
- `fetchOptions`: The default [fetchOptions](https://nuxt.com/docs/api/composables/use-fetch#params)
64+
to apply when fetching from the Drupal. Defaults to `{ credentials: 'include' }`.
65+
66+
- `fetchProxyHeaders`: The HTTP request headers to pass through to Drupal, via [useRequestHeaders](https://nuxt.com/docs/api/composables/use-request-headers#userequestheaders). Defaults to `['cookie']`.
67+
4868
- `menuEndpoint`: The menu endpoint pattern used for fetching menus. Defaults to 'api/menu_items/$$$NAME$$$' as fitting
4969
to the API provided by the [Rest menu items](https://www.drupal.org/project/rest_menu_items) Drupal module.
5070
`$$$NAME$$$` is replaced by the menu name being fetched.
@@ -57,34 +77,36 @@ export default defineNuxtConfig({
5777
pages are shown instead, such that the pages can be customized with Nuxt. Defaults to `false`.
5878

5979

60-
## TODO list of options (not yet implemented)
80+
## TODO - List of 1.x options not yet implemented
6181

6282
- `addRequestFormat`: If set to `true`, the `_format=custom_elements` URL parameter
6383
is added automatically to requests. Defaults to `true`.
6484

6585
- `useLocalizedMenuEndpoint`: If enabled, the menu endpoint will use a language prefix as configured by [nuxtjs/i18n](https://i18n.nuxtjs.org) module. Defaults to `true`.
6686

67-
- `useProxy`: If set to `dev-only` and nuxt is in dev-mode, the module automatically
68-
configures `/api` to the Drupal backend via
69-
[@nuxtjs/proxy](https://github.com/nuxt-community/proxy-module) and uses it instead of
70-
the Drupal backend, such that there are no CORS issues. Other values supported are
71-
`always` or false.
72-
Note: When using `always` the module must be added to the nuxt `modules` section instead
73-
of the `buildModules` section.
74-
7587
- `pageErrorHandler`: The default page error handler can be overridden.
7688

7789
- `menuErrorHandler`: The default menu error handler can be overridden.
7890

7991

80-
## Options not supported in 2.x version
92+
## Previous options not supported in 2.x version
8193

82-
- `addVueCompiler`: This is necessary if you want to render custom elements markup on runtime.
83-
If you need this, you may find a solution in this [GitHub issue](https://github.com/nuxt/nuxt/issues/13843).
94+
The following options were support in 1.x but got dropped:
95+
96+
- `addVueCompiler`: This is necessary if you want to render custom elements markup on runtime;
97+
i.e. use the 'markup' content format. If you need this, you may find a solution in this
98+
[GitHub issue](https://github.com/nuxt/nuxt/issues/13843).
8499

85100
- `axios`: Options to pass-through to the `drupal-ce`
86-
[axios](https://github.com/nuxt-community/axios-module) instance.
101+
[axios](https://github.com/nuxt-community/axios-module) instance. Use `fetchOptions` instead.
87102

103+
- `useProxy`: If set to `dev-only` and nuxt is in dev-mode, the module automatically
104+
configures `/api` to the Drupal backend via
105+
[@nuxtjs/proxy](https://github.com/nuxt-community/proxy-module) and uses it instead of
106+
the Drupal backend, such that there are no CORS issues. Other values supported are
107+
`always` or false.
108+
Note: When using `always` the module must be added to the nuxt `modules` section instead
109+
of the `buildModules` section.
88110

89111
## Development
90112

0 commit comments

Comments
 (0)