-
Notifications
You must be signed in to change notification settings - Fork 0
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
Initial zui-docs-site #1
Conversation
.github/workflows/deploy.yaml
Outdated
cmd_params: | ||
--verbose | ||
--buffer-size=8192 | ||
--max-response-body-size 1000000000 | ||
--header="User-Agent:Mozilla/5.0" | ||
--header="Accept-Encoding:zstd,br,gzip,deflate" | ||
--exclude algolia.net | ||
--exclude www.googletagmanager.com | ||
--exclude https://support.virustotal.com/hc/en-us/articles/115002146769-Comments | ||
--exclude https://github.com/brimdata/brimcap# | ||
--exclude https://github.com/brimdata/build-suricata.*# | ||
--exclude https://github.com/brimdata/brimcap/wiki.*# |
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 link checker has some extra stuff compared to our link checker configs elsewhere, due to some fussy content we link to from the Zui docs.
- The
User-Agent
config was necessary because the link to the AWS Security Group page failed with an HTTP 403 unless hit with a browser-like User Agent - The exclusions to the GitHub URLs containing
#
anchors is due to a known limitation of Muffet (Failure linking to anchors on a GitHub page raviqqe/muffet#144) - The VirusTotal exclusion is because their page we link to seems to return an HTTP 403 even with the User Agent set
- The large
max-response-body-size
is so link checks to bulky video content will succeed
.github/workflows/deploy.yaml
Outdated
# - name: Trigger Algolia Crawler | ||
# run: | | ||
# curl -X POST -H "Content-Type: application/json" \ | ||
# --user "${{ secrets.ALGOLIA_CRAWLER_APP_ID }}:${{ secrets.ALGOLIA_CRAWLER_API_KEY }}" \ | ||
# "https://crawler.algolia.com/api/1/crawlers/${{ secrets.ALGOLIA_CRAWLER_ID }}/reindex" |
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 intentionally not trying to do any Algolia crawling yet because I don't want to pollute the index that powers the Search at zed.brimdata.io with hits on the draft content at zui.brimdata.io. That said, here's a summary of my take on the Algolia search across the two sites.
When I shared with the team my findings on the limitations of the Docusaurus multi-instance support, we reached consensus that we should instead take the simple approach of having wholly separate docs sites. As I started down this path, it had the ripple effect of my creating a separate repo, and I briefly thought I'd also need to pursue a separate Algolia search config. However, @mattnibs helpfully nudged me toward researching if we could extend the existing config. Indeed, a definite benefit of having a single Search tool across both sites is that it removes any burden on the user having to initiate their searches in the "correct" site, e.g., if a new user is unfamiliar with how the Zed project provides the query language in Zui, they may start at zui.brimdata.io but their searches for Zed language terms will offer them helpful pages in the Zed docs.
Based on my findings thus far, I think it should be possible to maintain one index. One very important step along this path was the discovery of the externalUrlRegex
setting in the Algolia settings of the Docusaurus config (thanks @nwt!), since this allows the Zed doc hits found when initiating Search from zui.brimdata.io get hyperlinked properly (try it!) Therefore, when this PR merges and we start crawling both sites, we'll need to make that same externalUrlRegex
change in zed-docs-site as well.
Beyond that, I see in our current Algolia crawler configs in their Editor where we would add elements to certain arrays to include the new site. If for some reason this doesn't work or isn't allowed due to some limitation of the free tier we're on, we could just pick that moment to start paying Algolia. We could certainly afford their charges of $1 per 1,000 requests/mo.
appId: "WZNIEWJ5O6", | ||
apiKey: "5b2387711eca356fb0d654336ae3f740", | ||
indexName: "zed-brimdata", | ||
externalUrlRegex: "zed\\.brimdata\\.io", |
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.
As mentioned above, this externalUrlRegex
setting is key. Before adding it, if I went to zui.brimdata.io and initiated a Search, hits to zed.brimdata.io docs content would get converted to relative URLs on hostname zui.brimdata.io and hence fail. @nwt helpfully found https://github.com/facebook/docusaurus/blob/v2.0.1/packages/docusaurus-theme-search-algolia/src/theme/SearchBar/index.tsx#L173-L189 that confirmed that this setting would leave those full URLs undisturbed. If we do end up going the route of using a single index across both sites as proposed in this PR, we'll need to make the equivalent config change on zed-docs-site so links work in the other direction as well.
const sidebars = { | ||
tutorialSidebar: [ | ||
{ type: 'autogenerated', dirName: '.' }, | ||
{ type: 'link', label: 'Zed Docs', href: 'https://zed.brimdata.io/docs' } |
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.
This addition enables the "Zed Docs" link in the left sidebar, which is one of my attempts to maintain linkage between the two docs sites. If folks are ok with this link, we'll want to make a similar change in zed-docs-site after this PR merges. I expect when @jameskerr proposes some design changes for the overall "front page" experience at zed.brimdata.io/zui.brimdata.io, we may end up with additional ways to link between the two, e.g., maybe something in the title bar.
This is the companion to build the content from brimdata/zui#2531 via Docusaurus and deploy to Netlify. It's effectively a parallel copy of what's in https://github.com/brimdata/zed-docs-site that currently does the same for https://zed.brimdata.io/ along with some additional commits from @jameskerr to make new Zui base images/page/layout at https://zui.brimdata.io/.
I've added some comments to draw reviewers' attention to key changes that have been made to support the new site.
Assuming this PR ends up being approved, here's a checklist of final things to do.
To-do before merging this PR:
init
branch indeploy.yaml
REF = zuifi-wiki
and uncomment theREF = main
inMakefile
externalUrlRegex
on zed-docs-site to"zui\\.brimdata\\.io"
To-do ASAP after we release Zui v1.0.0:
deploy.yaml
Part of brimdata/zui#2480