blinkk / amagaki

A high-performance TypeScript static website generator for building highly-interactive websites. Localization inbuilt. Flexible URLs. Content managed and templates separated.
https://amagaki.dev
MIT License
36 stars 2 forks source link

PageBuilder: canonical docs #197

Closed pimdewit closed 2 years ago

pimdewit commented 2 years ago

Hi!

I noticed the PageBuilder appends a canonical and alternate tag to the head, pointing at localhost by default. I saw some documentation at the end of the #Background section, and I saw a reference related to this in the source, but I could not figure out how to configure it in the end.

https://github.com/blinkk/amagaki/blob/a083e6eeb8da86f64bf461d010c350140100a42d/packages/amagaki-plugin-page-builder/src/page-builder.ts#L529 Is there additional documentation on this?

The starter has the same canonical+alternate output i'm experiencing.

jeremydw commented 2 years ago

Hi! Currently the canonical output includes localhost because it uses the environment's "hostname" value.

Here's how to get it to work as expected:

  1. In the environments section of amagaki.ts, add a key named "hostname": https://github.com/blinkk/amagaki-starter/blob/main/amagaki.ts#L72 with value of the domain you are deploying to.
  2. Use npx amagaki build -e prod (for example) to build a set of files to the prod environment.
pimdewit commented 2 years ago

Amazing, thank you!