ulivz / vuepress-plugin-export

Export your VuePress site to a PDF file
MIT License
90 stars 17 forks source link

feat: add page option and hide nav bar when generating PDF #16

Open foreseaz opened 4 years ago

foreseaz commented 4 years ago

Resolve #15 [feature] config for user to hide nav bar and change margin

foreseaz commented 4 years ago

Usage:

[
    "vuepress-plugin-export",
    {
        hideNav: true,
        page: {
            format: 'A4',
            printBackground: true,
            margin: {
                top: 60,
                left: 20,
                right: 20,
                bottom: 60
            }
        }
    }
]
foreseaz commented 4 years ago
  extendPageData($page) {
    if (opts.hideNav) {
      const {
        _context: { themeConfig }
      } = $page
      themeConfig.navbar = false
    }
  },

Directly change the _context may affect the building of original deployment. Need to find another workaroudn for hiding the navbar.

ulivz commented 2 years ago

Could u help resolve the conflict & update docs?