File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed
Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change 150150html_theme_options = {}
151151repository = "GenericMappingTools/pygmt"
152152repository_url = "https://github.com/GenericMappingTools/pygmt"
153- commit_link = f'<a href="{ repository_url } /commit/{ __commit__ } ">{ __commit__ [:8 ] } </a>'
153+ if __commit__ :
154+ commit_link = (
155+ f'<a href="{ repository_url } /commit/{ __commit__ } ">{ __commit__ [:8 ] } </a>'
156+ )
157+ else :
158+ commit_link = (
159+ f'<a href="{ repository_url } /releases/tag/{ __version__ } ">{ __version__ } </a>'
160+ )
154161html_context = {
155162 "menu_links" : [
156163 (
Original file line number Diff line number Diff line change 4747
4848# Get semantic version through setuptools-scm
4949__version__ = f'v{ get_distribution ("pygmt" ).version } ' # e.g. v0.1.2.dev3+g0ab3cd78
50- __commit__ = __version__ .split ("+g" )[- 1 ] # 0ab3cd78
50+ __commit__ = __version__ .split ("+g" )[- 1 ] if "+g" in __version__ else "" # 0ab3cd78
5151
5252# Start our global modern mode session
5353_begin ()
You can’t perform that action at this time.
0 commit comments