Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix live preview #6013

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion hack/docker/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ IMAGE=${3:-ghcr.io/knative/knative-docs:latest}
set -x

docker pull ${IMAGE} --platform linux/amd64
docker run --rm -p "${PORT}:8000" -v "${SCRIPT_DIR}/../../:/site" ${IMAGE} serve --dirtyreload --dev-addr=0.0.0.0:8000
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing --dirtyreload will result in rebuilding the whole sites when you are making changes to .md files. That makes it really non-efficient. You can see the distinct time difference with --dirtyreload and without --dirtyreload.

According to the doc here:

This mode simply compares the modified time of the generated HTML and source markdown. If the markdown has changed since the HTML then the page is re-constructed. Otherwise, the page remains as is.

https://www.mkdocs.org/about/release-notes/#support-for-dirty-builds-990

I see the problem that when you are making changes to the file in /overrides, the pages will not be updated unless you manually re-run the ./hack/docker/run.sh. I would suggest you to find another solution to resolve this issue. @shivamgupta2020

docker run --rm -p "${PORT}:8000" -v "${SCRIPT_DIR}/../../:/site" ${IMAGE}

3 changes: 3 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ extra_css:
repo_url: https://github.com/knative/docs
edit_uri: edit/main/docs

watch:
- ./

theme:
name: material
logo: images/logo/rgb/knative-logo-rgb.png
Expand Down
Loading