-
Notifications
You must be signed in to change notification settings - Fork 183
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
Update latest folder with one index.html includes the redirect links #1298
Conversation
The following pipelines have been queued for testing: |
The following pipelines have been queued for testing: |
LogDebug "Fetching the latest version. $latestVersion" | ||
# Prepare the index.html which can redirect to the latest GA whenever avaiable, otherwise point to latest preview. | ||
New-Item -Path $DocDir -Name "latest" -ItemType "directory" | ||
New-Item -Path "$($DocDir)/latest" -Name "index.html" -ItemType "file" -Value "<meta http-equiv=`"refresh`" content=`"0; URL=$($DocDest)/$($PkgName)/$($latestVersion)/index.html`" />" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are there any downsides to using the meta refresh tag in terms of SEO or anything like that?
https://www.weboptimizers.com.au/google-warning-meta-refresh/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we care about our search indexing for these pages so I'm not worried about that. The reason we are using meta refresh for redirecting is because that is the only way we could figure out how to do a redirect while using blob storage as a web host. Ideally we would use server redirects of some sort but we don't have that support in blob storage hosting. If you have other ideas that might work I'd be interested in other ideas.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@scbedd did you consider this option when you originally did started including the latest folder? Do you know of any potential issues based one your known usage of the latest folder?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think people will be linking directly to any /latest/<some subfolder>/blah.html
anywhere. Given that, I can't think of any situations that this breaks.
{ | ||
LogDebug "Uploading $($PkgName) to latest folder in $($DocDest)..." | ||
& $($AzCopy) cp "$($DocDir)/**" "$($DocDest)/$($PkgName)/latest$($SASKey)" --recursive=true --cache-control "max-age=300, must-revalidate" | ||
# Clean up existing folders, will remove this step once we have one or two release cycles. | ||
& $($AzCopy) rm "$($DocDest)/$($PkgName)/latest$($SASKey)" --recursive=true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should see if we can do this as a one-time step for everything in the blob storage to avoid needing to delete and also to ensure we are consistent with our existing published docs.
} | ||
LogDebug "Fetching the latest version. $latestVersion" | ||
# Prepare the index.html which can redirect to the latest GA whenever avaiable, otherwise point to latest preview. | ||
New-Item -Path $DocDir -Name "latest" -ItemType "directory" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably also guard these New-Item creations behind the same uploadlatest and latestVersion condition.
The following pipelines have been queued for testing: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes look good to me. Please Talk with @scbedd to make sure he doesn't know of any issues with this approach.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fairly confident that everyone linking to the latest
only links to the base index.html, so you should be fine here.
I was wrong! There definitely exist ones where this is not the case. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do link directly to some latest documents.
@scbedd where are those links coming from? |
The following pipelines have been queued for testing: |
Hello @azure-sdk! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
We currently do not support one generic link for latest GA version doc.
The PR is to update the index.html to redirect to the latest GA version, if no GA version, then redirect to latest preview.
The template has been updated.
https://azuresdkdocs.blob.core.windows.net/$web/java/azure-sdk-template/latest/index.html
https://azuresdkdocs.blob.core.windows.net/$web/python/azure-template/latest/index.html
https://azuresdkdocs.blob.core.windows.net/$web/dotnet/Azure.Template/latest/index.html
https://azuresdkdocs.blob.core.windows.net/$web/javascript/azure-template/latest/index.html