Skip to content

Commit

Permalink
Add github link in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
minottic committed Jul 23, 2024
1 parent 125c9dd commit 8e00df1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 4 additions & 0 deletions .github/mkdocs/mkdocs.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
site_name: SciCatLive
docs_dir: ../../docs
repo_url: !!python/object/apply:os.path.join [
!ENV [GITHUB_SERVER_URL],
!ENV [GITHUB_REPOSITORY]
]
theme:
name: material
custom_dir: overrides
Expand Down
2 changes: 1 addition & 1 deletion .github/mkdocs/relative_to.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ def on_page_content(html, page, config, files):
resolved_path = Path(ospath.normpath(page_path / path))
if any(filter(lambda x: Path(x.src_uri.strip('README.md')) == resolved_path, docs)): # Exiting docs
continue
element['href'] = urljoin(f"{environ['BASE_URL']}/", ospath.normpath(page_path / element['href']))
element['href'] = urljoin(f"{config.repo_url}/blob/{environ.get('TAG', 'main')}/", ospath.normpath(page_path / element['href']))
return soup.prettify()
5 changes: 1 addition & 4 deletions .github/workflows/mkdocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,10 @@ jobs:
- name: Deploy documentation
run: |
if [[ "${{ github.ref_type }}" == "tag" ]]; then
TAG=${{ github.ref_name }}
export TAG=${{ github.ref_name }}
VERSION=$(echo ${TAG} | awk -F'.' '{print $1"."$2}')
fi
export BASE_URL=${BASE_URL}/${TAG:-main}
git fetch origin ${DOCS_BRANCH} --depth=1
mike deploy -F ${DOCS_CONFIG} \
--push --branch ${DOCS_BRANCH} \
Expand All @@ -48,6 +46,5 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GIT_COMMITTER_NAME: ci-bot
GIT_COMMITTER_EMAIL: [email protected]
BASE_URL: https://github.com/SciCatProject/scicatlive/blob
DOCS_BRANCH: gh-pages
DOCS_CONFIG: .github/mkdocs/mkdocs.yaml

0 comments on commit 8e00df1

Please sign in to comment.