We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Netlifyはプルリクに対してプレビュー用の動的なサブドメインを発行してくれる。プルリクからプレビュー用のトップページには遷移できるのだけど、ブログの各記事に飛ぶと、config.tomlのbaseURLで設定されているURL(つまりは本番向けのURL)に遷移してしまう。
config.toml
baseURL
これはプレビュー用のデプロイでも同じ config.toml を使ってるのでさもありなん、というところ。Netlifyのプレビュー用ドメインに合わせて baseURL を変更する方法を調べる。
The text was updated successfully, but these errors were encountered:
答えはフォーラムに書いてあった。
Hugoは -b, --baseURL オプションで config.toml の baesURL を上書きできる。なのでNetlifyのビルドコマンドにそれを指定してあげればいい。
-b, --baseURL
baesURL
フォーラムの例では netlify.toml にコマンドを指定しているが、NetlifyのWebでもできる。具体的には Settings > Build & deplooy > Continuous Deployment > Build settings の Build command に hugo -b $DEPLOY_URL を指定すればよい。
netlify.toml
Settings > Build & deplooy > Continuous Deployment > Build settings
Build command
hugo -b $DEPLOY_URL
Sorry, something went wrong.
No branches or pull requests
Netlifyはプルリクに対してプレビュー用の動的なサブドメインを発行してくれる。プルリクからプレビュー用のトップページには遷移できるのだけど、ブログの各記事に飛ぶと、
config.toml
のbaseURL
で設定されているURL(つまりは本番向けのURL)に遷移してしまう。これはプレビュー用のデプロイでも同じ
config.toml
を使ってるのでさもありなん、というところ。Netlifyのプレビュー用ドメインに合わせてbaseURL
を変更する方法を調べる。The text was updated successfully, but these errors were encountered: