GithubHelp home page GithubHelp logo

zava810 / nux3gp Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lucpotage/nuxt-github-pages

0.0 0.0 0.0 475 KB

This is a sample Nuxt 3 project deployed on GitHub Pages

TypeScript 22.98% Vue 77.02%

nux3gp's Introduction

Here is how to deploy a Nuxt 3 project on GitHub Pages:

How to

  1. Install dev dependency gh-pages
  2. Add the script "deploy": "gh-pages -d dist" in package.json file
  3. Specifiy app baseURL in nuxt.config.ts
  4. Specifiy buildAssetsDir in nuxt.config.ts that doesn't start with an underscore _. See the router config example below
  5. Create an empty file .nojekyll at the root of the project
  6. Generate with npm run generate
  7. Deploy with npm run deploy

Router config:

export default defineNuxtConfig({
  app: {
    baseURL: '/nuxt-github-pages/', // baseURL: '/<repository>/'
    buildAssetsDir: 'assets', // don't use "_" at the begining of the folder name to avoids nojkill conflict
  }
}

What it does

The dependency will copy your dist content to a specific gh-pages branch that will be served by GitHub Pages. If you go to your Settings/Pages, you’ll see the active branch for your site.

The site is accessible on https://<username>.github.io/<repository>/. For this repository, the site is https://lucpotage.github.io/nuxt-github-pages/.

You can rely on GitHub Actions too. More info here: https://medium.com/front-end-weekly/ci-cd-with-github-actions-to-deploy-on-github-pages-73e225f8f131

More information about buildAssetsDir config: https://github.blog/2009-12-29-bypassing-jekyll-on-github-pages/

nux3gp's People

Contributors

lucpotage avatar lucatmyscript avatar maickellvilela avatar

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.