Geek-style static personal portfolio blog built with Astro.
npm install
npm run devnpm run buildThe production files are generated in dist/.
This project is configured with base: '/blog', so it can be served from:
http://SERVER_IP/blog/
Recommended server path:
/var/www/shiyuan-blog
Recommended production update:
cd /var/www/shiyuan-blog
git pull origin main
npm ci
npm run build
sudo nginx -t && sudo systemctl reload nginxNginx path example:
location = /blog {
return 301 /blog/;
}
location ^~ /blog/ {
alias /var/www/shiyuan-blog/dist/;
index index.html;
try_files $uri $uri/ /blog/index.html;
}When switching to a dedicated domain such as blog.example.com, remove or change the base value in astro.config.mjs.