Releases: nuxt-community/nuxtent-module
v0.2.73
Fetch and generate away!
New Addition
- Added
nuxtent generate
command for static builds. This builds on top ofnuxt generate
to run theserverMiddleware
during the static build. Nowpayload
backup, which was causing problems, is not required. (Fixes #22)
Note: nuxtent-generate
requires version 1.0.0 of Nuxt, but that version is not yet compatible with markdown components.
Bonus Features
- With
$content.query
you can now query which data you'd like included in the page. For example,query({ exclude: 'body')
. - New request methods:
$content.getOnly
, which fetches specified number of pages, and$content.getBetween
, which fetches pages before and after a certain page.
Additions
- If you have multiple content types,
content-api
now responds with all the registered content endpoints, so that you can see if the content is being compiled and loaded, or not. (Inspired by #36)
API changes:
routes
is nowgenerate
and accepts a string of request methods or an object with areq.method
and optionalreq.query
orreq.args
params. The page path for dynamic routes is now specified under thepage
property. (Thegenerate
property is now optional and only required for static builds.)
So the following:
content: {
routes: [
{
path: 'path/to/_page',
method: 'get'
}
]
}
Changes to this:
content: {
page: 'path/to/_page',
generate: [
'get'
]
}
Up and running, just not fully generating
New features:
path
is now added to page content data. This is different frompermalink
, as it specifies the entire file's url path, including any nested route paths.
API changes:
- No need to mentally serialize the route name yourself anymore.
routes
now accepts the page routepath
rather than thename
. baseURL
is now astring
. You can dynamically set it usingenv
variables.
Fixes:
- Fix for multiple content types that which causing route paths to conflict (Fixes #31).
Notes:
Currently there are two live versions of sites using Nuxtent nuxtent docs and ency docs, which were used for testing.
However, these sites were deployed as apps, because npm run generate
does not run serverMiddleware
and payload
passed to nested routes does not persist if page is refreshed. Thus, we will need to submit issue for Nuxt to run it or build on top of Nuxt's generate command. Resolution will be tracked in issue #22.
The other problem is that the usage of Nuxtent markdown components are only fully compatible with alpha 3
version of Nuxt until issue #34 is fixed.
0.2.35
0.2.33
Get them all - just not everywhere
Fixes
- Fixed
getAll
so that payload is passed to route upon static generation. But discovered bug (or feature?) in Nuxt that causes conflict when a payload is passed to top route and a separate payload is passed to its children (#22). Until this is fixed, all features ofNuxtent
will only be available in running apps. - Made sure API request is made for server builds. Added option to pass
iS_STATIC=true
so that it is not requested in static server build. (Fixes #29)
API changes
routeName
is now used asroutes
, which is an array that accepts object route configurations. Each object requires the route's name asroute.name
and the API request method asroute.method
.permalink
now only specifics the ending url params, as the content path will be prefixed by the page directory it is found under if any. This was necessary in order to haveget
andgetAll
payloads work together.
Caught the bug, under the section
- Fixed loader handling of directory options when root files have nested sections, which made it try to fetch
- Adding to the above fix, improved loader regex matching of section, to only get closest subsection, so that users can nest content as they please.
On road to HMR
Features:
- HMR status: Made page fetch fresh content every time in development mode. Just need to find a way to make async data prefetch content... Currently, HMR only works for markdown components because they use loaders.
Fixes:
- Made
mardown-it
anchor plugin only create anchors for configured heading level. - Made it so anchors are only parsed in
md
files, notymal
files.
0.2.17
Anchor up!
New feature:
- Effortless content navigation: Along with a page's
permalink
, content data now also have theanchor
property, which represents the heading anchors extracted frommd
files. By default, H1 is converted to anchors, but you can configure this via theanchorsLevel
property under the config'scontent
property. (#13)
API changes:
parser
configuration property is renamed toparsers
.
Fixes:
- Added v-pre to markdown component code snippets so that mustache tags are not compiled (Fixes #18)