Activities

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;"> Windows compatible (Help needed)
  • <input type="checkbox" disabled style="margin: 0px 0.35em 0.25em -1.6em; vertical-align: middle;"> 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;"> 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;"> 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;"> Fully integrate with the new features nuxt2.0 and node 11
  • <input type="checkbox" disabled style="margin: 0px 0.35em 0.25em -1.6em; vertical-align: middle;"> Debugable configuration
  • <input type="checkbox" disabled style="margin: 0px 0.35em 0.25em -1.6em; vertical-align: middle;"> Better error reporting
  • <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;"> 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;"> Support multiple file types (json, yaml, markdown, html and pug)
  • <input type="checkbox" disabled style="margin: 0px 0.35em 0.25em -1.6em; vertical-align: middle;"> 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;"> 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;"> 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

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;"> Improve on SSR memory usage
  • <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?

dimitrieh

dimitrieh posted a new question

nuxtent-module •

How to expose data only through the url, not wanting to generate individual pages?

I would like to use yaml functionality to just expose data through the API. However, I don't want to generate individual pages for each of those yaml files inside of a folder.

What is the best way to go about this?

peXed

peXed posted a new question

nuxtent-module •

Joining URLs with path.join

Hello!

I currently try to implement nuxtent into my nuxt project on a windows machine.
I followed the docs carefully but couldn't get it to run.

It seems in the current code, join from nodes path api is used. This should not be used for joining URLs (on windows, you will get URLs with double backslashes).
We could implement this https://github.com/jfromaniello/url-join to join the urls or try to use nodes url.resolve.

I can try to fix this tomorrow and send in a pull request, if you guys want me to.

dhavalwd

dhavalwd posted a new question

nuxtent-module •

"Request failed with status code 404" on nuxt generate

First of all, thanks for making such an amazing module. I am trying to use nuxtent-template as mentioned in the demo and getting below error when trying to access post page.
Request failed with status code 404. I have tried as explained in issue https://github.com/nuxt-community/nuxtent-module/issues/53 but didn't help.

Below are my files.

package.json

{
  "name": "my-site",
  "version": "1.0.0",
  "description": "Nuxt.js Content Site",
  "author": "",
  "private": true,
  "dependencies": {
    "nuxtent": "latest",
    "nuxt": "^1.0.0-rc11",
    "@nuxtjs/axios": "latest"
  },
  "scripts": {
    "dev": "nuxt",
    "build": "NODE_ENV='production' nuxt build",
    "start": "NODE_ENV='production' nuxt start",
    "generate": "NODE_ENV='production' IS_STATIC=true nuxt generate",
    "lint": "eslint --fix --ext .js,.vue --ignore-path .gitignore .",
    "deploy": "push-dir --dir=dist --branch=gh-pages --cleanup",
    "precommit": "npm run lint"
  },
  "devDependencies": {
    "babel-eslint": "^7.1.1",
    "eslint": "^3.15.0",
    "eslint-config-standard": "^6.2.1",
    "eslint-loader": "^1.6.1",
    "eslint-plugin-html": "^2.0.0",
    "eslint-plugin-promise": "^3.4.1",
    "eslint-plugin-standard": "^2.0.1"
  }
}

nuxtent.config.js

module.exports = {
  content: {
    permalink: ':slug',
    page: '/_content',
    isPost: false
  },

  api: {
    baseURL: process.env.NODE_ENV === 'production'
      ? 'https://admiring-kowalevski-d1e6e6.netlify.com'
      : 'http://localhost:3000'
  }
}

Screenshot of the page. Let me know if you need any other information.
Screen Shot 2018-04-08 at 11.32.03 PM.png

Gingernaut

Gingernaut posted a new bug report

nuxtent-module •

bug Unable to extend markdown parser

Version

1.4.1

Reproduction link

https://github.com/Gingernaut/gingernaut.github.io/tree/dev

Steps to reproduce

Extending the markdown parser in my nuxtent.config.js does not work, using the Prism.js configuration at https://nuxtent.now.sh/guide/configuration#parser-options.

My entire nuxtent config:

const Prism = require('prismjs')

module.exports = {
  content: [
    ['blog', {
      page: '/blog/my-article',
      permalink: '/blog/:slug',
      isPost: true,
      generate: [
        'get',
        'getAll'
      ]
    }]],
  api: {
    baseURL: 'http://localhost:3000',
    browserBaseURL: 'http://localhost:3000'
  },
  md: {
    extend (config) {
      config.highlight = (code, lang) => {
        return `<pre class="language-${lang}"><code class="language-${lang}">${Prism.highlight(code, Prism.languages[lang], Prism.languages[lang])}</code></pre>`
      }
    }
  }
}

I've added the nuxtent module in my nuxt.config.js, and that is where I also load the prism CSS with:

  css: [
    'prismjs/themes/prism-okaidia.css'
  ]

What is expected ?

The markdown parser to properly extend the highlight option to use Prism js to highlihgt my

tags.

What is actually happening?

All of the 'pre' syntax highlighting loads from the css for the theme, rendering the text white with a shadow. However the rendered html does not have any of span tags parsed by Prism, and pre tag does not have the class applied either. Effectively, There is no difference in the page whether I extend the markdown parser or not.

template01

template01 posted a new question

nuxtent-module •

Nuxtent breaks with @nuxtjs/axios versions higher than 4.5.2

When using a version of @nuxtjs/axios versions higher than 4.5.2 for example version 5.0.0 my get requests breaks with.

Error: Request failed with status code 404

Anyone with the same problem?

Cheers