0.0.32 • Published 10 months ago

femtosite v0.0.32

Weekly downloads
-
License
MIT
Repository
-
Last release
10 months ago

Femtosite

Extremely tiny static site generator based on TSX templates.

Getting started

We've created an easy interactive init process, start by calling the command in your favourite terminal:

npx femtosite init

The guide will now help setup the femtosite.json config file and make sure you hit the ground running.

Once you're ready to build your static site run:

npx femtosite build
# OR
npm run build

Femtosite will now transpile your TSX pages and render them afterwards, while taking care of any assets referenced with either the <StyleAsset /> or <ScriptAsset /> built in components.

Example page

index.component.tsx

import { createPage } from 'femtosite';

import { HelloWorld } from '../components/hello-world.component.js';
import { Shell } from '../components/shell.component.js';

export default createPage(async page => (
  <Shell page={page}>
    <HelloWorld />
  </Shell>
));

shell.component.tsx

import { FemtositePageProps, Html, ScriptAsset, StyleAsset } from 'femtosite';

export const Shell = async (
  { page }: { page: FemtositePageProps },
  ...children
) => (
  <Html lang="en">
    <head>
      <StyleAsset src="./assets/style.css" inline={true} />
      <StyleAsset src="./scss/main.scss" />
      <ScriptAsset src="./assets/app.js" inline={true} />
      <ScriptAsset src="./assets/app.js" async={true} />
    </head>
    <body>{...children}</body>
  </Html>
);

hello-world.component.tsx

export const HelloWorld = () => (
  <div>
    <h1>Hello World</h1>
    <p>Welcome to your new Femtosite!</p>
  </div>
);
0.0.30

10 months ago

0.0.31

10 months ago

0.0.32

10 months ago

0.0.28

10 months ago

0.0.29

10 months ago

0.0.20

1 year ago

0.0.21

1 year ago

0.0.22

1 year ago

0.0.23

1 year ago

0.0.12

1 year ago

0.0.24

1 year ago

0.0.13

1 year ago

0.0.25

1 year ago

0.0.14

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.26

1 year ago

0.0.15

1 year ago

0.0.27

1 year ago

0.0.16

1 year ago

0.0.17

1 year ago

0.0.18

1 year ago

0.0.19

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.0

1 year ago