Activities

Gor98

Gor98 posted a new question

nuxtent-module •

Different redirect routes for different strategies

HI,
have an problem with redirect routes. How can I set different redirect rout for
different auth strategies in my nuxt.config.js
This is my config file.

  auth: {
    redirect: {
      login: '/',
      logout: '/',
      callback: '/',
      home: '/'
    },
    strategies: {
      user: {
        _scheme: 'local',
        endpoints: {
          login: { url: '/user/signin', method: 'post', propertyName: 'access_token' },
          logout: { url: '/user/logout', method: 'get' },
          user: { url: '/user/details', method: 'get', propertyName: 'user' }
        },
        tokenType: 'Bearer',
      },
      provider: {
        _scheme: 'local',
          endpoints: {
            login: { url: '/provider/signin', method: 'post', propertyName: 'access_token' },
            logout: { url: '/provider/logout', method: 'get' },
            user: { url: '/provider/profile', method: 'get', propertyName: 'user' }
          },
          tokenType: 'Bearer',
      },

    },
  },
Vector-SMG

Vector-SMG posted a new question

nuxtent-module •

how to import third-part components
chadananda

chadananda posted a new question

nuxtent-module •

Is there any combination of nuxtent & nuxt that actually work for static build?

I've tried about every combination of versions of Nuxtent and Nuxt and Nuxtdown. They all work perfectly fine in development (with server-generated content) but the moment I try to nuxt generate and deploy, I get a total fail.

Generally the issues are:

  1. No post stubs or JSON content is generated in /dist for the latest builds (including Nuxtdown)

  2. Older versions of nuxt/nuxtent sometimes generate content -- but it does not work properly. Trying to open a generated post results in a 404 because the HTML stub cannot load its Nuxtent-generated JSON data file. It tries to load it the JSON with a wrong pathname, like postname..json. (note the two dots)

sarahdayan

sarahdayan posted a new question

nuxtent-module •

NuxtServerError "Request failed with status code 404" when trying to access a page

Hi!

I'm trying to add Nuxtent to my brand new Nuxt website, but having a hard time making it work. For now, I've created a page and set up the necessary configuration, but I'm consistently getting the following error when trying to access a page:

Capture d’écran 2019-01-20 à 23.00.23.png

Here's what my configuration looks like:

nuxt.config.js

/* ... */
modules: [ 'nuxtent'],
/* ... */

nuxtent.config.js

module.exports = {
  content: [
    [
      'blog',
      {
        page: '/blog/_slug',
        permalink: '/blog/:year/:month/:day/:slug',
        isPost: true,
        generate: ['get', 'getAll']
      }
    ]
  ],
  api: {
    browserBaseURL: 'http://localhost:3000'
  }
}

pages/blog/index.vue

<template>
  <section>
    <div v-for="post in posts" :key="post.permalink">
      <nuxt-link :to="post.permalink">
        <h3>
          {{ post.title }}
        </h3>
      </nuxt-link>
    </div>
  </section>
</template>

<script>
export default {
  async asyncData({ app }) {
    return {
      posts: await app.$content('/blog').getAll()
    }
  }
}
</script>

pages/blog/_slug/index.vue

<template>
  <article>
    <h2>
      {{ post.title }}
    </h2>
    <p>
      {{ post.date }}
    </p>
    <nuxtent-body :body="post.body" />
  </article>
</template>

<script>
export default {
  async asyncData({ app, route }) {
    return {
      post: await app.$content('/blog').get(route.path)
    }
  }
}
</script>

Whenever I try to access content-api/blog, I successfully get a JSON representation of the content of my content/blog folder:

[
  {
    "title":"Adding a Nuxtent-Powered Blog to My Nuxt Site",
    "tags":"JavaScript, VueJS, Nuxt, Nuxtent",
    "abstract":"In this post, I survey markdown blogging options for Vue and React, and briefly describe the process of adding a blog to my Nuxt site using the currently unmaintained Nuxtent module.",
    "meta":{
      "index":0,
      "fileName":"2018-06-04-adding-a-blog-to-nuxt.md",
      "section":"/",
      "dirName":"/blog"
    },
    "date":"2018-06-04",
    "path":"/blog/blog/2018/06/04/adding-a-blog-to-nuxt",
    "permalink":"/blog/2018/06/04/adding-a-blog-to-nuxt",
    "anchors":[

    ],
    "body":"<p>Evan You, the creator of Vue, introduced <a href=\"https://vuepress.vuejs.org/\">VuePress</a> just a couple months ago. I was excited about the announcement because it seemed to be exactly what I was looking for at the time: a minimalist, optimized, content-first static site generator that trivializes the process of fusing together markdown assets with dynamic layouts and components. I read through the docs and tried it out.</p>\n"
  }
]

Yet, when trying to access the permalink of above blog post (/blog/2018/06/04/adding-a-blog-to-nuxt), I get the error I posted at the beginning. The error message isn't helpful, so I have no idea where it comes from and how to fix it.

Additionally, when I try to build by using nuxt generate, either I get a 500 error, or the process timeouts after a while.

I'm using Nuxt v2.3.4 and Nuxtent v1.4.1.

What am I missing?

OfekA

OfekA posted a new bug report

nuxtent-module •

bug Nuxt 2.3.x and above failing to build Nuxtent pages

Version

1.4.1

Reproduction link

https://github.com/OfekA/static-site-nuxt-issue

Steps to reproduce

  • clone the repo from the Reproduction link
  • npm install
  • npm run generate
  • the build should be successful including Nuxtent pages (path: /careers)
    you should see something similar in the log:
    2.2.0_and_below.png

now to fail the build:

  • update the 'Nuxt' dependency in package.json to 2.3.4 or anything 2.3.x and above
  • delete package-lock.json file and the node-modules folder
  • npm install
  • npm run generate
  • the build will successful but Nuxtent pages will not be generated (path: /careers)
    you should see something similar in the log:
    2.3.x and above.png

What is expected?

Nuxtent pages to be generated just like in Nuxt 2.2.0 and below

What is actually happening?

Nuxtent pages are not generated

Additional comments?

I've also posted the issue in the Nuxt Discord channel, @manniL checked the issue there and concluded that it is most likely related to Nuxtent and not Nuxt itself.
Would really appreciate some help here as this is the only thing blocking me from upgrading to Nuxt 2.3.x and above. Thanks in advance!

ptdev

ptdev posted a new question

nuxtent-module •

getAll by section?

Hi, is there anyway to get the content per section?

I'll try to explain my setup and what I'm asking.

Take, for example, the following structure:

content/en/ (configured as content folder on nuxtent)
content/en/something/
content/en/something/articleA
content/en/something/articleB
content/en/anotherthing/
content/en/anotherthing/articleX
content/en/anotherthing/articleY

content/de/ (also configured as content folder on nuxtent)
content/de/something/
content/de/something/articleA
content/de/something/articleB
content/de/anotherthing/
content/de/anotherthing/articleX
content/de/anotherthing/articleY

So, as you can see, nuxtent is configured with 2 content folders, one for /en/ and another for /de/. I'm using nuxt-i18n so the folders are named according to the language code and represent different languages.

So now If I call:

app.$content(app.i18n.locale).getAll()

I get all articles from folders "something" and "anotherthing". for the selected language.

My question is: Is there anyway to only get the contents for one folder? For example, something like the following (which doesn't work)

app.$content(app.i18n.locale).getAll('/something')

To only get the articles from inside the "something" folder/section on the current language?

I know I can workaround this by setting up nuxtent with a configuration for each of those language/subfolders combinations, but with X number of languages and then another Y number of sections/subfolders, the configuration will quickly become huge and I believe there's probably a better way to do this.

Any other suggestions that achieves the same result are also welcome of course.

Thank you.

brandonpittman

brandonpittman posted a new bug report

nuxtent-module •

bug Nuxtent cannot load pages when @nuxtjs/axios is registered as a module

Version

1.4.1

Reproduction link

https://github.com/brandonpittman/nuxtent-module/blob/master/examples/multiple-content-types/nuxt.config.js

Steps to reproduce

Add '@nuxtjs/axios' to nuxt.config.js

What is expected ?

Should display content files

What is actually happening?

Can't find page

cesasol

cesasol posted a new question

nuxtent-module •

Roadmap for v3

This is a list of goals to meet before releasing a stable 3 version:

  • <input type="checkbox" disabled style="margin: 0px 0.35em 0.25em -1.6em; vertical-align: middle;"> Improve the documentation and at least a spanish translation
  • <input type="checkbox" disabled style="margin: 0px 0.35em 0.25em -1.6em; vertical-align: middle;" checked> Windows compatible (Help needed)
  • <input type="checkbox" disabled style="margin: 0px 0.35em 0.25em -1.6em; vertical-align: middle;" checked> Be zeroconf and extendible through it's own api and exposing the markdown parser
  • <input type="checkbox" disabled style="margin: 0px 0.35em 0.25em -1.6em; vertical-align: middle;" checked> Allow default attributes to be set on the frontmatter ej. title
  • <input type="checkbox" disabled style="margin: 0px 0.35em 0.25em -1.6em; vertical-align: middle;" checked> Real async modules (this affects ssr more than a static build)
  • <input type="checkbox" disabled style="margin: 0px 0.35em 0.25em -1.6em; vertical-align: middle;" checked> Fully integrate with the new features nuxt2.0 and node 12
  • <input type="checkbox" disabled style="margin: 0px 0.35em 0.25em -1.6em; vertical-align: middle;" checked> Debugable configuration
  • <input type="checkbox" disabled style="margin: 0px 0.35em 0.25em -1.6em; vertical-align: middle;" checked> Better error reporting
  • <input type="checkbox" disabled style="margin: 0px 0.35em 0.25em -1.6em; vertical-align: middle;" checked> Document the code in order to simplify contributions and future development
  • <input type="checkbox" disabled style="margin: 0px 0.35em 0.25em -1.6em; vertical-align: middle;"> Improve the template with optional addons as examples
  • <input type="checkbox" disabled style="margin: 0px 0.35em 0.25em -1.6em; vertical-align: middle;" checked> Support multiple file types (json, yaml, markdown, html)
  • <input type="checkbox" disabled style="margin: 0px 0.35em 0.25em -1.6em; vertical-align: middle;" checked> Integrate the api configuration with nuxt itself while keeping it configurable
  • <input type="checkbox" disabled style="margin: 0px 0.35em 0.25em -1.6em; vertical-align: middle;" checked> Expose $content helper and it's constant like api endpoint through all of vue
  • <input type="checkbox" disabled style="margin: 0px 0.35em 0.25em -1.6em; vertical-align: middle;" checked> Keep the main features from nuxtdown:
  • <input type="checkbox" disabled style="margin: 0px 0.35em 0.25em -1.6em; vertical-align: middle;" checked> Breadcrubms
  • <input type="checkbox" disabled style="margin: 0px 0.35em 0.25em -1.6em; vertical-align: middle;" checked> Automatic table of content (TOC)
  • <input type="checkbox" disabled style="margin: 0px 0.35em 0.25em -1.6em; vertical-align: middle;" checked> Isolated and global configurations
  • <input type="checkbox" disabled style="margin: 0px 0.35em 0.25em -1.6em; vertical-align: middle;" checked> Allow for nested content and index files
  • <input type="checkbox" disabled style="margin: 0px 0.35em 0.25em -1.6em; vertical-align: middle;" checked> Improve on SSR memory usage

The following are the features that would be nice to have but are left for a future release 3.x

  • <input type="checkbox" disabled style="margin: 0px 0.35em 0.25em -1.6em; vertical-align: middle;"> Vuex integration
  • <input type="checkbox" disabled style="margin: 0px 0.35em 0.25em -1.6em; vertical-align: middle;"> Use sqlite for the content

All of the previous features are open to discussion and may be expanded to fit more use cases.

sebstr1

sebstr1 posted a new question

nuxtent-module •

[Static site] Permalink to content works but impossible to link with nuxt-link?

Hi! I really enjoy exploring both nuxt & nuxtent-module! I ran into an issue that I have a hard time figuring out. I use yarn generate on the production host (I use netlify) to generate the site, everything builds fine and goes live.

The problem: For example, I have a nuxt-link to content (blog post) /blog/first-blog which is the perma-link https://www.mysite.com/blog/first-blog (if you copy the link) for this particular content. If i click on it it results in an error:

```Failed to load https://mysite.com/_nuxt/content/blog/blog.first-blog.json: Redirect from 'https://mysite.com/nuxt/content/blog/blog.first-blog.json' to 'https://www.mysite.com/nuxt/content/blog/blog.first-blog.json' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://www.mysite.com' is therefore not allowed access.

However if I just copy paste the same link to the browsers url field and press enter, it works fine and displays my blogpost.

On my dev server `localhost:3000/content-api` does work but in production, `https://www.mysite.com/content-api` does not exist if I try to visit it, is it supposed to be this way since I use `yarn generate` to build the website?

content folder:

/content
/blog
2019-08-27-first-blog.md
/nyheter
2019-08-28-hello-news.md

nuxtent.config.js:

module.exports = {
content: [
['blog', {
page: '/blog/blogpost', permalink: 'blog/:slug', generate: [ 'get', 'getAll' ] }], ['nyheter', { page: '/nyheter/newspost',
permalink: '/nyheter/:slug',
generate: [
'get',
'getAll'
]
}],
],
api: {
baseURL: 'http://localhost:3000',
browserBaseURL: 'https://mysite.com'
}
}
```
Appreciate any input I can get on this :) I feel like I have read everywhere but did not find anything that could fix this issue.

cesasol

cesasol posted a new bug report

nuxtent-module •

bug ✖ error TypeError: request.charCodeAt is not a function

Version

development

Reproduction link

http://infiniti.dinamo.mx/

Steps to reproduce

Run yarn dev and using markdown components

What is expected ?

Run without problems, even in threaded mode

What is actually happening?

There is a weird message when using nuxt-edge that appears when runing in dev mode complaining about not finding a markdown module. This breaks threaded mode

BereSoto

BereSoto posted a new bug report

nuxtent-module •

bug display informative error message when index is missing

Version

1.4.1

Reproduction link

https://codesandbox.io/s/vue

Steps to reproduce

  • Create a folder without an index.md, index.comp.md inside or a [foldername].comp.md, [foldername.md] at the same level

What is expected ?

Just to work without index or to display an informative error that either of those options are needed (index or same name)

What is actually happening?

throws a "Atributes not found"

renestalder

renestalder posted a new bug report

nuxtent-module •

bug Online documentation unavailable

Version

1.4.1

Reproduction link

https://nuxtent.now.sh/

Steps to reproduce

VIsit https://nuxtent.now.sh/

What is expected ?

Online documentation to be available.

What is actually happening?

Getting 402 payment required

renestalder

renestalder posted a new question

nuxtent-module •

Does nuxtent generate static pages?

Is the nuxtent-module supposed to generate static pages with nuxt generate? Or do I still have to manually configuration this in nuxt?

Based on the documentation, nuxtent-module should generate static pages.

I have a configuration like this:

module.exports = {
  api: {
    baseURL: process.env.NODE_ENV === 'production'
      ? 'http://myproductionsite.com'
      : 'http://localhost:3000'
  },
  content: {
    page: '/_page',
    permalink: ':slug',
    isPost: false
  }
}

A _page.vue file along with an index.vue file in the pages folder and a bunch of markdown files in the content folder directly.

In development mode, everything works fine. But the output of nuxt generate does not create any other HTML files except index.html. The pages are only available in .js file format.

So just before I search for any error I want to make sure, I have the correct expectations of the nuxtent-module.

fredDesign

fredDesign posted a new question

nuxtent-module •

dependency issue

Hi,

I'm getting the following error on run dev

This dependency was not found:

  • /Users/projets/my-site-nuxtent/.nuxt/client.js in multi webpack-hot-middleware/client?name=client&reload=true&timeout=30000&path=/_webpackhmr ./.nuxt/client.js
mgrandl

mgrandl posted a new question

nuxtent-module •

Give the ability to render the slug without dates

My posts look like this

['posts', { page: '/posts/_slug', permalink: '/:year/:month/:day/:slug', isPost: true, generate: ['get', 'getAll'] }]

Now I want my permalinks not to look like this /2018/05/28/2018-05-28-lorem-ipsum but instead like this /2018/05/28/lorem-ipsum how do I make this happen?

cschroeter

cschroeter posted a new bug report

nuxtent-module •

bug Sitemap example project fails

Version

1.4.1

Reproduction link

https://github.com/nuxt-community/nuxtent-module/tree/master/examples/sitemap

Steps to reproduce

Checkout sitemap example project, yarn && yarn generate

What is expected ?

A generated sitemap.xml

What is actually happening?

Error: connect ECONNREFUSED 127.0.0.1:3000

bin4ryio

bin4ryio posted a new question

nuxtent-module •

get() and getAll() will Infinite loop

Hi there, I'm using the versions as shown below. Whenever I access the pages that has get() or getAll(), my nuxt will fall into infinite loading.

package.json

  "dependencies": {
    "nuxtent": "^1.4.1",
    "nuxt": "latest",
    "@nuxtjs/axios": "latest"
  },

components

export default {
  asyncData: async ({ app, route, payload }) => ({
    post: payload || (await app.$content("/").getAll())
  })
};

console

  nuxt:render Rendering url /? +2ms
  nuxt:render Rendering url /? +1ms
  nuxt:render Rendering url /? +3ms
  nuxt:render Rendering url /? +1ms
  nuxt:render Rendering url /? +3ms
  nuxt:render Rendering url /? +1ms
  nuxt:render Rendering url /? +3ms
  nuxt:render Rendering url /? +1ms

P/S: I'm using Mac OS X, but I'm sure there are no .DS_Store hanging around project folder.

mocheaz

mocheaz posted a new question

nuxtent-module •

dn
ekoeryanto

ekoeryanto posted a new feature request

nuxtent-module •

idea Excerpt

What problem does this feature solve?

it solve big data in a blog list

What does the proposed changes look like?

front-matter change to gray-matter that already has excerpt option

ekoeryanto

ekoeryanto posted a new question

nuxtent-module •

Gray Matter

Halo, is there a plan to use gray-matter instead of front-matter as it feature is promising?