Skip to content

Commit

Permalink
Improved repository link to point to example
Browse files Browse the repository at this point in the history
  • Loading branch information
squidfunk committed Sep 20, 2023
1 parent 1570524 commit 2c8e7b5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
10 changes: 7 additions & 3 deletions examples/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,16 @@

# Transform project configuration
def transform(project: MkDocsConfig, config: MkDocsConfig):
root = os.path.dirname(project.config_file_path)
name = os.path.basename(root)
base = os.path.dirname(project.config_file_path)
name = os.path.basename(base)

# Determine path of examples relative to root
root = os.path.dirname(config.config_file_path)
path = os.path.relpath(base, root)

# Inherit settings for repository
project.repo_name = config.repo_name
project.repo_url = config.repo_url
project.repo_url = f"{config.repo_url}/tree/master/{path}"

# Inherit settings for site URL and edit URI
project.site_url = posixpath.join(config.site_url, name, "")
Expand Down
4 changes: 0 additions & 4 deletions examples/cookie-consent/docs/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
---
title: Overview
---

# Adding a cookie consent

This example shows how to add a [cookie consent]. [Click here] to bring
Expand Down
4 changes: 0 additions & 4 deletions examples/custom-cookies/docs/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
---
title: Overview
---

# Adding a custom cookie

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

0 comments on commit 2c8e7b5

Please sign in to comment.