Closed andrewdmontgomery closed 1 month ago
@etoledom For GitHub Pages, why are we overwriting the index.html
with a simpler version that refreshes to the deeper path? Presuming we had a good reason for doing that, II have (hopefully) fixed the path in the refresh, so that it doesn't include the gravatar
base. It was refreshing to gravatar/gravatar/documentation/gravatar/index.html
instead of gravatar/documentation/gravatar/index.html
.
But I was curious.
@etoledom I added some context in the description.
I temporarily modify the rules to allow doc builds from the PR branch, just to be sure that everything is fine, and then I revert them before merging.
Ah nice. I see what you mean. That would allow me to push to github pages from my branch. Nice.
I think we'll still have to merge to trunk
to see if the SPI file works.
It's interesting that I remember seeing this in other .spi.yml files from other projects (or maybe I got confused)
You probably did. I just found this: https://swiftlang.github.io/swift-docc-plugin/documentation/swiftdoccplugin/generating-documentation-for-extended-types
It's available via swift package generate-documentation
. We're using xcodebuild docbuild
, though, due to swift package
not supporting UIKit/simulators.
I think we'll still have to merge to trunk to see if the SPI file works.
Ah yes, this for sure 👍 Seems like it should work this time!
Alright, the GitHub Pages changes work (the auto-redirects). 👍
I've reverted my change, and reset the rule for which branches can build (back to just trunk
).
I investigated the default index.html
files that are generated. The don't load anything. It looks like the baseURL
isn't getting set. So the JS resources that should be loading things cannot be found because they are looking for https://automattic.github.io/ instead of https://automattic.github.io/Gravatar-SDK-iOS:
(note: this is loading from local files)
<head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover"><link rel="icon" href="/favicon.ico"><link rel="mask-icon" href="/favicon.svg" color="#333333"><title>Documentation</title><script>var baseUrl = "/"</script><script defer="defer" src="/js/chunk-vendors.bdb7cbba.js"></script><script defer="defer" src="/js/index.2871ffbd.js"></script><link href="/css/index.ff036a9e.css" rel="stylesheet"></head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover">
<link rel="icon" href="/favicon.ico">
<link rel="mask-icon" href="/favicon.svg" color="#333333">
<title>Documentation</title>
<script>var baseUrl = "/"</script>
<script defer="defer" src="/js/chunk-vendors.bdb7cbba.js"></script>
<script defer="defer" src="/js/index.2871ffbd.js"></script>
<link href="/css/index.ff036a9e.css" rel="stylesheet">
<head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover"><link rel="icon" href="/favicon.ico"><link rel="mask-icon" href="/favicon.svg" color="#333333"><title>Documentation</title><script>var baseUrl = "/"</script><script defer="defer" src="/js/chunk-vendors.bdb7cbba.js"></script><script defer="defer" src="/js/index.2871ffbd.js"></script><link href="/css/index.ff036a9e.css" rel="stylesheet"></head>
For contracts, here's the header from the index.html
from with the documents/gravatar/
subdirectory:
<head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover"><link rel="icon" href="/Gravatar-SDK-iOS/gravatar/favicon.ico"><link rel="mask-icon" href="/Gravatar-SDK-iOS/gravatar/favicon.svg" color="#333333"><title>Gravatar | Documentation</title><script>var baseUrl = "/Gravatar-SDK-iOS/gravatar/"</script><script defer="defer" src="/Gravatar-SDK-iOS/gravatar/js/chunk-vendors.bdb7cbba.js"></script><script defer="defer" src="/Gravatar-SDK-iOS/gravatar/js/index.2871ffbd.js"></script><link href="/Gravatar-SDK-iOS/gravatar/css/index.ff036a9e.css" rel="stylesheet"><link rel="stylesheet" type="text/css" href="/Gravatar-SDK-iOS/gravatar/css/523.e9a069b0.css"><link rel="stylesheet" type="text/css" href="/Gravatar-SDK-iOS/gravatar/css/documentation-topic.b186e79f.css"><meta name="description" content="Gravatar iOS SDK"><meta property="og:locale" content="en-US"><meta property="og:site_name" content="Documentation"><meta property="og:type" content="website"><meta property="og:title" content="Gravatar | Documentation"><meta property="og:description" content="Gravatar iOS SDK"><meta property="og:url" content="https://automattic.github.io/Gravatar-SDK-iOS/gravatar/documentation/gravatar/"><meta property="og:image" content="https://automattic.github.io/Gravatar-SDK-iOS/gravatar/developer-og.jpg"><meta name="twitter:image" content="https://automattic.github.io/Gravatar-SDK-iOS/gravatar/developer-og-twitter.jpg"><meta name="twitter:card" content="summary_large_image"><meta name="twitter:description" content="Gravatar iOS SDK"><meta name="twitter:title" content="Gravatar | Documentation"><meta name="twitter:url" content="https://automattic.github.io/Gravatar-SDK-iOS/gravatar/documentation/gravatar/"></head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover">
<link rel="icon" href="/Gravatar-SDK-iOS/gravatar/favicon.ico">
<link rel="mask-icon" href="/Gravatar-SDK-iOS/gravatar/favicon.svg" color="#333333">
<title>Gravatar | Documentation</title>
<script>var baseUrl = "/Gravatar-SDK-iOS/gravatar/"</script>
<script defer="defer" src="/Gravatar-SDK-iOS/gravatar/js/chunk-vendors.bdb7cbba.js"></script>
<script defer="defer" src="/Gravatar-SDK-iOS/gravatar/js/index.2871ffbd.js"></script>
<link href="/Gravatar-SDK-iOS/gravatar/css/index.ff036a9e.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="/Gravatar-SDK-iOS/gravatar/css/523.e9a069b0.css">
<link rel="stylesheet" type="text/css" href="/Gravatar-SDK-iOS/gravatar/css/documentation-topic.b186e79f.css">
<meta name="description" content="Gravatar iOS SDK">
<meta property="og:locale" content="en-US">
<meta property="og:site_name" content="Documentation">
<meta property="og:type" content="website">
<meta property="og:title" content="Gravatar | Documentation">
<meta property="og:description" content="Gravatar iOS SDK">
<meta property="og:url" content="https://automattic.github.io/Gravatar-SDK-iOS/gravatar/documentation/gravatar/">
<meta property="og:image" content="https://automattic.github.io/Gravatar-SDK-iOS/gravatar/developer-og.jpg">
<meta name="twitter:image" content="https://automattic.github.io/Gravatar-SDK-iOS/gravatar/developer-og-twitter.jpg">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:description" content="Gravatar iOS SDK">
<meta name="twitter:title" content="Gravatar | Documentation">
<meta name="twitter:url" content="https://automattic.github.io/Gravatar-SDK-iOS/gravatar/documentation/gravatar/">
<head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover"><link rel="icon" href="/Gravatar-SDK-iOS/gravatar/favicon.ico"><link rel="mask-icon" href="/Gravatar-SDK-iOS/gravatar/favicon.svg" color="#333333"><title>Gravatar | Documentation</title><script>var baseUrl = "/Gravatar-SDK-iOS/gravatar/"</script><script defer="defer" src="/Gravatar-SDK-iOS/gravatar/js/chunk-vendors.bdb7cbba.js"></script><script defer="defer" src="/Gravatar-SDK-iOS/gravatar/js/index.2871ffbd.js"></script><link href="/Gravatar-SDK-iOS/gravatar/css/index.ff036a9e.css" rel="stylesheet"><link rel="stylesheet" type="text/css" href="/Gravatar-SDK-iOS/gravatar/css/523.e9a069b0.css"><link rel="stylesheet" type="text/css" href="/Gravatar-SDK-iOS/gravatar/css/documentation-topic.b186e79f.css"><meta name="description" content="Gravatar iOS SDK"><meta property="og:locale" content="en-US"><meta property="og:site_name" content="Documentation"><meta property="og:type" content="website"><meta property="og:title" content="Gravatar | Documentation"><meta property="og:description" content="Gravatar iOS SDK"><meta property="og:url" content="https://automattic.github.io/Gravatar-SDK-iOS/gravatar/documentation/gravatar/"><meta property="og:image" content="https://automattic.github.io/Gravatar-SDK-iOS/gravatar/developer-og.jpg"><meta name="twitter:image" content="https://automattic.github.io/Gravatar-SDK-iOS/gravatar/developer-og-twitter.jpg"><meta name="twitter:card" content="summary_large_image"><meta name="twitter:description" content="Gravatar iOS SDK"><meta name="twitter:title" content="Gravatar | Documentation"><meta name="twitter:url" content="https://automattic.github.io/Gravatar-SDK-iOS/gravatar/documentation/gravatar/"></head>
This kind of seems like a bug in the docc process-archive --hosting-base-path
option. But I dunno.
Anyway, the simple redirects work great.
I also simplified the build process a little:
Gravatar-Package
we can produce both .doccarchive
bundles in one build.index.html
This should save us an extra build of the Gravatar
module when building GravatarUI
.
I'm going to merge this, since the GitHub pages part is working. That way, in a few hours, we should see if we have fixed the SPI documentation.
Closes #332
Description
This does two things:
docc
command to Exit non-zeroindex.html
that we are writingAttempt to fix the Swift Package Index doc generation
Here we can see the
iOS/Swift 5.10
build that produces an error when attempting to build the documentation: https://swiftpackageindex.com/builds/F8582B6A-864E-40BE-B0C6-32ACE9076F7AAt first I got hung up on the
Error while generating docs: retryLimitExceeded
. But after looking more closely, I suspect that just means that the "retry limit" is set to "none", and so the error causes a build failure.I think the underlying problem is this:
The
docc convert
command doesn't support that option. So it is exiting immediately with an error code. This PR simply removes that custom option from the configuration.Fixes the refresh in the root
index.html
That second point doesn't affect the documentation generation at Swift Package Index. But it should allow us to visit the following URL's and have them appropriately refresh to the deeper
index.html
:Testing Steps
I'm not aware of a way to test these without merging into
trunk
.