Skip to content
This repository has been archived by the owner on Apr 23, 2024. It is now read-only.

Auto-reload for preview window #24

Open
krivahtoo opened this issue May 9, 2023 · 0 comments
Open

Auto-reload for preview window #24

krivahtoo opened this issue May 9, 2023 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@krivahtoo
Copy link
Collaborator

Problem

Currently, there is no auto-reload when the user generates the site, the user has to reload manually.

Solution

Auto-reload can be implemented using websocket which tiny-http supports (tiny-http/tiny-http#8).
This can be implemented with the following:

  • Injecting a reload script into index.html. This script will reload the page when it receives a reload message via websoket.
  • Initializing a websoket connection then watching the content.json file for changes, sending a reload message on change.

Additional context

https://github.com/tiny-http/tiny-http/blob/master/examples/websockets.rs

@krivahtoo krivahtoo added enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed labels May 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant