Giter Club home page Giter Club logo

island.js's Introduction

Island.js

A static site generator for the modern web.It has following features:

  • 🚀 Base on Vite, it has great development experience.
  • 📝 Internal MDX support, you can write React component in markdown file.
  • 🔥 Powerful default theme, includes Full-text Search, i18n, Dark Mode, Code Copy, Home Page,API Page etc.
  • 🏝️ Islands architecture, implement less client bundle and partial hydration, which means higher performance.

Documentation

To check out docs, visit docs.

Changelog

Detailed changes for each release are documented in the CHANGELOG.

Contribution

Please make sure to read the Contributing Guide before making a pull request. And you can join the Discord to discuss with us.

Credits

The theme system references VitePress and VuePress as well as their official docs.Thanks for them.

License

MIT

Copyright (c) 2022-present, Xingyuan Yang

island.js's People

Contributors

adrian-zephyr-liao avatar ahabhgk avatar boenfu avatar callqh avatar cheerioinf avatar codersjj avatar flower-f avatar fyzhu avatar github-actions[bot] avatar gumingwu avatar hershelh avatar inannan423 avatar leonnor avatar liyunfu1998 avatar longllg avatar loyep avatar lweijian avatar plasticine-yang avatar rottenpen avatar sanyuan0704 avatar shiinama avatar shuaiqidekaige avatar shulandmimi avatar spicylemonhaha avatar stdsuperman avatar uucoding avatar whale2002 avatar younggglcy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

island.js's Issues

Poor ux with search key

Describe the bug

Now island.js supports to type command + k (or ctrl + k) to rouse the search component. However, many browsers also take this as their hot key. And also because search component use throttle logic here, these lead to a poor experience that if user type ctrl + k very quickly, search key will not work, browsers take over it instead,

Hence, can we reduce the throttle time or just remove throttle?

Reproduction

See the official site of island.js

Expected behavior

Type ctrl + k can like immediately rouse the search component

System Info

System:
    OS: Linux 5.19 Arch Linux
    CPU: (8) x64 Intel(R) Core(TM) i5-1035G1 CPU @ 1.00GHz
    Memory: 2.81 GB / 15.40 GB
    Container: Yes
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.9.0 - /usr/bin/node
    Yarn: 1.22.19 - /usr/bin/yarn
    npm: 8.19.2 - /usr/bin/npm
  Browsers:
    Firefox: 104.0.2
  npmPackages:
    islandjs: workspace:* => 0.6.0

Additional context

No response

Validations

  • Read the docs
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.

Add code one click copy

Is your feature request related to a problem? Please describe.

The code copy function is very common, and I think it should be possible to add that function.
image

The effect after clicking:
image

Describe the solution you'd like

Add a button to the element that can be clicked to copy the code in it

Describe alternatives you've considered

No response

Additional context

No response

Validations

  • Read the docs.
  • Read the Contributing Guidelines.
  • Check that there isn't already an issue that asks for the same feature to avoid creating a duplicate.

Code line highlighting

Is your feature request related to a problem? Please describe.

Somtimes we need to highlight some code snippets.

Describe the solution you'd like

Give a markdown method to the users for highlighting some code lines. Just as:
image

Describe alternatives you've considered

No response

Additional context

No response

Validations

  • Read the docs.
  • Read the Contributing Guidelines.
  • Check that there isn't already an issue that asks for the same feature to avoid creating a duplicate.

Without initializing the git repository, the program terminates directly

Describe the bug

According to the official documentation, when initializing the project, when the git repository is not initialized, the execution dev will throw an error directly and the page will not be displayed properly.
image

Reproduction

  1. Quick start to initialize the project with the official documentation
  2. Execute pnpm run dev

Expected behavior

Correctly display the startup page

System Info

System:
    OS: macOS 12.6
    CPU: (8) arm64 Apple M1
    Memory: 137.02 MB / 8.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 16.14.2 - /usr/local/bin/node
    Yarn: 1.22.18 - /usr/local/bin/yarn
    npm: 8.19.2 - /usr/local/bin/npm
  Browsers:
    Chrome: 106.0.5249.91
    Safari: 16.0
  npmPackages:
    islandjs: ^0.2.4 => 0.2.4

Additional context

No response

Validations

  • Read the docs
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.

docs: a translation mistake

Describe the bug

image

The word SPA means 单页应用程序. It may confuse some new learners.

Reproduction

None

Expected behavior

None

System Info

None

Additional context

No response

Validations

  • Read the docs
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.

feat: create cli commands to initialize the project structure

Is your feature request related to a problem? Please describe.

For example, I want to create an island.js project that I can generate the project structure and default files with a single line of command instead of creating them one by one.

npx create-island@latest my-website

Describe the solution you'd like

Create a CLI project and declare the commands in package.json:

{
  "name": "create-island",
  "version": "1.0.0",
  "bin": {
    "create-island": "./bin/create-island.js"
  }
}

Write logic in bin/index.js to complete the task.

Describe alternatives you've considered

No response

Additional context

No response

Validations

  • Read the docs.
  • Read the Contributing Guidelines.
  • Check that there isn't already an issue that asks for the same feature to avoid creating a duplicate.

Is there any way to inject global style?

Is your feature request related to a problem? Please describe.

For example, if I want to use KaTex, the katex.css should be linked on each page, Otherwise, the formula will not render correctly.

Describe the solution you'd like

Maybe supporting template HTML file is one of the solutions.

Describe alternatives you've considered

No response

Additional context

No response

Validations

  • Read the docs.
  • Read the Contributing Guidelines.
  • Check that there isn't already an issue that asks for the same feature to avoid creating a duplicate.

设置base后,pageType: home页面link跳转会重复携带base的值

Describe the bug

设置base后,pageType: home页面,
hero:
actions:
- theme: brand
text: 点击查看
link: /intro/start

link这个地方跳转时,会重复携带base设置的值

Reproduction

hero:
actions:
- theme: brand
text: 点击查看
link: /intro/start

Expected behavior

设置base后,希望跳转和nav和sidebar中的link跳转效果保持一致

System Info

macos

Additional context

No response

Validations

  • Read the docs
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.

Server restart automatically after adding new markdown file

Is your feature request related to a problem? Please describe.

If we want to add a new markdown file, we must run the pnpm dev again to restart the server in order to load the new page, or we will get a 404 page.

Describe the solution you'd like

After adding the new page, the server will automatically restart, and we don't need to run the pnpm dev by ourselves.

Describe alternatives you've considered

No response

Additional context

No response

Validations

  • Read the docs.
  • Read the Contributing Guidelines.
  • Check that there isn't already an issue that asks for the same feature to avoid creating a duplicate.

feat: support multi framework, such as vue

Is your feature request related to a problem? Please describe.

Now, island.js only support react, but sometimes we need other framework such as vue

Describe the solution you'd like

I am not very clear how to refactor the current infrastructure in island.js.But there is a long way to go.

Describe alternatives you've considered

No response

Additional context

No response

Validations

  • Read the docs.
  • Read the Contributing Guidelines.
  • Check that there isn't already an issue that asks for the same feature to avoid creating a duplicate.

feat: support check dead link

Is your feature request related to a problem? Please describe.

Detect dead links and give hints during the building process to avoid the problem of links not opening after going online.
eg:

image

Describe the solution you'd like

  1. check internal link:by looking up the routing table
  2. check external link: the check-links library is used to check whether the external links are properly accessible

Describe alternatives you've considered

No response

Additional context

No response

Validations

  • Read the docs.
  • Read the Contributing Guidelines.
  • Check that there isn't already an issue that asks for the same feature to avoid creating a duplicate.

Incorrect style representation of the search component in dark mode

Describe the bug

I think it is not adapted to the style of the dark mode.
image

image

Reproduction

  1. Open the official website

Expected behavior

Correct display style

System Info

System:
    OS: macOS 12.6
    CPU: (8) arm64 Apple M1
    Memory: 156.31 MB / 8.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 16.14.2 - /usr/local/bin/node
    Yarn: 1.22.18 - /usr/local/bin/yarn
    npm: 8.19.2 - /usr/local/bin/npm
  Browsers:
    Safari: 16.0

Additional context

No response

Validations

  • Read the docs
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.

feat: support line numbers in frontmatter

Is your feature request related to a problem? Please describe.

Now the lineNumbers config only exists in markdown.lineNumbers, but it will be better if the frontmatter can expose the lineNumber config to give user fine-grained control. For example:

---
lineNumdbers: true
---

Describe the solution you'd like

See above.

Describe alternatives you've considered

No response

Additional context

No response

Validations

  • Read the docs.
  • Read the Contributing Guidelines.
  • Check that there isn't already an issue that asks for the same feature to avoid creating a duplicate.

feat: support custom `target: _blank` config for link

Is your feature request related to a problem? Please describe.

Now Island.js set target: _blank for every external urls (start with http:// or https://), but sometimes we don't want to open a new tab for some links.So we should improve the extensibility of this function.

Describe the solution you'd like

For example, we can expose the config:

{
  markdown: {
    // The link in this list will not open a new window after click
    targetBlankWhiteList: []
  }
}

Now in Island.js,the target: _blank will be attached by rehype-external-links, so we can implement it through it.

Describe alternatives you've considered

No response

Additional context

No response

Validations

  • Read the docs.
  • Read the Contributing Guidelines.
  • Check that there isn't already an issue that asks for the same feature to avoid creating a duplicate.

feat: support `command + k` to focus search button

Is your feature request related to a problem? Please describe.

Now you must click the search area then the button will be focused.But it will be more convenient if user input command + k in keyboard directly.

Describe the solution you'd like

See details above.

Describe alternatives you've considered

No response

Additional context

No response

Validations

  • Read the docs.
  • Read the Contributing Guidelines.
  • Check that there isn't already an issue that asks for the same feature to avoid creating a duplicate.

Modified slogants

Is your feature request related to a problem? Please describe.

The slogant "Vite & MDX powered static site generator.Base on islands architecture"
Is very hard to find out on github.
I have to type: MDX generator on seach box to find out this repo.

Describe the solution you'd like

So: pls seperate like this:
Vite & MDX powered static site generator. Base on islands architecture

Describe alternatives you've considered

No response

Additional context

No response

Validations

  • Read the docs.
  • Read the Contributing Guidelines.
  • Check that there isn't already an issue that asks for the same feature to avoid creating a duplicate.

support i18n

Is your feature request related to a problem? Please describe.

Support multi languages.

Describe the solution you'd like

I think it will be three parts to implement:

  1. Add menu group in nav component
  2. Extend locales config in themeConfig:
export interface LocaleConfig {
  lang: string;
  title?: string;
  titleTemplate?: string | boolean;
  description?: string;
  head?: HeadConfig[];
  label?: string;
  selectText?: string;
  // will add nav and sidebar for every locale config
}

export interface DefaultThemeConfig {
    // Add locales in theme config
    locales: Record<string, LocaleConfig>;
}
  1. Support different nav, sideabr content bewteen multi languages.

Describe alternatives you've considered

No response

Additional context

No response

Validations

  • Read the docs.
  • Read the Contributing Guidelines.
  • Check that there isn't already an issue that asks for the same feature to avoid creating a duplicate.

Build and test failed in Windows System

Describe the bug

Because of the path difference of Windows and Mac, the test will failed because it got a different path starts with something like "D:", and it will contains a lot of backslash(\). Both of them cause the babelPluginIsland can't work well.
image

To build the project, there will also be some problems.
image
I tried to solve it by adding the pathToFileURL function, and it solve the dynamic import problem.
image
But as I mention above in the test, the build still failed because of the difference path of Windows.

Of cause we often deploy project in Unix/Linux System, so we might not need to support Windows System. But I think that if we can support it, the Windows users can also preview the production in local environment. And that's great. Or we might need to give some warnings to the users in the docs.

Reproduction

A basic island project.

Expected behavior

Build and test normally.

System Info

Windows System

Additional context

No response

Validations

  • Read the docs
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.

check links plugin url parsing error in windows system

Describe the bug

Path resolution errors prevent the corresponding link from being found in the routing table.

image

Reproduction

To use the plugin on windows, execute the dev

Expected behavior

Resolve the path normally and find the corresponding internal link

System Info

System:
    OS: Windows 10 10.0.22000
    CPU: (8) x64 AMD Ryzen 7 3750H with Radeon Vega Mobile Gfx
    Memory: 4.26 GB / 14.94 GB
  Binaries:
    Node: 14.18.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.19 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 6.14.15 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Spartan (44.22000.120.0), Chromium (104.0.1293.54)
    Internet Explorer: 11.0.22000.120

Additional context

No response

Validations

  • Read the docs
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.

feat: backTop config

Is your feature request related to a problem? Please describe.

Now, BackTop is a boolean config, maybe it can use object to have more control

Describe the solution you'd like

backTop config

Describe alternatives you've considered

No response

Additional context

No response

Validations

  • Read the docs.
  • Read the Contributing Guidelines.
  • Check that there isn't already an issue that asks for the same feature to avoid creating a duplicate.

feat: support image preview

Is your feature request related to a problem? Please describe.

Click on the image for preview.And support functions such as zooming in and out of images

Describe the solution you'd like

No response

Describe alternatives you've considered

No response

Additional context

No response

Validations

  • Read the docs.
  • Read the Contributing Guidelines.
  • Check that there isn't already an issue that asks for the same feature to avoid creating a duplicate.

e2e test run failed

Describe the bug

e2e test run failed.
I think it's because the directory it's running in is incorrect

Error: Command failed with exit code 1: npm i --registry=https://registry.npmmirror.com/
    at null.makeError (/Users/liuqinghua/lqh/island.js/node_modules/.pnpm/[email protected]/node_modules/execa/lib/error.js:59:11)
    at execaSync (/Users/liuqinghua/lqh/island.js/node_modules/.pnpm/[email protected]/node_modules/execa/index.js:193:17)
    at Object.execaCommandSync (/Users/liuqinghua/lqh/island.js/node_modules/.pnpm/[email protected]/node_modules/execa/index.js:234:9)
    at null.prepareE2E (/Users/liuqinghua/lqh/island.js/scripts/prepare-e2e.cts:32:9) {
  shortMessage: 'Command failed with exit code 1: npm i --registry=https://registry.npmmirror.com/',
  command: 'npm i --registry=https://registry.npmmirror.com/',
  escapedCommand: 'npm i "--registry=https://registry.npmmirror.com/"',
  exitCode: 1,
  signal: undefined,
  signalDescription: undefined,
  stdout: undefined,
  stderr: undefined,
  failed: true,
  timedOut: false,
  isCanceled: false,
  killed: false
}
Error: Process from config.webServer was not able to start. Exit code: 1

Reproduction

Run the command npm run e2e:test

Expected behavior

Run correctly

System Info

System:
    OS: macOS 12.6
    CPU: (8) arm64 Apple M1
    Memory: 156.31 MB / 8.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 16.14.2 - /usr/local/bin/node
    Yarn: 1.22.18 - /usr/local/bin/yarn
    npm: 8.19.2 - /usr/local/bin/npm
  Browsers:
    Safari: 16.0

Additional context

No response

Validations

  • Read the docs
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.

Cannot interact in Safari browser.

Describe the bug

image

Reproduction

Open the docs website in safari browser.

Expected behavior

When we open the page, the aside marker and appearance button can be interactive.

System Info

-

Additional context

No response

Validations

  • Read the docs
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.

feat: support custom global ui component injection

Is your feature request related to a problem? Please describe.

For example, i want to inject a back to top component, then i can register it by following config:

// config.ts
export default {
  globalUIComponents: ['/User/project/src/components/BackToTop/index.tsx']
}

Then the component will be injected to page automatically.

Describe the solution you'd like

  1. declare virtual module in Layout component in default theme.
// Layout/index.tsx
import globalComponents from 'virtual:components'
  1. Generate component exports in vite plugin:
load(id) {
  if (id === 'virtual:components') {
    return `
      import BackToTop from '/User/project/src/components/BackToTop/index.tsx';
      export default [BackToTop]
   `
  }
}
  1. Render global component:
// Layout/index.tsx
function Layout() {
  return (
     // 省略
     globalComponents.map(globalComponent => React.createElement(globalComponent))
  )
}

Describe alternatives you've considered

No response

Additional context

No response

Validations

  • Read the docs.
  • Read the Contributing Guidelines.
  • Check that there isn't already an issue that asks for the same feature to avoid creating a duplicate.

some text is not localized in Chinese site mode

Describe the bug

some text is not localized in Chinese site mode,perhaps because the relevant adaptations are not done.
image
image

Reproduction

  1. Open the offical website

Expected behavior

Proper display of configured localized text

System Info

System:
    OS: macOS 12.6
    CPU: (8) arm64 Apple M1
    Memory: 120.80 MB / 8.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 16.14.2 - /usr/local/bin/node
    Yarn: 1.22.18 - /usr/local/bin/yarn
    npm: 8.19.2 - /usr/local/bin/npm
  Browsers:
    Chrome: 106.0.5249.61
    Safari: 16.0

Additional context

No response

Validations

  • Read the docs
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.

updates to non-Home md documents will trigger useFrontmatter,resulting in loss of Home data

Describe the bug

In the development environment, the update of other md documents will result in the loss of data on the front page

Reproduction

  1. Open two tab pages in the browser, one is the home page, and the other one opens other pages
  2. Update the non-home page md document, check the home page tab, and find that the home page data is missing

Expected behavior

Update the non-home page md file, the home page data is not affected

System Info

System:
    OS: macOS 12.6
    CPU: (8) arm64 Apple M1
    Memory: 172.98 MB / 8.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 16.14.2 - /usr/local/bin/node
    Yarn: 1.22.18 - /usr/local/bin/yarn
    npm: 8.19.2 - /usr/local/bin/npm
  Browsers:
    Safari: 16.0

Additional context

No response

Validations

  • Read the docs
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.

icon设置不生效

Describe the bug

image
设置icon没有生效

Reproduction

icon设置不生效

Expected behavior

icon设置后显示对应的效果

System Info

macos

Additional context

No response

Validations

  • Read the docs
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.

enableSpa开启SPA 模式不生效

Describe the bug

enableSpa: true
开启SPA 模式不生效

Reproduction

import { defineConfig } from "islandjs";

export default defineConfig({
enableSpa: true,
});

Expected behavior

期望可以使用SPA 模式

System Info

macos

Additional context

No response

Validations

  • Read the docs
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.

建议将UnoCSS配置移动到项目内不进行继承

Describe the bug

在项目中使用 presetWind() 预设时会报错,因为需要做一些demo演示自己的demo中使用了unocss所以导致冲突

Reproduction

建立uno.config.js 并且使用预设 presetWind 或者 presetUno

Expected behavior

island 应该将 unocss 配置文件让用户自定义,而且island的配置应该提供为预设

System Info

Additional context

No response

Validations

  • Read the docs
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.

Can't use create-island cli

Describe the bug

When running any of the below commands, I get an error.

# npm
npx @islandjs/create-island@latest island-app
# yarn
yarn create @islandjs/island island-app
# pnpm
pnpm create @islandjs/island island-app

The error is:

node:internal/errors:478
    ErrorCaptureStackTrace(err);
    ^

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'minimist' imported from /Users/xxx/.npm/_npx/9556e6e012499b50/node_modules/@islandjs/create-island/dist/index.js
    at new NodeError (node:internal/errors:387:5)
    at packageResolve (node:internal/modules/esm/resolve:852:9)
    at moduleResolve (node:internal/modules/esm/resolve:901:20)
    at defaultResolve (node:internal/modules/esm/resolve:1115:11)
    at nextResolve (node:internal/modules/esm/loader:163:28)
    at ESMLoader.resolve (node:internal/modules/esm/loader:841:30)
    at ESMLoader.getModuleJob (node:internal/modules/esm/loader:424:18)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:76:40)
    at link (node:internal/modules/esm/module_job:75:36) {
  code: 'ERR_MODULE_NOT_FOUND'
}

I have installed the minimist package in the same directory but it continues to fail with the same error.

Reproduction

Run one of:

`# npm
npx @islandjs/create-island@latest island-app

yarn

yarn create @islandjs/island island-app

pnpm

pnpm create @islandjs/island island-app`

Expected behavior

The application will install.

System Info

System:
    OS: macOS 12.6
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
    Memory: 579.91 MB / 16.00 GB
    Shell: 5.1.8 - /usr/local/bin/bash
  Binaries:
    Node: 16.19.1 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 8.19.3 - /usr/local/bin/npm
  Browsers:
    Brave Browser: 109.1.47.186
    Chrome: 113.0.5672.92
    Safari: 16.1

Additional context

No response

Validations

  • Read the docs
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.

Init project failed

Describe the bug

according to getting started, using pnpm to init the island-app project, then start dev server using "pnpm run dev", terminal output Error [ERR_MODULE_NOT_FOUND]
it seems like it is a small bug that needs me to install unocss as devDependencies additionally

Reproduction

  • Step1: mkdir island-app && cd island-app
  • Step2: npm init -y
  • Step3: pnpm add islandjs
  • Setp4: mkdir docs && echo '# Hello World' > docs/index.md
  • Step5: add islan dev docs as dev-script in package.json
  • Step6: pnpm run dev
  • reproduce

Expected behavior

start the dev server according to the Getting Started Page without any additional behavior

System Info

System:
    OS: macOS 12.4
    CPU: (8) x64 Apple M1
    Memory: 18.11 MB / 16.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 16.4.0 - ~/.nvm/versions/node/v16.4.0/bin/node
    Yarn: 1.22.10 - ~/.nvm/versions/node/v14.6.0/bin/yarn
    npm: 7.18.1 - ~/.nvm/versions/node/v16.4.0/bin/npm
  Browsers:
    Chrome: 105.0.5195.125
    Firefox: 104.0.2
    Safari: 15.5
  npmPackages:
    islandjs: ^0.2.6 => 0.2.6

Additional context

No response

Validations

  • Read the docs
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.

feat: Topics need to be synchronized across multiple processes

Is your feature request related to a problem? Please describe.

When I open two island websites in one browser at the same time, I click on one to change the theme and hope the other also changes at the same time

Describe the solution you'd like

listen storage

Describe alternatives you've considered

No response

Additional context

No response

Validations

  • Read the docs.
  • Read the Contributing Guidelines.
  • Check that there isn't already an issue that asks for the same feature to avoid creating a duplicate.

base属性

Describe the bug

设置base属性后,文档中使用的图片没有添加base路径,导致图片路径404

Reproduction

import { defineConfig } from 'islandjs';

export default defineConfig({
base: '/bar/'
});

Expected behavior

设置base属性后,文档中使用的图片打包后自动添加base前缀

System Info

macos

Additional context

No response

Validations

  • Read the docs
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.

feat: responsive layout

Is your feature request related to a problem? Please describe.

Now the default theme doesn't support responsive layout, which is necessary for mobile scene.

Describe the solution you'd like

There are following parts should be finished:

  • Mini navbar. For example:
    image

  • Mini sidebar: For example:

image

  • The sticky menu bar. For example:

image

Describe alternatives you've considered

No response

Additional context

No response

Validations

  • Read the docs.
  • Read the Contributing Guidelines.
  • Check that there isn't already an issue that asks for the same feature to avoid creating a duplicate.

Cli command params support

Is your feature request related to a problem? Please describe.

Currently, Island.js has a cli but it doesn't support inline params, such as island dev docs --port=8080.

Describe the solution you'd like

Support cli inline params and pass on the params to Vite.

Describe alternatives you've considered

No response

Additional context

No response

Validations

  • Read the docs.
  • Read the Contributing Guidelines.
  • Check that there isn't already an issue that asks for the same feature to avoid creating a duplicate.

docs: translation mistakes

Describe the bug

image
image

The word powerful and 轻量 is not corresponding.

Reproduction

None

Expected behavior

None

System Info

None

Additional context

No response

Validations

  • Read the docs
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.

feat: support full text search

Is your feature request related to a problem? Please describe.

It's neccessary to implement search function for a doc site.But now Island.js doesn't support it.

Describe the solution you'd like

Taking performance and ease of usage into account, i want to support full text search in client runtime that means no extra network request and server dependencies.So it's so different from VitePress which strongly depends on Algolia, with APIKey and index config for server.

In my point, flexsearch seems to be a good choice to help implement the requirement.So i decide to add search function in theme default based on it.There are following things need to to:

  • UI: search button、suggestion list
  • Interaction Status: not found status, loading status, initial status and success search status.
  • Search Logic: Init PageSearcher, add page index, match query, parse header and content as well as filtering out the highlight keyword.

Describe alternatives you've considered

No response

Additional context

No response

Validations

  • Read the docs.
  • Read the Contributing Guidelines.
  • Check that there isn't already an issue that asks for the same feature to avoid creating a duplicate.

feat: support custom container

Is your feature request related to a problem? Please describe.

For a richer documentation experience, I think custom containers should be supported. It supports the user to write four types, eg:

  1. :::tip
  2. :::info
  3. :::danger
  4. :::warning

If it is a type other than this, then the type of tip will be used to display the bottom line

Describe the solution you'd like

No response

Describe alternatives you've considered

No response

Additional context

No response

Validations

  • Read the docs.
  • Read the Contributing Guidelines.
  • Check that there isn't already an issue that asks for the same feature to avoid creating a duplicate.

加上base属性后,页脚跳转没有携带base参数导致404

Describe the bug

加上base属性后,页脚跳转没有携带base参数导致404

Reproduction

加上base属性后,页脚跳转没有携带base参数导致404

Expected behavior

加上base属性后,页脚跳转携带base参数

System Info

macos

Additional context

No response

Validations

  • Read the docs
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.

When I download the package, it throws a `husky install` error

Describe the bug

➜ pnpm i 
 WARN  deprecated [email protected]: Renamed to rehype
Packages: +383
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Progress: resolved 424, reused 383, downloaded 0, added 0, done
node_modules/.pnpm/[email protected]/node_modules/islandjs: Running postinstall script, failed in 506ms
.../[email protected]/node_modules/islandjs postinstall$ husky install
│ husky - .git can't be found (see https://typicode.github.io/husky/#/?id=custom-directory)
└─ Failed in 506ms
 ELIFECYCLE  Command failed with exit code 1.

Maybe the script should write npx husky install like this? And I don't understand why I need to execute this command when installing dependencies.

Reproduction

  1. pnpm i

Expected behavior

Correct installation of dependencies

System Info

System:
    OS: macOS 12.6
    CPU: (8) arm64 Apple M1
    Memory: 145.73 MB / 8.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 16.14.2 - /usr/local/bin/node
    Yarn: 1.22.18 - /usr/local/bin/yarn
    npm: 8.19.2 - /usr/local/bin/npm
  Browsers:
    Chrome: 106.0.5249.91
    Safari: 16.0
  npmPackages:
    islandjs: ^0.2.6 => 0.2.6

Additional context

image

Validations

  • Read the docs
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.

初始化项目+outDir

Describe the bug

1.执行npx @islandjs/create-island@latest island-app失败
2.设置outDir没有生效
"islandjs": "^0.7.29"

Reproduction

1.npx @islandjs/create-island@latest island-app

2.import { defineConfig } from "islandjs";

export default defineConfig({
title: "my-site",
outDir: "build",
});

Expected behavior

1.执行npx @islandjs/create-island@latest island-app可以创建项目

2.设置outDir后生效

System Info

macos

Additional context

No response

Validations

  • Read the docs
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.

support last updated feature

Is your feature request related to a problem? Please describe.

Now, island.js does not support last updated show in md ,like this
image

Describe the solution you'd like

use 'git log' to get the last updated timestamp

Describe alternatives you've considered

No response

Additional context

Now:
image

Expect:
image

Validations

  • Read the docs.
  • Read the Contributing Guidelines.
  • Check that there isn't already an issue that asks for the same feature to avoid creating a duplicate.

E2e test needed in this project

Is your feature request related to a problem? Please describe.

Without e2e test case, we may dismiss some edge case and have some potential risk before publishing the package, e.g. #49

Describe the solution you'd like

The e2e test will base on Vitest and playwright, referenced vitepress implement. vuejs/vitepress#1012

Describe alternatives you've considered

No response

Additional context

No response

Validations

  • Read the docs.
  • Read the Contributing Guidelines.
  • Check that there isn't already an issue that asks for the same feature to avoid creating a duplicate.

yarn dev 启动 报错: Failed to resolve import "D:myCodeislanddocsindex.md" from "virtual:routes". Does the file exist?

Describe the bug

根据 文档 案例 操作过来 ,最后 yarn dev 启动失败

Reproduction

[plugin:vite:import-analysis] Failed to resolve import "D:myCodeislanddocsindex.md" from "virtual:routes". Does the file exist?
32 |  ;
33 |  import React from 'react';
34 |  const Route0 = lazyWithPreload(() => import('D:\myCode\island\docs\index.md'))
   |                                              ^
35 |  export const routes = [
36 |  { path: '/', element: React.createElement(Route0), filePath: 'D:\myCode\island\docs\index.md', preload: Route0.preload }
    at formatError (file:///D:/myCode/island/node_modules/islandjs/node_modules/vite/dist/node/chunks/dep-0fc8e132.js:35330:46)
    at TransformContext.error (file:///D:/myCode/island/node_modules/islandjs/node_modules/vite/dist/node/chunks/dep-0fc8e132.js:35326:19)
    at normalizeUrl (file:///D:/myCode/island/node_modules/islandjs/node_modules/vite/dist/node/chunks/dep-0fc8e132.js:40255:33)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async TransformContext.transform (file:///D:/myCode/island/node_modules/islandjs/node_modules/vite/dist/node/chunks/dep-0fc8e132.js:40389:47)
    at async Object.transform (file:///D:/myCode/island/node_modules/islandjs/node_modules/vite/dist/node/chunks/dep-0fc8e132.js:35579:30)
    at async loadAndTransform (file:///D:/myCode/island/node_modules/islandjs/node_modules/vite/dist/node/chunks

image

image

Expected behavior

希望能正常跑通 流程。

System Info

windows 系统

Additional context

No response

Validations

  • Read the docs
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.

Home page hmr doesn't work

Describe the bug

When i change the home page front matter, such as:

// index.md
---
pageType: 'home'

hero:
  text: Island
  ...
---

The change cannot be applied in home component unless i reload the page manually.

Reproduction

See details in above.

Expected behavior

When i change the markdown for homepage, the hmr will work normally.

System Info

-

Additional context

No response

Validations

  • Read the docs
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.

feat: more island injection strategies

Is your feature request related to a problem? Please describe.

Now island component can only hang on window object globally and it is difficult if we want to lazyload it.

In Astro, you can lazyload the island component by multi directives:

<ShowHideButton client:idle />
<HeavyImageCarousel client:visible />
<SidebarToggle client:media="(max-width: 50em)" />

So the key is that island component can be loaded dynamically.Then we can use requestIdleCallback, IntersectionObserver API or some custom logic to decide to load the component in proper time.

Describe the solution you'd like

In Island.js, we can implement above feature in these parts:

  • Expose more island config to user, such as __island="visible" | "idle" | "media".
  • Islands bundle build phase, we should hang the load function instead of component itself so that the component to can be loaded dynamically.
  • In client runtime, we should optimize the hydrate script.Base on the island config by user, we choose to load the island component and hydrate it in the proper time.

Describe alternatives you've considered

No response

Additional context

No response

Validations

  • Read the docs.
  • Read the Contributing Guidelines.
  • Check that there isn't already an issue that asks for the same feature to avoid creating a duplicate.

feat: more socialLinks

Is your feature request related to a problem? Please describe.

support more socialLinks config, like juejin, twitter, even qrcode, and svg you want

Describe the solution you'd like

more socialLinks supported

Describe alternatives you've considered

No response

Additional context

No response

Validations

  • Read the docs.
  • Read the Contributing Guidelines.
  • Check that there isn't already an issue that asks for the same feature to avoid creating a duplicate.

404 after clicking on the internal link in the official website document

Describe the bug

document url
image

The address in the documentation is . /islands-arch, so the jump fails. Do I need to change it to . /guide/islands-arch?
And I checked the code, in the remarkPluginNormalizeLink file node.url = path.join(base, url) is written like this, do I need to recognize the path where the file itself is located to splice, instead of using base directly?

I'm also confused about which is the correct way. ^^

Reproduction

  1. Click on the internal links in the document

Expected behavior

Correct page jumping

System Info

System:
    OS: macOS 12.6
    CPU: (8) x64 Intel(R) Core(TM) i5-1038NG7 CPU @ 2.00GHz
    Memory: 834.75 MB / 16.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 14.19.2 - ~/.nvm/versions/node/v14.19.2/bin/node
    Yarn: 1.22.10 - /usr/local/bin/yarn
    npm: 6.14.17 - ~/.nvm/versions/node/v14.19.2/bin/npm
    Watchman: 2021.06.07.00 - /usr/local/bin/watchman
  Browsers:
    Chrome: 105.0.5195.125
    Safari: 16.0

Additional context

No response

Validations

  • Read the docs
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.

feat: custom search suggestions

Is your feature request related to a problem? Please describe.

For search component, we can expose more params to make the search behavior more flexible. For example, we can add maxSuggestion to control the suggestion number for every search.

Describe the solution you'd like

See above.

Describe alternatives you've considered

No response

Additional context

No response

Validations

  • Read the docs.
  • Read the Contributing Guidelines.
  • Check that there isn't already an issue that asks for the same feature to avoid creating a duplicate.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.