saberland/saber

Do you want to work on this issue?

You can request for a bounty in order to promote it!

Saber 0.11.5 'saber-config.yml' performed different from 'saber-config.js' in <saber-link> path. #586

Siricee posted onGitHub

<!-- Please don't delete this template or we'll close your issue -->

<!-- Before creating an issue please make sure you are using the latest version of Saber. -->

<!-- Issues which contain questions or support requests will be closed. -->

<!-- Please ask questions via following several ways. -->

<!-- https://chat.saber.land/ -->

<!-- https://stackoverflow.com/questions/ask?tags=saberjs -->

Bug report

Version

0.11.5

Steps to reproduce

<div class="nav-link" :key="index" v-for="(item, index) in $themeConfig.nav">
       <saber-link :key="index" :to="item.path" v-text="item.text"></saber-link>
</div>

in saber-config.yml:

themeConfig:
  nav: 
    - text: Posts
      path: /posts   # or '/posts'

dev mode: http://localhost:3000/posts will be routed to 404 page.

if I change it to

themeConfig:
  nav: 
    - text: Posts
      path: /posts.html

dev mode will work, build mode will cause 'saber-plugin-query-posts' build error in pagination 'posts/page/2'.

but in saber-config.js:

themeConfig: {
        nav: [{
            text: 'Posts',
            path: '/posts'
        }]
}

all works.

So I think something wrong has happend in yaml converting to js process.

<!-- If you are reporting a bug that can ONLY be reproduced on your repository, PLEASE provide this repo link. That takes guessing work out of the way and saves us time. -->

<!-- You can also use this CodeSandbox starter https://bit.ly/2IlcpNF -->

What is expected?

saber-config.yml should perform same as saber-config.js

What is actually happening?

saber-config. js works well while saber-config.yml cause url error.

Other relevant information

  • Result of running saber -v: cli.js/0.11.5 win32-x64 node-v10.15.0
  • Browser version (optional): Chrome 79.0.3945.117
  • Is Saber a global or local install? local
  • Which package manager did you use for the install? node
  • Does this issue occur when all plugins are disabled? yes

Fund this Issue

$0.00
Funded
Only logged in users can fund an issue

Pull requests