Skip to content

Update deno.mdx#6535

Merged
sarah11918 merged 4 commits into
withastro:mainfrom
Giwan:patch-1
Feb 9, 2024
Merged

Update deno.mdx#6535
sarah11918 merged 4 commits into
withastro:mainfrom
Giwan:patch-1

Conversation

@Giwan
Copy link
Copy Markdown
Contributor

@Giwan Giwan commented Jan 22, 2024

Description (required)

It is possible to deploy a static Astro site. This is to correct the documentation since Deno supports static sites through deployctl.

Related issues & labels (optional)

  • Suggested label: deno deploy

It _is_ possible to deploy a static Astro site. This is to correct the documentation since Deno supports static sites through deployctl.
@vercel
Copy link
Copy Markdown

vercel Bot commented Jan 22, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview Feb 9, 2024 3:29pm

@astrobot-houston
Copy link
Copy Markdown
Contributor

Hello! Thank you for opening your first PR to Astro’s Docs! 🎉

Here’s what will happen next:

  1. Our GitHub bots will run to check your changes.
    If they spot any broken links you will see some error messages on this PR.
    Don’t hesitate to ask any questions if you’re not sure what these mean!

  2. In a few minutes, you’ll be able to see a preview of your changes on Vercel 🥳

  3. One or more of our maintainers will take a look and may ask you to make changes.
    We try to be responsive, but don’t worry if this takes a few days.

Copy link
Copy Markdown
Member

@Fryuni Fryuni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! Congrats on your first PR to Astro Docs, hope your rocket had a smooth launch. Welcome to orbit!

2. In the terminal cd to the `./dist` folder and run the deploy command with the following parameters

```sh
deployctl deploy --project=<MY-DENO-PROJECT> --entrypoint=https://deno.land/std@0.211.0/http/file_server.ts
Copy link
Copy Markdown
Member

@Fryuni Fryuni Jan 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do this file server behave as an Astro project would expect? The key behaviors that normally need to be configured on static deployments without an adapter to do the work are:

  • Folder indexes are handled the same way as Astro, so it matches what Astro generates (remember that this is configurable in Astro)
  • Trailing slashes match Astro's configuration
  • 404 pages are handled correctly

Taking as an example NGINX. You clearly can host any static site with it, but if you try to host an Astro site with the default configuration it will misbehave. There is a section on the docs with a configuration that allows serving an Astro static output correctly. Would an example like that be needed here or does it work out of the box?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the review @Fryuni
Sorry for the late reply. It's been a hectic couple of days.

I tested the 404 scenario you mentioned and it's indeed an issue. When deployed 404.astro or 404.md is not recognised.

What's the best approach? Shall I close the PR until I have a something more complete that addresses the issue?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you know of a way to configure that file server to serve the 404 correctly, you can include it as the required configuration for that option.

If you don't know of a way, or if you know that there isn't one, then I believe it is better not to make this change.

@sarah11918
Copy link
Copy Markdown
Member

Hi @Giwan ! Thank you for adding this update to reflect what is now possible. I'm sure that would help a lot of people!

I just wanted to make sure you noticed that you have a review comment here to address before we can continue. Are you available to respond to this?

@sarah11918 sarah11918 added the improve or update documentation Enhance / update existing documentation (e.g. add example, improve description, update for changes) label Feb 5, 2024
Comment thread src/content/docs/en/guides/deploy/deno.mdx Outdated
Comment thread src/content/docs/en/guides/deploy/deno.mdx Outdated
Copy link
Copy Markdown
Member

@Fryuni Fryuni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Copy Markdown
Member

@sarah11918 sarah11918 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you very much for this contribution @Giwan , and if you'd like to make another PR in the future for static sites, you are welcome to!

Welcome to Team Docs! 🥳

@Giwan
Copy link
Copy Markdown
Contributor Author

Giwan commented Feb 9, 2024

LGTM, thank you very much for this contribution @Giwan , and if you'd like to make another PR in the future for static sites, you are welcome to!

Welcome to Team Docs! 🥳

Thanks @sarah11918
I'm investigating a different way to serve the static files with either oak or file_server. I'll create a new PR if it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improve or update documentation Enhance / update existing documentation (e.g. add example, improve description, update for changes)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants