Skip to content
This repository was archived by the owner on Nov 6, 2025. It is now read-only.

Commit 2c8e7b5

Browse files
committed
Improved repository link to point to example
1 parent 1570524 commit 2c8e7b5

File tree

3 files changed

+7
-11
lines changed

3 files changed

+7
-11
lines changed

examples/__init__.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,16 @@
3030

3131
# Transform project configuration
3232
def transform(project: MkDocsConfig, config: MkDocsConfig):
33-
root = os.path.dirname(project.config_file_path)
34-
name = os.path.basename(root)
33+
base = os.path.dirname(project.config_file_path)
34+
name = os.path.basename(base)
35+
36+
# Determine path of examples relative to root
37+
root = os.path.dirname(config.config_file_path)
38+
path = os.path.relpath(base, root)
3539

3640
# Inherit settings for repository
3741
project.repo_name = config.repo_name
38-
project.repo_url = config.repo_url
42+
project.repo_url = f"{config.repo_url}/tree/master/{path}"
3943

4044
# Inherit settings for site URL and edit URI
4145
project.site_url = posixpath.join(config.site_url, name, "")

examples/cookie-consent/docs/README.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
---
2-
title: Overview
3-
---
4-
51
# Adding a cookie consent
62

73
This example shows how to add a [cookie consent]. [Click here] to bring

examples/custom-cookies/docs/README.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
---
2-
title: Overview
3-
---
4-
51
# Adding a custom cookie
62

73
This example shows how to add a [custom cookie] to the [cookie consent] and

0 commit comments

Comments
 (0)