Skip to content

Feat:- Add GitHub edit btn #1822

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

Merged
merged 14 commits into from
Mar 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ source 'https://rubygems.org'

gem 'github-pages', group: :jekyll_plugins
gem 'webrick'

gem 'jekyll-github-metadata'
1 change: 1 addition & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ PLATFORMS

DEPENDENCIES
github-pages
jekyll-github-metadata
webrick

BUNDLED WITH
Expand Down
6 changes: 3 additions & 3 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
url: "https://expressjs.com"
baseurl: "/"

repository: expressjs/expressjs.com

# Site settings

defaults:
Expand All @@ -19,6 +21,7 @@ announcement: false # Enable or disable the announcements.

plugins:
- jekyll-redirect-from
- jekyll-github-metadata

highlighter: rouge
# library used for syntax highlighting
Expand All @@ -34,6 +37,3 @@ exclude:
- [uk/CHANGELOG.md]
- vendor/bundle
- node_modules/


github: [metadata]
8 changes: 8 additions & 0 deletions _layouts/3x-api.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@ <h3 id="sidebar-heading" class="toc-heading"><em>On this page</em></h3>
</nav>
<main>
{{ content }}
<a role="button" class="edit-github-btn" href="{{ site.github.repository_url }}/tree/gh-pages/_includes/{{page.menu}}/en/3x" aria-label="GitHub button">
<span class="hidden-dark">
{% include icons/github-light.svg %}
</span>
<span class="hidden-light">
{% include icons/github-dark.svg %}
</span>
Edit this page</a>
</main>
</div>

Expand Down
8 changes: 8 additions & 0 deletions _layouts/4x-api.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@ <h3 id="sidebar-heading" class="toc-heading"><em>On this page</em></h3>
</nav>
<main>
{{ content }}
<a role="button" class="edit-github-btn" href="{{ site.github.repository_url }}/tree/gh-pages/_includes/{{page.menu}}/en/4x" aria-label="GitHub button">
<span class="hidden-dark">
{% include icons/github-light.svg %}
</span>
<span class="hidden-light">
{% include icons/github-dark.svg %}
</span>
Edit this page</a>
</main>
</div>

Expand Down
8 changes: 8 additions & 0 deletions _layouts/5x-api.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@ <h3 id="sidebar-heading" class="toc-heading"><em>On this page</em></h3>
</nav>
<main>
{{ content }}
<a role="button" class="edit-github-btn" href="{{ site.github.repository_url }}/tree/gh-pages/_includes/{{page.menu}}/en/5x" aria-label="GitHub button">
<span class="hidden-dark">
{% include icons/github-light.svg %}
</span>
<span class="hidden-light">
{% include icons/github-dark.svg %}
</span>
Edit this page</a>
</main>
</div>

Expand Down
8 changes: 8 additions & 0 deletions _layouts/page.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@
<div class="content">
<main>
{{ content }}
<a role="button" class="edit-github-btn" href="{{ site.github.repository_url }}/edit/gh-pages/{{ page.path }}" aria-label="GitHub button">
<span class="hidden-dark">
{% include icons/github-light.svg %}
</span>
<span class="hidden-light">
{% include icons/github-dark.svg %}
</span>
Edit this page</a>
</main>
</div>
{% endif %}
Expand Down
23 changes: 23 additions & 0 deletions css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,25 @@ html[xmlns] .clearfix {
color: var(--box-fg);
}

a.edit-github-btn{
display: flex;
gap: 0.5rem;
align-items: center;
width: fit-content;
padding: 0.5rem;
border-radius: 0.3rem;

span {
height: 20px;
}

&:is(:hover, :active, :focus) {
color: var(--fg);
background-color: var(--hover-bg);
outline: 1px solid var(--card-fg);
}
}

#mobile-menu {
display: none;
position: relative;
Expand Down Expand Up @@ -1381,6 +1400,10 @@ strong.eol {
display: block;
}

.hidden-light {
display: none;
}

blockquote {
margin-left: 0;
font-weight: 600;
Expand Down