Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 21, 2025

✅ Implementation Complete

All requirements from the issue have been successfully implemented following the mockup as closely as possible.

Changes Made

  • Fixed capitalization: "View as markdown" → "View as Markdown"
  • Reordered sidebar links to match mockup
  • Added "Contribute to the docs" link after "Edit this page"
  • Applied responsive design (hidden on mobile, visible on desktop)
  • Updated documentation to explain the new feature
  • Added build artifacts to .gitignore
  • Verified code formatting and syntax
  • Updated link to point to https://www.elastic.co/docs/contribute-docs/ and open in new window
  • Made contribution link a standard action item with blue documents icon

Files Modified

  1. src/Elastic.Markdown/Layout/_TableOfContents.cshtml

    • Fixed "View as markdown" to "View as Markdown"
    • Reordered links: View as Markdown → Report an issue → Edit this page → Contribute to the docs
    • Added new "Contribute to the docs" link with target="_blank" to open in new window
    • Link points to https://www.elastic.co/docs/contribute-docs/
    • Uses standard font size (text-sm) like other action links
    • Added blue documents icon with fill="currentColor" to match other icon colors
  2. docs/contribute/on-the-web.md

    • Updated tip box to reference the external contribution guide URL
  3. .gitignore

    • Added _static/ to prevent build artifacts from being committed

Link Order (Desktop View)

  1. View as Markdown (hidden on mobile)
  2. Report an issue
  3. Edit this page
  4. Contribute to the docs ← Opens https://www.elastic.co/docs/contribute-docs/ in new window (with blue documents icon)

Implementation Details

The new link:

  • Points to https://www.elastic.co/docs/contribute-docs/ (absolute URL)
  • Opens in a new window with target="_blank"
  • Uses standard text size (text-sm) like other action links
  • Includes blue documents icon with fill="currentColor" for visual consistency with other icons
  • Concise text: "Contribute to the docs" (starts with verb, mirrors section name)
  • Uses hidden lg:block classes for responsive behavior (hidden on mobile, visible on desktop)
  • Standard styling with no custom indentation

Code Quality

✅ Passes dotnet format --verify-no-changes
✅ Follows existing Razor template patterns
✅ Consistent with repository conventions
✅ Minimal, surgical changes only

The implementation is ready for review and testing in CI/CD.

Fixes #2056

Original prompt

This section details on the original issue you should resolve

<issue_title>Make contribution guidelines more prominent near the page links</issue_title>
<issue_description>The page links are concerned with our contribution model. It makes sense to add a link next to "Edit this page" linking to our "Contribute to the docs" section.

A mockup by @florent-leborgne:

Image

+CC @colleenmcginnis @leemthompo </issue_description>

<agent_instructions>Add the link following the mockup in the issue as closely as possible. This also means moving down the Edit this page link (currently is in the middle) when in wide enough resolutions. The learn how to contribute link should disappear when the viewport becomes smaller, similar to what happens to the View as markdown link.

And BTW, it should be "View as Markdown", with a capital M.

Also edit the contribute/on-the-web.md doc to explain the presence of the link. The preview will allow us to test the link as well.</agent_instructions>

Comments on the Issue (you are @copilot in this section)

Fixes #2056


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@theletterf
Copy link
Contributor

@copilot Forgot to mention. The new link should point to https://www.elastic.co/docs/contribute-docs/ and open in a new window.

Copilot AI changed the title [WIP] Add contribution guidelines link near page links Add "Learn how to contribute" link to sidebar and fix "View as Markdown" capitalization Oct 21, 2025
Copilot AI requested a review from theletterf October 21, 2025 08:12
Copilot finished work on behalf of theletterf October 21, 2025 08:12
Copy link
Contributor Author

Copilot AI commented Oct 21, 2025

@copilot Forgot to mention. The new link should point to https://www.elastic.co/docs/contribute-docs/ and open in a new window.

Done! Updated the link to point to https://www.elastic.co/docs/contribute-docs/ and added target="_blank" to open in a new window (commit: TBD - will be in next push).

Copilot finished work on behalf of theletterf October 21, 2025 08:22
@github-actions
Copy link

github-actions bot commented Oct 21, 2025

🔍 Preview links for changed docs

@leemthompo
Copy link
Contributor

🚀 looking good…all we're missing now is an icon

@theletterf
Copy link
Contributor

@copilot Look at the result:

Screenshot 2025-10-21 at 10 34 33

Could the new link be a tad smaller and aligned so that it starts when the text of Edit this page start? Without an icon.

Copy link
Contributor Author

Copilot AI commented Oct 21, 2025

@copilot Look at the result:

Screenshot 2025-10-21 at 10 34 33

...

Done! Made the link smaller (text-xs) and added left padding (pl-6) to align the text with where "Edit this page" text starts. The link now appears without an icon, as requested (commit: will update with hash after push).

Copilot finished work on behalf of theletterf October 21, 2025 08:42
@theletterf
Copy link
Contributor

@copilot I still want the new text to be indented as if there was an icon, without adding an icon.

@reakaleek
Copy link
Member

Adding a new item here has some implications for the responsive design.

Related change: #1399

@theletterf
Copy link
Contributor

@reakaleek Yep! Try it out, I asked Copilot explicitly to hide the new item when the viewport is not wide enough.

Copy link
Contributor Author

Copilot AI commented Oct 21, 2025

@copilot I still want the new text to be indented as if there was an icon, without adding an icon.

Fixed! Moved the pl-6 padding from the <a> tag to the <li> element. This properly indents the entire link so the text starts where "Edit this page" text starts (as if there was an icon), without actually adding an icon (commit: will update with hash).

@leemthompo
Copy link
Contributor

leemthompo commented Oct 21, 2025

  • Looks better, but icon is black, and kinda looks like copy/paste icon
Screenshot 2025-10-21 at 12 48 41
  • Text feels a bit long.
    Contribute to docs is concise, starts with verb and mirrors actual section name.

@theletterf
Copy link
Contributor

@copilot Great! Two more changes:

  1. Make the icon the same color as the other icons.
  2. Shorten the text to "Contribute to the docs"

Copy link
Contributor Author

Copilot AI commented Oct 21, 2025

@copilot Great! Two more changes:

  1. Make the icon the same color as the other icons.
    ...

Done! Made both changes:

  1. Added fill="currentColor" to the icon path to match the blue color of other icons
  2. Shortened text from "Learn how to contribute" to "Contribute to the docs"

Commit hash will be updated after push.

Copilot AI changed the title Add "Learn how to contribute" link to sidebar and fix "View as Markdown" capitalization Add "Contribute to the docs" link to sidebar and fix "View as Markdown" capitalization Oct 21, 2025
Copilot finished work on behalf of theletterf October 21, 2025 12:37
@theletterf
Copy link
Contributor

theletterf commented Oct 21, 2025

@leemthompo Looks neat now!

Screenshot 2025-10-21 at 15 01 54

@theletterf theletterf marked this pull request as ready for review October 21, 2025 13:01
@theletterf theletterf requested review from a team as code owners October 21, 2025 13:01
@theletterf theletterf requested a review from cotti October 21, 2025 13:01
Copy link
Contributor

@leemthompo leemthompo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Output LGTM 👍

@colleenmcginnis
Copy link
Contributor

Hmmm... as a reader I might think that "Edit this page" is the way to contribute to the docs so then "Contribute to the docs" seems redundant. Thoughts on adjusting it to be more like @florent-leborgne's suggestion in the Slack thread?

image

@leemthompo
Copy link
Contributor

as a reader I might think that "Edit this page" is the way to contribute to the docs so then "Contribute to the docs" seems redundant

I agree it's not perfect, but once you click the difference is pretty clear. I found that the first draft made it look like a tacked-on afterthought.

@colleenmcginnis would saying "Learn how to contribute" (per #2082 (comment)) assuage this concern?

If we could afford the time to make it (a) clean but also (b) visually distinct from the other 3, that would be ideal of course.

@leemthompo
Copy link
Contributor

Although I guess another approach here would be to link to the syntax guide instead. That's probably what the majority of folks would want if they actually are seeking to edit the page 🤔.

@colleenmcginnis
Copy link
Contributor

If we could afford the time

Is there a deadline we need to meet?

Although I guess another approach here would be to link to the syntax guide instead. That's probably what the majority of folks would want if they actually are seeking to edit the page 🤔.

That makes more sense right now since the only detailed docs in Contribute to the docs are about API docs (and this link will only appear on non-API pages), but (hopefully soon) when there's more complete information in Contribute to the docs it probably would make sense to send users there (not just the syntax guide). I guess it just depends on if you want to come back and update it later. 🙂

@theletterf
Copy link
Contributor

I enjoy this dialectical back and forth — it's for the greater good. :-D

Current status:

Screenshot 2025-10-21 at 17 26 42

The link goes to the V3 docs: https://docs-v3-preview.elastic.dev/elastic/docs-builder/tree/main/contribute/

We can roll it out now and then change it later once those docs are ported over by the team.

@theletterf theletterf requested a review from leemthompo October 21, 2025 15:28
@leemthompo
Copy link
Contributor

I think it's great to finally make this link super visible on every docs page, we didn't have a great way of surfacing the contribution/syntax guides before this. So I'm happy to merge this latest iteration + the re-rewording to make it clear this links to "Learning" stuff.

We could iterate on the UX in the future if we deem the fourth item visually confusing. I've already approved, I'll let anyone feeling strongly against this request changes at this point.

@theletterf theletterf merged commit c08a2a4 into main Oct 21, 2025
30 of 31 checks passed
@theletterf theletterf deleted the copilot/add-contribution-guidelines-link branch October 21, 2025 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make contribution guidelines more prominent near the page links

5 participants