Skip to content

Vercel Settings

Cell edited this page Jan 11, 2024 · 8 revisions

General

Build & Development Settings

For FixIt demo

Framework Preset: Hugo

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

Output Directory: demo/public

Install Command: npm install

For FixIt docs

Framework Preset: Hugo

# hugo -v --gc --minify $BUILD_DRAFTS
Build Command: npm run build -- $BUILD_DRAFTS

Output Directory: public

Install Command: npm install && amazon-linux-extras install golang1.19

Installing Go in the build image

Root Directory

Node.js Version

18.x

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

Domains

For FixIt demo

Environment Branch Domain Redirect
Production master demo.fixit.lruihao.cn
Production master fixit-demo.vercel.app demo.fixit.lruihao.cn

For FixIt docs

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.112.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