🏝️ Island.js is a static site generator that builds on top of Vite, React and MDX. It is designed to be simple, powerful, and performant. It is built to help you focus on writing and deployed with minimum configuration.It has the following features:
Dark Mode
, Home Page
, API Page
、Full-text Search
, i18n
etc.Next we will walk you through the steps to create a new Island.js doc site.
TIP
At present, we also provide independent tutorial documents to complete project initialization, development, bundling and deployment from scratch, with a better reading and interactive experience, you can click [here] to view.
Island.js has two installation methods, you only need to choose one. We recommend using the create-island
cli because it can help you quickly and easily install Island.js and build a website framework.
create-island
cliUsing the create-island
cli tool can help you quickly and easily install island and build a website framework. You can create a repository and run this command, which will create a new directory containing template files.
# npm
npx @islandjs/create-island@latest island-app
# yarn
yarn create @islandjs/island island-app
# pnpm
pnpm create @islandjs/island island-app
Answer the questions asked by the cli, and wait for the installation to complete. It will automatically install dependencies and start the development server.
If you name your new site island-app
, then you will create a new directory called island-app
in the current directory. You can enter the directory by the following command:
cd island-app
Of course, you can also manually initialize the project. First, you can create a new directory by the following command:
mkdir island-app && cd island-app
Run npm init -y
to initialize a project. You can use npm, yarn or pnpm to install Island.js:
# npm
npm install islandjs
# yarn
yarn add islandjs
# pnpm
pnpm add islandjs
Then create files and directories as follows:
mkdir docs && echo '# Hello World' > docs/index.md
Add the following scripts to package.json
:
{
"scripts": {
"dev": "island dev docs",
"build": "island build docs",
"preview": "island start docs"
}
}
Serve the documentation site in the local server.
yarn dev
Island will start a development server at http://localhost:5173.
If you use the create-island
cli to create a project, you will see a page with a navigation bar and contents (like this document). If you choose to create a project manually, you will see Hello World
printed on the page. This means that you have successfully started the development server of Island.js.
Build the documentation site for production.
yarn build
Island will generate a static site in the .island/dist
directory.
Preview the production build locally.
yarn preview
Island will start a production server at http://localhost:4173.