diff --git a/mkdocs_git_authors_plugin/git/author.py b/mkdocs_git_authors_plugin/git/author.py
index 0168e1b..e1e74da 100644
--- a/mkdocs_git_authors_plugin/git/author.py
+++ b/mkdocs_git_authors_plugin/git/author.py
@@ -61,7 +61,13 @@ class Author(AbstractRepoObject):
         total_lines = (
             self.page(path)["page"].total_lines() if path else self.repo().total_lines()
         )
-        result = lines / total_lines
+
+        # Some pages are empty, that case contribution is 0 by default
+        if total_lines == 0:
+            result = 0
+        else:
+            result = lines / total_lines
+
         if _type == float:
             return result
         else:
diff --git a/mkdocs_git_authors_plugin/git/page.py b/mkdocs_git_authors_plugin/git/page.py
index c69a0f0..11a298a 100644
--- a/mkdocs_git_authors_plugin/git/page.py
+++ b/mkdocs_git_authors_plugin/git/page.py
@@ -16,7 +16,7 @@ class Page(AbstractRepoObject):
 
     def __init__(self, repo: Repo, path: Path):
         """
-        Instantiante a Page object
+        Instantiate a Page object
 
         Args:
             repo: Reference to the global Repo instance
@@ -125,8 +125,14 @@ class Page(AbstractRepoObject):
         cmd = GitCommand("blame", ["--porcelain", str(self._path)])
         cmd.run()
 
+        lines = cmd.stdout()
+
+        # in case of empty, non-committed files, raise error
+        if len(lines) == 0:
+            raise GitCommandError
+
         commit_data = {}
-        for line in cmd.stdout():
+        for line in lines:
             key = line.split(" ")[0]
             m = re_sha.match(key)
             if m:

ZeroDivisionError
I'm starting a new mkdocs project and build is failing because of this line:

https://github.com/timvink/mkdocs-git-authors-plugin/blob/bee54c4ea89fc447ae2f4973cd28327617e35c6c/mkdocs_git_authors_plugin/git/author.py#L64

I still do not know why it's failing, so I put the full trace below and here is my mkdocs.yml:

```yml
# Project information
site_name: New project
site_description: Documentation
site_author: Guts

# advanced options
docs_dir: '.'
site_dir: '../build/mkdocs/site'

# Plugins
plugins:
  - awesome-pages
  - git-authors
  - git-revision-date-localized
  - minify:
      minify_html: true
  - search:
      lang: fr
      prebuild_index: python

# Theme
theme:
  name: 'material'
  feature:
    tabs: true
  font: false
  language: 'fr'
  palette:
    primary: 'blue-grey'
    accent: 'deep-orange'

# Customization
extra:
  manifest: 'manifest.webmanifest'
  version: 1.0

# Extensions to enhance markdown - see: https://squidfunk.github.io/mkdocs-material/getting-started/#extensions
markdown_extensions:
  - admonition  # https://squidfunk.github.io/mkdocs-material/extensions/admonition/
  - codehilite: # https://squidfunk.github.io/mkdocs-material/extensions/codehilite/
      linenums: true
  - meta        # https://squidfunk.github.io/mkdocs-material/extensions/metadata/
  - toc:
      permalink: true # https://squidfunk.github.io/mkdocs-material/extensions/permalinks/

# Navigation - Menu organization
nav:
  - Accueil: index.md
  - Installation:
    - installation/requirements.md
    - installation/install.md
    - installation/configuration.md
  - Usage:
    - usage/main.md
    - usage/subcommands.md
    - usage/version.md
    - usage/check.md
    - usage/listing.md
    - usage/sign.md
    - usage/lookup.md
    - usage/sync.md
    - usage/clean.md
  - Automatiser:
    - schedule/scheduling_windows.md
```

## Trace

```python
ERROR   -  Error building page 'index.md': division by zero 
Traceback (most recent call last):
  File "C:\Users\uzeur\AppData\Local\Programs\Python\Python36\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "C:\Users\uzeur\AppData\Local\Programs\Python\Python36\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "D:\uzeur\Documents\GitHub\Isogeo\scan-offline\.venv\Scripts\mkdocs.exe\__main__.py", line 7, in <module>
  File "d:\uzeur\documents\github\isogeo\scan-offline\.venv\lib\site-packages\click\core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "d:\uzeur\documents\github\isogeo\scan-offline\.venv\lib\site-packages\click\core.py", line 782, in main
    rv = self.invoke(ctx)
  File "d:\uzeur\documents\github\isogeo\scan-offline\.venv\lib\site-packages\click\core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "d:\uzeur\documents\github\isogeo\scan-offline\.venv\lib\site-packages\click\core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "d:\uzeur\documents\github\isogeo\scan-offline\.venv\lib\site-packages\click\core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "d:\uzeur\documents\github\isogeo\scan-offline\.venv\lib\site-packages\mkdocs\__main__.py", line 143, in serve_command     
    **kwargs
  File "d:\uzeur\documents\github\isogeo\scan-offline\.venv\lib\site-packages\mkdocs\commands\serve.py", line 141, in serve       
    config = builder()
  File "d:\uzeur\documents\github\isogeo\scan-offline\.venv\lib\site-packages\mkdocs\commands\serve.py", line 136, in builder     
    build(config, live_server=live_server, dirty=dirty)
  File "d:\uzeur\documents\github\isogeo\scan-offline\.venv\lib\site-packages\mkdocs\commands\build.py", line 295, in build       
    _build_page(file.page, config, files, nav, env, dirty)
  File "d:\uzeur\documents\github\isogeo\scan-offline\.venv\lib\site-packages\mkdocs\commands\build.py", line 209, in _build_page 
    'page_context', context, page=page, config=config, nav=nav
  File "d:\uzeur\documents\github\isogeo\scan-offline\.venv\lib\site-packages\mkdocs\plugins.py", line 94, in run_event
    result = method(item, **kwargs)
  File "d:\uzeur\documents\github\isogeo\scan-offline\.venv\lib\site-packages\mkdocs_git_authors_plugin\plugin.py", line 183, in on_page_context
    "site_authors": util.page_authors(self.repo().get_authors(), path),
  File "d:\uzeur\documents\github\isogeo\scan-offline\.venv\lib\site-packages\mkdocs_git_authors_plugin\util.py", line 134, in page_authors
    for author in authors
  File "d:\uzeur\documents\github\isogeo\scan-offline\.venv\lib\site-packages\mkdocs_git_authors_plugin\util.py", line 134, in <listcomp>
    for author in authors
  File "d:\uzeur\documents\github\isogeo\scan-offline\.venv\lib\site-packages\mkdocs_git_authors_plugin\git\author.py", line 64, in contribution
    result = lines / total_lines
ZeroDivisionError: division by zero
```
diff --git a/tests/basic_setup/docs/empty_page.md b/tests/basic_setup/docs/empty_page.md
new file mode 100644
index 0000000..e69de29
diff --git a/tests/basic_setup/mkdocs_w_contribution.yml b/tests/basic_setup/mkdocs_w_contribution.yml
new file mode 100644
index 0000000..284ae58
--- /dev/null
+++ b/tests/basic_setup/mkdocs_w_contribution.yml
@@ -0,0 +1,9 @@
+site_name: test gitauthors_plugin
+use_directory_urls: true
+
+plugins:
+    - search
+    - git-authors:
+        count_empty_lines: false
+        show_contribution: true
+        show_line_count: true
\ No newline at end of file
diff --git a/tests/test_basic.py b/tests/test_basic.py
index b1b6613..f53bdb6 100644
--- a/tests/test_basic.py
+++ b/tests/test_basic.py
@@ -1,6 +1,27 @@
+"""
+Note that pytest offers a `tmp_path`. 
+You can reproduce locally with
+
+```python
+%load_ext autoreload
+%autoreload 2
+import os
+import tempfile
+import shutil
+from pathlib import Path
+tmp_path = Path(tempfile.gettempdir()) / 'pytest-retrieve-authors'
+if os.path.exists(tmp_path):
+    shutil.rmtree(tmp_path)
+os.mkdir(tmp_path)
+```
+"""
+
 import re
+import shutil
+import os
 from click.testing import CliRunner
 from mkdocs.__main__ import build_command
+import git as gitpython
 
 
 def build_docs_setup(mkdocs_path, output_path):
@@ -13,10 +34,46 @@ def build_docs_setup(mkdocs_path, output_path):
 def test_basic_working(tmp_path):
 
     result = build_docs_setup("tests/basic_setup/mkdocs.yml", tmp_path)
-    assert result.exit_code == 0, "'mkdocs build' command failed"
+    assert result.exit_code == 0, (
+        "'mkdocs build' command failed. Error: %s" % result.stdout
+    )
 
     index_file = tmp_path / "index.html"
     assert index_file.exists(), "%s does not exist" % index_file
 
     contents = index_file.read_text()
     assert re.search("<span class='git-page-authors", contents)
+
+
+def test_project_with_no_commits(tmp_path):
+    """
+    Structure:
+    
+    tmp_path/testproject
+    website/
+        ├── docs/
+        └── mkdocs.yml"""
+    testproject_path = tmp_path / "testproject"
+
+    shutil.copytree(
+        "tests/basic_setup/docs", str(testproject_path / "website" / "docs")
+    )
+    shutil.copyfile(
+        "tests/basic_setup/mkdocs_w_contribution.yml",
+        str(testproject_path / "website" / "mkdocs.yml"),
+    )
+
+    cwd = os.getcwd()
+    os.chdir(str(testproject_path))
+
+    # run 'git init'
+    gitpython.Repo.init(testproject_path, bare=False)
+
+    result = build_docs_setup(
+        str(testproject_path / "website/mkdocs.yml"), str(testproject_path / "site")
+    )
+    assert result.exit_code == 0, (
+        "'mkdocs build' command failed. Error: %s" % result.stdout
+    )
+
+    os.chdir(cwd)

pip install -e .
parse_log_pytest
requirements.txt
pytest pytest-cov codecov
3.9
tests/test_requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
babel==2.17.0
backrefs==5.8
certifi==2025.1.31
charset-normalizer==3.4.1
click==8.1.8
codecov==2.1.13
colorama==0.4.6
coverage==7.8.0
exceptiongroup==1.2.2
ghp-import==2.1.0
gitdb==4.0.12
GitPython==3.1.44
idna==3.10
importlib_metadata==8.6.1
iniconfig==2.1.0
Jinja2==3.1.6
Markdown==3.7
MarkupSafe==3.0.2
mergedeep==1.3.4
mkdocs==1.6.1
mkdocs-get-deps==0.2.0
-e git+https://github.com/timvink/mkdocs-git-authors-plugin.git@bee54c4ea89fc447ae2f4973cd28327617e35c6c#egg=mkdocs_git_authors_plugin
mkdocs-git-revision-date-localized-plugin==1.4.5
mkdocs-material==9.6.10
mkdocs-material-extensions==1.3.1
packaging==24.2
paginate==0.5.7
pathspec==0.12.1
platformdirs==4.3.7
pluggy==1.5.0
Pygments==2.19.1
pymdown-extensions==10.14.3
pytest==8.3.5
pytest-cov==6.0.0
python-dateutil==2.9.0.post0
pytz==2025.2
PyYAML==6.0.2
pyyaml_env_tag==0.1
requests==2.32.3
six==1.17.0
smmap==5.0.2
tomli==2.2.1
urllib3==2.3.0
watchdog==6.0.0
zipp==3.21.0

name: mkdocs-git-authors-plugin
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=3.0.16=h5eee18b_0
  - pip=25.0=py39h06a4308_0
  - python=3.9.21=he870216_1
  - readline=8.2=h5eee18b_0
  - setuptools=75.8.0=py39h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - tzdata=2025a=h04d1e81_0
  - wheel=0.45.1=py39h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - babel==2.17.0
      - backrefs==5.8
      - certifi==2025.1.31
      - charset-normalizer==3.4.1
      - click==8.1.8
      - codecov==2.1.13
      - colorama==0.4.6
      - coverage==7.8.0
      - exceptiongroup==1.2.2
      - ghp-import==2.1.0
      - gitdb==4.0.12
      - gitpython==3.1.44
      - idna==3.10
      - importlib-metadata==8.6.1
      - iniconfig==2.1.0
      - jinja2==3.1.6
      - markdown==3.7
      - markupsafe==3.0.2
      - mergedeep==1.3.4
      - mkdocs==1.6.1
      - mkdocs-get-deps==0.2.0
      - mkdocs-git-revision-date-localized-plugin==1.4.5
      - mkdocs-material==9.6.10
      - mkdocs-material-extensions==1.3.1
      - packaging==24.2
      - paginate==0.5.7
      - pathspec==0.12.1
      - platformdirs==4.3.7
      - pluggy==1.5.0
      - pygments==2.19.1
      - pymdown-extensions==10.14.3
      - pytest==8.3.5
      - pytest-cov==6.0.0
      - python-dateutil==2.9.0.post0
      - pytz==2025.2
      - pyyaml==6.0.2
      - pyyaml-env-tag==0.1
      - requests==2.32.3
      - six==1.17.0
      - smmap==5.0.2
      - tomli==2.2.1
      - urllib3==2.3.0
      - watchdog==6.0.0
      - zipp==3.21.0
prefix: /opt/conda/envs/mkdocs-git-authors-plugin

tests/test_basic.py::test_basic_working
tests/test_basic.py::test_project_with_no_commits
mkdocs_git_authors_plugin/git/author.py mkdocs_git_authors_plugin/git/page.py
mkdocs_git_authors_plugin/git/author.py mkdocs_git_authors_plugin/git/page.py