Docs menu
Getting started
IntroductionInstallationProject structureBuilding pages
RoutingPagesLayoutsStylingMarkdownContent and dataIslandsGoing live
SEO and headDeployingFormsGuides
Build a brochure siteAdvanced
Running as a serverReference
ReferenceGetting started
Installation
Install imba-pages, set up the commands, and make your first page.
imba-pages is installed from its git repository rather than npm, like @milktop/imba-ui.
The repository is private, so the machine (or CI) installing it needs access to
milktop/imba-pages.
Start a site
mkdir my-site && cd my-site
npm init -y
npm install github:milktop/imba-pages#v0.4.0 imba@2.0.0-alpha.253
Add the commands to package.json:
"scripts": {
"dev": "imba-pages dev",
"build": "imba-pages build",
"start": "imba-pages start"
}
Then the smallest possible site, one file:
# src/pages/index.imba
export const meta = {title: 'Hello'}
export default tag Home
<self>
<h1> "Hello from imba-pages"
npm run dev
Open http://localhost:3000. Edits show up straight away; new pages appear without a restart.
The commands
| Command | What it does |
|---|---|
imba-pages dev |
Live server on port 3000 (PORT to change) with hot reload |
imba-pages build |
Writes the finished site to dist/, ready for any static host |
imba-pages start |
Runs the site as a Node server; only for sites with their own form handling |
Each takes an optional folder (imba-pages dev site), defaulting to the current one.
Working on imba-pages itself
While changing the framework, point a site at a local checkout instead of a tag:
"dependencies": {
"@milktop/imba-pages": "file:../imba-pages"
}
Inside the imba-pages repo, the examples and this docs site use the code in lib/
directly: npm run dev:brochure for the example, npm run dev:site for these docs.
Next: Project structure.