Skip to content

Vercel Settings

Cell edited this page Nov 26, 2023 · 8 revisions

General

Build & Development Settings

Framework Preset: Hugo

# npm run babel && hugo -v --source=docs --gc --minify $BUILD_DRAFTS
Build Command: npm run build -- $BUILD_DRAFTS

Output Directory: docs/public

Install Command: npm install

Root Directory

Node.js Version

18.x

./ (Include source files outside of the Root Directory in the Build Step.)

Domains

Environment Branch Domain Redirect
Production master fixit.lruihao.cn
Production master hugofixit.vercel.app fixit.lruihao.cn
Preview dev pre.fixit.lruihao.cn

Git

Production Branch

master

Environment Variables

Variable Value Environment
BUILD_DRAFTS --buildDrafts Preview
HUGO_EXTENDED true Production, Preview
HUGO_VERSION 0.110.0 Production, Preview

v0.2.15 ⬇️ (deprecated)

By default, Vercel ignores certain files and folders for security and performance reasons, preventing them from being uploaded during the deployment process. #ignored-files-and-folders

  1. # invalid in pull request
    # install
    rm -rf FixIt && git clone -b $VERCEL_GIT_COMMIT_REF https://github.com/Lruihao/FixIt.git FixIt && npm install
    # or
    rm -rf FixIt && git clone https://github.com/Lruihao/FixIt.git FixIt && cd FixIt && git checkout $VERCEL_GIT_COMMIT_SHA && npm install
    
    # build
    # `BUILD_DRAFTS`: `--buildDrafts` (Preview, Development)
    cd FixIt && npm run babel && hugo -v --source=exampleSite --themesDir ../.. $BUILD_DRAFTS --gc --minify
    
    # output
    FixIt/exampleSite/public
  2. # install
    
    # last modify date error of posts
    # build
    hugo -v --source=exampleSite --themesDir ../.. --theme $PWD --gc --minify
    
    # output
    exampleSite/public

Getting started

Head to the getting started page or start with a template:

Clone this wiki locally