Skip to content

Commit 7137344

Browse files
authored
docs: auto-generation edit link (#16213)
* docs: auto-generation edit link * docs: remove unsed edit_link * docs: fix wrong start with edit link
1 parent 4e9671f commit 7137344

359 files changed

Lines changed: 21 additions & 363 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/src/_data/sites/en.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,3 +107,11 @@ footer:
107107
actions:
108108
back_to_home: Back to homepage
109109
browse_docs: Browse the docs
110+
111+
#------------------------------------------------------------------------------
112+
# Edit link
113+
#------------------------------------------------------------------------------
114+
115+
edit_link:
116+
start_with: https://github.com/eslint/eslint/edit/main/docs/
117+
text: Edit this page

docs/src/_includes/layouts/doc.html

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,14 @@ <h1>{{ title }}</h1>
8181
</div>
8282

8383
<div class="docs-edit-link">
84-
<a href="{{ edit_link }}" class="c-btn c-btn--secondary">Edit this page</a>
84+
<a href="
85+
{% if edit_link %}
86+
{{ edit_link }}
87+
{% else %}
88+
{{ site.edit_link.start_with }}{{ page.inputPath }}
89+
{% endif %}
90+
"
91+
class="c-btn c-btn--secondary">{{ site.edit_link.text }}</a>
8592
</div>
8693
</main>
8794

docs/src/about/index.md

Lines changed: 0 additions & 1 deletion

docs/src/developer-guide/architecture/index.md

Lines changed: 0 additions & 1 deletion

docs/src/developer-guide/code-conventions.md

Lines changed: 0 additions & 1 deletion

docs/src/developer-guide/code-path-analysis.md

Lines changed: 0 additions & 1 deletion

docs/src/developer-guide/contributing/changes.md

Lines changed: 2 additions & 3 deletions

docs/src/developer-guide/contributing/index.md

Lines changed: 0 additions & 1 deletion

docs/src/developer-guide/contributing/new-rules.md

Lines changed: 0 additions & 1 deletion

docs/src/developer-guide/contributing/pull-requests.md

Lines changed: 0 additions & 1 deletion

0 commit comments

Comments
 (0)