feat: add github edit btn (#1822)

Co-authored-by: Sebastian Beltran <bjohansebas@gmail.com>
This commit is contained in:
shubham oulkar
2025-03-16 01:43:35 +05:30
committed by GitHub
parent 34a18e88c7
commit 26d0b1f301
8 changed files with 60 additions and 4 deletions

View File

@@ -2,4 +2,4 @@ source 'https://rubygems.org'
gem 'github-pages', group: :jekyll_plugins
gem 'webrick'
gem 'jekyll-github-metadata'

View File

@@ -273,6 +273,7 @@ PLATFORMS
DEPENDENCIES
github-pages
jekyll-github-metadata
webrick
BUNDLED WITH

View File

@@ -1,6 +1,8 @@
url: "https://expressjs.com"
baseurl: "/"
repository: expressjs/expressjs.com
# Site settings
defaults:
@@ -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
@@ -34,6 +37,3 @@ exclude:
- [uk/CHANGELOG.md]
- vendor/bundle
- node_modules/
github: [metadata]

View File

@@ -16,6 +16,14 @@
</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>

View File

@@ -16,6 +16,14 @@
</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>

View File

@@ -16,6 +16,14 @@
</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>

View File

@@ -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 %}

View File

@@ -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;
@@ -1381,6 +1400,10 @@ strong.eol {
display: block;
}
.hidden-light {
display: none;
}
blockquote {
margin-left: 0;
font-weight: 600;