0.0.32 • Published 3 months ago

femtosite v0.0.32

Weekly downloads
-
License
MIT
Repository
-
Last release
3 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

3 months ago

0.0.31

3 months ago

0.0.32

3 months ago

0.0.28

4 months ago

0.0.29

4 months ago

0.0.20

7 months ago

0.0.21

7 months ago

0.0.22

7 months ago

0.0.23

7 months ago

0.0.12

7 months ago

0.0.24

7 months ago

0.0.13

7 months ago

0.0.25

7 months ago

0.0.14

7 months ago

0.0.3

7 months ago

0.0.2

7 months ago

0.0.26

7 months ago

0.0.15

7 months ago

0.0.27

6 months ago

0.0.16

7 months ago

0.0.17

7 months ago

0.0.18

7 months ago

0.0.19

7 months ago

0.0.5

7 months ago

0.0.4

7 months ago

0.0.0

7 months ago