Swift.org logo and link - #136
Open
heckj wants to merge 5 commits into
Open
Conversation
… mark The original approach targeted the Navigator sidebar's `.head-wrapper`, which swift-docc-render tears down and rebuilds once the navigator index data finishes loading, discarding whatever a script had inserted into the loading-skeleton version — so the logo never stuck around. The masthead's `.pre-title` has no such swap: it mounts once from data already known at page load, so the logo (appended there, between the sidebar toggle and the page title) stays visible regardless of the sidebar's own shown/hidden/drawer state. Also swaps the placeholder mark for the official currentColor icon from swiftlang/swift-org-website's assets/images/icon-swift.svg.
Member
Author
|
@davelester I took the diff you started with, and changed it up:
Screenshots:
The swift logo is a link to www.swift.org to provide a link to the project
|
Member
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.









Summary
custom-headertemplate hook..navigator .head-wrapperto mount (viaMutationObserver, since it's rendered client-side by swift-docc-render) and prepends the logo link to it.#version-switcherdiv for a future documentation-version switcher.See #138 for an alternate that's more invasive in DocC Render's output, but provides tighter customization than DocC currently allows.
And see #139 for an alternate the provides the link in a static header above the DocC Render content, following a bit closer to SPI's mantra of "don't touch anything DocC doesn't make available"