Barnes Tech

Back

Deployment

Comment system for pages at the bottom

Package Mode

This theme which >= v4.0.0 has integrated NPM package mode. Recommended way is remove local package file, and install the theme integration from NPM. If there’s some reason you want to change the package content, you should link local package to your theme template. A bun method is integrated. You should:

  1. Add environment variable BUN_LINK_PKG=true.
  2. Run bun pure check to link the package automatically.

This method can also work on Deployment for other platforms like ‘Vercel’. All you need is to add the environment variable to build options on your platform control settings. The build command astro-pure check && astro check && astro build will automatically link the package.

Deployment Mode

Vercel

This theme supports Vercel by default:

  1. Push your code to your online Git repository (GitHub, GitLab, BitBucket).
  2. Import your project into Vercel.
  3. Vercel will automatically detect Astro and configure the right settings.
  4. Your application is deployed! (e.g. astro.vercel.app)

And vercel also support static method:

import vercelServerless from '@astrojs/vercel/serverless' // [!code --]
import vercelStatic from '@astrojs/vercel/static'; // [!code ++]

export default defineConfig({
  //   ...
  adapter: vercelServerless() // [!code --]
  adapter: vercelStatic(), // [!code ++]
})

Node server

If you are deploying with Node.js locally, you need to install @astrojs/node first:

bun add '@astrojs/node'

Then follow the comments in astro.config.ts and modify like:

import vercelServerless from '@astrojs/vercel/serverless' // [!code --]
import node from '@astrojs/node' // [!code ++]

export default defineConfig({
  //   ...
  adapter: vercelServerless(), // [!code --]
  adapter: node({ mode: 'standalone' }), // [!code ++]

  integrations: [
    outputCopier({ // [!code --]
      integ: ['sitemap', 'pagefind'] // [!code --]
    }) // [!code --]
  ]
})

Bun server

Bun also support static method.

Check @nurodev/astro-bun for more.

Static

Remove all server adapter configuration in astro.config.ts:

import vercelServerless from '@astrojs/vercel/serverless' // [!code --]

export default defineConfig({
  //   ...
  adapter: vercelServerless(), // [!code --]
  output: 'server', // [!code --]
})

GitHub Pages

See Astro: Configure Astro for GitHub Pages.