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

Conversation

shivamgupta2020
Copy link
Contributor

This PR resolve live preview that is currently not working properly.

@knative-prow knative-prow bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Jun 11, 2024
Copy link

knative-prow bot commented Jun 11, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: shivamgupta2020
Once this PR has been reviewed and has the lgtm label, please assign zainabhusain227 for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link

netlify bot commented Jun 11, 2024

Deploy Preview for knative ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 55f1ace
🔍 Latest deploy log https://app.netlify.com/sites/knative/deploys/6668bbc2465688000910d9b3
😎 Deploy Preview https://deploy-preview-6013--knative.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@shivamgupta2020
Copy link
Contributor Author

/cc @Cali0707

@knative-prow knative-prow bot requested a review from Cali0707 June 11, 2024 19:27
@Cali0707
Copy link
Member

/cc @Leo6Leo
Can you TAL when you have a chance?

@knative-prow knative-prow bot requested a review from Leo6Leo June 13, 2024 18:47
@Leo6Leo
Copy link
Member

Leo6Leo commented Jun 13, 2024

@shivamgupta2020 @Cali0707 Can you provide me with more context about this PR? Is it trying to solve these failures of github actions?

image

Without the changes in this PR, the compilation works fine on my sample app PR and locally. Not sure what is the issue with live preview. If clarification can be provided, that would be really appretiated.

@Cali0707
Copy link
Member

@Leo6Leo this is to fix the live preview reloading for all the pages, it seems like it currently does not work for pages in the blog directory

@shivamgupta2020
Copy link
Contributor Author

@Leo6Leo , currently the website doesn't reload when changes are made. We have to run ./hack/docker/run.sh or mkdocs serve each time to view changes. This PR fixes live preview reloading, so the website automatically reloads when changes are made.

Copy link
Member

@Leo6Leo Leo6Leo left a comment

Choose a reason for hiding this comment

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

Please see the comment. Nice catch! @shivamgupta2020

@@ -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

Copy link

This Pull Request is stale because it has been open for 90 days with
no activity. It will automatically close after 30 more days of
inactivity. Reopen with /reopen. Mark as fresh by adding the
comment /remove-lifecycle stale.

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants