Earlier quoted context omitted.
I looked at your site and its source code. The site is snappy and code straightforward. I would love to tinker with Astro when time allows.
Is this it? https://nathangarfield.com/blog/what-sailing-taught-me-about... > it’s nearly impossible to sail on your own Just have to comment that this is plain false (as already evident by dinghy sailing). I've sailed up to 35-footers solo (although I'd advise to stay below 30-ish or 3-4 tons, makes it easier to not crash hard into things). It takes a bit more prepping and does help a lot if you have an autopilot or…
Astro 1.0 – a web framework for building fast, content-focused websites
241–250 of 256 posts
Re: Astro 1.0 – a web framework for building fast, content-focused websites
#242I used Astro recently to rebuild my personal website/portfolio, and I really enjoyed it. I'm not a frontend dev and I quickly get overwhelmed by all of the choices and the breakneck speed that the web ecosystem changes at. Astro was exactly what I needed. It's optimized for spending most of your time writing content in markdown, but it gives you complete freedom to seamlessly add web code of any complexity you like.…
Hey, mind sharing your website? I'd like to check it out.
Re: Astro 1.0 – a web framework for building fast, content-focused websites
#243Earlier quoted context omitted.
If you don't have npm installed, just stay as far as you can from this :D Seriously, JS static website generators are the worst... use something written in any compiled language so you just download and run a single binary, no messing around with npm and millions of dependencies. Take your pick here: https://jamstack.org/generators/
PHP is pretty great. No NPM needed
Re: Astro 1.0 – a web framework for building fast, content-focused websites
#244Earlier quoted context omitted.
But you’re aware JSX is just plain old PHP files, code intermingled with HTML? It’s the exact same thing, and it breeds the exact same bad behaviour.
Separation of concerns is different from separation of languages. PHP intermingled with HTML was bad because developers would do things like run database queries and other operations that caused side effects directly in the markup. Every templating system still has logic in it, and almost every templating system as a way to create custom helpers which are written in the host language. Since API calls and calls to rea…
Re: Astro 1.0 – a web framework for building fast, content-focused websites
#245Re: Astro 1.0 – a web framework for building fast, content-focused websites
#246Earlier quoted context omitted.
Separation of concerns is different from separation of languages. PHP intermingled with HTML was bad because developers would do things like run database queries and other operations that caused side effects directly in the markup. Every templating system still has logic in it, and almost every templating system as a way to create custom helpers which are written in the host language. Since API calls and calls to rea…
JSX doesn't separate languages, you're mixing HTML with TypeScript. You can absolutely do database queries in your template. What is keeping you from doing `fetch(' https://side-effect.ts').then (() => doSomethingHorrible())` in your template? Or invoking an `alert()`?
In short, you can do those things maliciously, but if you do them naively it is immediately obvious when you run the code that it's not correct.
Compare that to the original analogy to mixing raw PHP and HTML templates. Since the rendering process is blocking, you can easily stuff form handling, remote API calls, and database calls in amongst your markup, and can make it "work" even if it's not clean.
Even Laravel's blade components let you write custom components and helpers in PHP which can do all of those things from the template- you just don't see the actual SQL mixed with the HTML in the same file. The problem is still there, just now it is harder to see.
Re: Astro 1.0 – a web framework for building fast, content-focused websites
#247Earlier quoted context omitted.
I see, but then your scripts are not nice compact commands. For instance, my most-used bash script takes a file as input and opens either VIM or Emacs depending on whether the file is a .md or .org (simplified example). I run it like so: $ n foo.org I can edit ~/.local/bin/n and update the file, and use it immediately. I actually have my whole ~/.local/bin in version control. Having to type out e.g. $ nim compile --r…
Just alias the command in your .bashrc? e.g. `alias n="nim compile --run n"`. I'm not sure what the issue is with longer commands because the benefits of writing in a strongly statically typed language definitely outweigh a few extra characters to type, which you don't even need to do with aliases.
Re: Astro 1.0 – a web framework for building fast, content-focused websites
#248Earlier quoted context omitted.
> where I would have to store the source as a separate file from the executable, then compile it each time > What's your build and deploy (to ~/.local/bin I presume) strategy? You can run scripts as you would with bash, you don't have to manually build and run the executable. For example, `cargo run (inside the script source folder)` and `sh script.sh` do basically the same thing, end user wise. `nim compile --run sc…
I see, but then your scripts are not nice compact commands. For instance, my most-used bash script takes a file as input and opens either VIM or Emacs depending on whether the file is a .md or .org (simplified example). I run it like so: $ n foo.org I can edit ~/.local/bin/n and update the file, and use it immediately. I actually have my whole ~/.local/bin in version control. Having to type out e.g. $ nim compile --r…
eg:
$ code script.nim
#!/usr/bin/env nimcr
echo "hello world"
$ ./script.nim
hello world
edit:There's also the possibility of using nimscript, using nim e. It works similarly but you'd change the shebang line to something like
#!/usr/bin/env nim e --hints:offRe: Astro 1.0 – a web framework for building fast, content-focused websites
#249Earlier quoted context omitted.
PHP is pretty great. No NPM needed
PECL? PEAR? Composer? ...
Ironically, Composer actually lists npm as one of its inspirations [1].
> "...Composer is strongly inspired by node's npm and ruby's bundler."
Re: Astro 1.0 – a web framework for building fast, content-focused websites
#250I've used Astro my company's landing page for the past year or so [0]. We write blog posts in Notion and port them right to the site and the experience has been fantastic. There are a few understanding quirks with regard to using React etc within Astro (it's SSR'd unless you add the "client" attribute, and counter-intuitively the Component Lifecycle doesn't run the same). For client landing pages, we'll use Astro too…
Interesting, how does the process of going from Notion to Astro work? Are you just exporting Markdown files, or is there an API integration in use?