Rewrite to Astro, to make the website static#165
Conversation
|
Thanks @DLakomy. This is an interesting experiment. I will have a look. Can you sell me on Astro? I assume its a static site generator. But why this one specifically? I will try it out locally... and report back. |
|
A few more questions and comments:
|
|
|
||
| --- | ||
|
|
||
| <div><slot /></div> |
There was a problem hiding this comment.
What does a file like this do?
There was a problem hiding this comment.
It's a direct equivalent of the original:
function Answer({ children }) {
return <div>{children}</div>;
}In Astro it's not possible to write JSX in the frontmatter (the lines between ---), so AFAIK this is the only way to create a component. Source: withastro/roadmap#164
I wasn't sure whether to rewrite this (which I did) or to inline this div. I made a component to keep faq.astro similar to Faq.jsx, easier to review. We can keep it (it would make it easier to change how an Answer looks like in the future) or inline it, so nobody is wondering why it's here. I have got no strong opinion.
Sure. Some background: I'm not a frontend dev, so take what I say with a grain of salt (or a bucket of salt). I sometimes have to write a frontend, though, and in these cases I like solutions that are easy to learn and have a simple tooling. Since I know I won't be able to maintain this site long-term after this experiment, I wanted to make the codebase as approachable as possible for the existing team. I chose Astro because:
What alternatives I've rejected:
I've been rewriting page by page. The first one, Renders as In terms of verification, I've been carefully scrolling flix.dev and localhost next to each other (visually and the effective html) and checking if it's now identical. The rest (the pages after
I think so (I've checked for instance
The renderer is Shiki and Prism is an option. I have no idea what is Prism, but Shiki, if I understand correctly, renders on the server and is kind of built-in. So we could use
It depends. The code I've submitted uses exactly zero JavaScript, because everything is rendered during |
|
Thanks-- I am on vacation but I will revisit this when i am back (August) |
Fixes #117
Hello.
I've learned Astro yesterday and thought I might try rewriting your webpage to a static one. I've got nothing against JavaScript on your page, but saw an issue on GitHub.
What I optimized for:
masterduring a full rewrite).documentationsubpage. I guess it's a matter of fontawesome's version.npm run buildyou can runfind ./dist -name '*.js'and see no results).Some notes:
src/components/InlineEditor.astro. It's not blocking this merge, just a suggestion for the future. I guess this would help make Flix more popular (which I hope will happen!).Visual Studio Code Supportsection on thehomesubpage) with a simple grid. I can try to make a pure CSS carousel, but maybe it should be removed and just point to the VSCode webpage. What do you think?How to test:
npm run build.distsubdir. For examplecd dist && python -m http.server 8000and openhttp://localhost:8000/in your browser. Actually, now you can even read that withcurl:DIf you're interested in merging, I'm waiting for your feedback and can check again before merging, to make sure no text is lost.