- Route configuration - An example configuration file to be built for use in SSR.
- Full example - An SSRed example of what we produce today.
- Styles
- Stylesheets using Astro.resolve - Explainer for stylesheet links.
- Astro scoped styles - Explainer for Astro scoped stylesheets.
- Styles imported in JS - Explainer for styles that are imported into JavaScript, such as a React component importing CSS.
- Scripts
- Styles
- Hydrated components - Explainer for hydrated components.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
usage() { | |
program_name=$(basename $0) | |
bold=$(tput bold) | |
normal=$(tput sgr0) | |
cat <<EOM | |
Usage: $program_name [options] status | |
Post a status update to a Mastodon account. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
bin_name=$1 | |
bin_path="node_modules/.bin/$bin_name" | |
bin_dir=$(dirname $bin_path) | |
if [ ! -f "$bin_path" ]; then | |
echo "$bin_path does not exists" | |
exit 1 | |
fi |
deno run --allow-net --unstable server.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { resolve } from 'https://deno.land/[email protected]/path/posix.ts'; | |
const CHAR_FORWARD_SLASH = 47; | |
/** | |
* Return the relative path from `from` to `to` based on current working directory. | |
* @param from path in current working directory | |
* @param to path in current working directory | |
*/ | |
export function relative(origFrom: string, origTo: string): string { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fileName = Deno.args[0]; | |
if(!fileName) { | |
console.error('No file provided.'); | |
Deno.exit(1); | |
} | |
let file = await Deno.open(fileName); | |
let encoder = new TextEncoder(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function listen(fn) { | |
const gen = fn(); | |
function listener(ev) { | |
let { done } = gen.next(ev); | |
if(done) { | |
this.removeEventListener(ev.type, listener); | |
gen.return(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { EventObject, Guard, InvokeCreator, StateMachine } from 'xstate' | |
type EventNames = 'GO_BACK' | 'GO_FORWARD' | 'GO_SIDEWAYS'; | |
type KnownContextKeys = 'user'; | |
type LucyKnownContext<Keys extends string> = Record<Keys, any> | |
function createMachine<TContext extends LucyKnownContext<KnownContextKeys>, TEvent extends { type: EventNames } = any>() { | |
return {} as any |
NewerOlder