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

Initial zui-docs-site #1

Merged
merged 16 commits into from
Mar 3, 2023
Merged

Initial zui-docs-site #1

merged 16 commits into from
Mar 3, 2023

Conversation

philrz
Copy link
Contributor

@philrz philrz commented Sep 15, 2022

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:

  • Drop the reference to the init branch in deploy.yaml
  • Drop the REF = zuifi-wiki and uncomment the REF = main in Makefile
  • Set externalUrlRegex on zed-docs-site to "zui\\.brimdata\\.io"

To-do ASAP after we release Zui v1.0.0:

  • Add a link in the left sidebar on zed-docs-site point to to zui-docs-site
  • Update any GitHub URLs referencing "brim" to "zui" when the repo is renamed (redirects will still work in the meantime)
  • Modify the Algolia crawler config to include zui.brimdata.io, manually trigger a crawl, and make sure search works as we expect across both sites
  • Uncomment the "Trigger Algolia Crawler" in deploy.yaml
  • Update the links in https://github.com/brimdata/zed/blob/main/service/core.go to point to the respective docs sites rather than GitHub URLs

Part of brimdata/zui#2480

@philrz philrz self-assigned this Sep 15, 2022
Comment on lines 41 to 52
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.*#
Copy link
Contributor Author

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.

  1. 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
  2. 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)
  3. The VirusTotal exclusion is because their page we link to seems to return an HTTP 403 even with the User Agent set
  4. The large max-response-body-size is so link checks to bulky video content will succeed

@github-actions github-actions bot temporarily deployed to production September 15, 2022 16:30 Inactive
Comment on lines 55 to 59
# - 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"
Copy link
Contributor Author

@philrz philrz Sep 15, 2022

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.

image

appId: "WZNIEWJ5O6",
apiKey: "5b2387711eca356fb0d654336ae3f740",
indexName: "zed-brimdata",
externalUrlRegex: "zed\\.brimdata\\.io",
Copy link
Contributor Author

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' }
Copy link
Contributor Author

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.

image

@philrz philrz changed the title Initial zui-docs-site Initial zui-docs-site (not for merge until Zui v1.0.0 is released!) Sep 15, 2022
@github-actions github-actions bot temporarily deployed to production November 7, 2022 18:55 Inactive
@github-actions github-actions bot temporarily deployed to production November 8, 2022 01:23 Inactive
@github-actions github-actions bot temporarily deployed to production November 18, 2022 16:50 Inactive
@github-actions github-actions bot temporarily deployed to production November 18, 2022 16:58 Inactive
@github-actions github-actions bot temporarily deployed to production February 10, 2023 01:09 Inactive
@github-actions github-actions bot temporarily deployed to production February 10, 2023 02:15 Inactive
@github-actions github-actions bot temporarily deployed to production February 10, 2023 02:33 Inactive
@philrz philrz marked this pull request as ready for review February 10, 2023 02:36
@github-actions github-actions bot temporarily deployed to production February 10, 2023 18:40 Inactive
@github-actions github-actions bot temporarily deployed to production February 10, 2023 19:38 Inactive
@github-actions github-actions bot temporarily deployed to production February 10, 2023 21:35 Inactive
@github-actions github-actions bot temporarily deployed to production February 11, 2023 00:24 Inactive
@github-actions github-actions bot temporarily deployed to production February 13, 2023 21:01 Inactive
@github-actions github-actions bot temporarily deployed to production March 1, 2023 21:00 Inactive
@philrz philrz merged commit 1a6e7a9 into main Mar 3, 2023
@philrz philrz deleted the init branch March 3, 2023 22:15
@philrz philrz changed the title Initial zui-docs-site (not for merge until Zui v1.0.0 is released!) Initial zui-docs-site Mar 3, 2023
@philrz philrz linked an issue Mar 6, 2023 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Zui-fy the Brim wiki
2 participants