Coder Social home page Coder Social logo

How to specify pages about vuepress-bar HOT 10 CLOSED

ozum avatar ozum commented on August 23, 2024
How to specify pages

from vuepress-bar.

Comments (10)

ozum avatar ozum commented on August 23, 2024

Could you provide a sample repo please?

from vuepress-bar.

fanux avatar fanux commented on August 23, 2024

https://github.com/sealyun/vuepress/blob/40ee4fb15d31bb8240a8bd6db39e220a8729a4db/.vuepress/config.js

plugins: [
['autobar', {setHomepage : 'hide',navPrefix : "blog"}]

from vuepress-bar.

fanux avatar fanux commented on August 23, 2024
const getConfig = require("vuepress-bar");
const barConfig = getConfig('./')

module.exports = {
  head: [
    ['meta', { name: 'theme-color', content: '#007af5' }],
    ['meta', { name: 'apple-mobile-web-app-capable', content: 'yes' }],
    ['meta', { name: 'apple-mobile-web-app-status-bar-style', content: 'black' }],
    ['script', {}, `
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "https://hm.baidu.com/hm.js?2803648cc5852dd3e9e46bbd0bf63366";
      var s = document.getElementsByTagName("script")[0]; 
      s.parentNode.insertBefore(hm, s);
    })();
  `]
  ],
  title: 'sealyun | kubernetes安装',
  themeConfig: {
    logo: 'https://sealyun.com/img/logo.png',
    sidebar: barConfig.sidebar,
    nav: [
      { text: '离线包下载', link: 'http://store.lameleg.com', target:'_self', rel:'' },
      { text: '常见问题', link: '/faq/', target:'_self', rel:'' },
      { text: '版本变更', link: '/changelog/', target:'_self', rel:'' },
      { text: '开源项目', link: '/github/', target:'_self' },
      { text: '联系方式', link: '/contact/', target:'_self' },
      {
        text: '友情连接',
        items: [
          { text: '', items: [{link: 'https://fuckcloudnative.io/#sealyun', text: "云原生实验室"}] },
          { text: '', items: [{link: 'https://kuboard.cn/#sealyun', text: "kuboard"}] },
          { text: '', items: [{link: 'https://www.qikqiak.com/?utm_source=sealyun.com', text: "阳明的博客"}] },
          { text: '', items: [{link: 'https://zhangguanzhang.github.io/#sealyun', text: "张馆长的博客"}] },
        ]
      },
    ]
  },
}

from vuepress-bar.

fanux avatar fanux commented on August 23, 2024

const barConfig = getConfig("./",["/blog/","/docs/"])

I think add a pages list will better

from vuepress-bar.

ozum avatar ozum commented on August 23, 2024

You should add all your content to a subfolder for vuepress-bar working correctly.

For example:

Add all your content to docs (including .vuepress) folder as below:

image

Then in config.js

const getConfig = require("vuepress-bar");
const barConfig = getConfig(`${__dirname}/..`);



module.exports = {
  // ... your config 
  themeConfig: {
    sidebar: barConfig.sidebar,
    nav: [] // your nav details
  }
}

from vuepress-bar.

fanux avatar fanux commented on August 23, 2024

So dir like this?

website
     |--.vuepress
     |--docs
             |--.vuepress
     |--README.md

Two .vuepress dir?

from vuepress-bar.

ozum avatar ozum commented on August 23, 2024

No, just single .vuepress.

Only in /docs/.vuepress:

website
  |--docs
    |--.vuepress
    |--README.md

from vuepress-bar.

fanux avatar fanux commented on August 23, 2024

But I have other pages... this is my website: sealyun.com, and I don't expect other pages have sidebar

from vuepress-bar.

ozum avatar ozum commented on August 23, 2024

Maybe you can create two vuepress sites and add manual links between them in nav:

website
  |--docs1
    |--.vuepress
    |--README.md
  |--docs2
    |--.vuepress
    |--README.md

from vuepress-bar.

fanux avatar fanux commented on August 23, 2024

I think that is not very nice, vuepress bar add a config to filter out which pages need it will better. Like this :

const barConfig = getConfig("./",["/blog/","/docs/"])

It is my suggestion 😄

from vuepress-bar.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.