From fbf15057e0d4ed169e1b09b7979b56353f9d0a99 Mon Sep 17 00:00:00 2001
From: Brendan Golden <git@brendan.ie>
Date: Sat, 14 Sep 2024 21:26:19 +0100
Subject: [PATCH] feat: some small changes relating to making it look better

Relates to 	#23
---
 .gitattributes          |  1 +
 .githooks/post-checkout |  3 +++
 .githooks/post-commit   |  3 +++
 .githooks/post-merge    |  3 +++
 .githooks/pre-commit    |  4 ++++
 .githooks/pre-push      |  3 +++
 README.md               | 10 ++++++++++
 _git.tar.gz             |  3 +++
 flake.nix               |  4 +++-
 mkdocs.yml              | 27 +++++++++++++++++++++++++++
 10 files changed, 60 insertions(+), 1 deletion(-)
 create mode 100755 .githooks/post-checkout
 create mode 100755 .githooks/post-commit
 create mode 100755 .githooks/post-merge
 create mode 100755 .githooks/pre-commit
 create mode 100755 .githooks/pre-push
 create mode 100644 _git.tar.gz

diff --git a/.gitattributes b/.gitattributes
index ec60e32..8a32be0 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -39,6 +39,7 @@ eol=lf
 
 # Misc
 *.zip filter=lfs diff=lfs merge=lfs -text
+*.tar.gz filter=lfs diff=lfs merge=lfs -text
 
 
 # ET4011
diff --git a/.githooks/post-checkout b/.githooks/post-checkout
new file mode 100755
index 0000000..ca7fcb4
--- /dev/null
+++ b/.githooks/post-checkout
@@ -0,0 +1,3 @@
+#!/bin/sh
+command -v git-lfs >/dev/null 2>&1 || { echo >&2 "\nThis repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting the 'post-checkout' file in the hooks directory (set by 'core.hookspath'; usually '.git/hooks').\n"; exit 2; }
+git lfs post-checkout "$@"
diff --git a/.githooks/post-commit b/.githooks/post-commit
new file mode 100755
index 0000000..52b339c
--- /dev/null
+++ b/.githooks/post-commit
@@ -0,0 +1,3 @@
+#!/bin/sh
+command -v git-lfs >/dev/null 2>&1 || { echo >&2 "\nThis repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting the 'post-commit' file in the hooks directory (set by 'core.hookspath'; usually '.git/hooks').\n"; exit 2; }
+git lfs post-commit "$@"
diff --git a/.githooks/post-merge b/.githooks/post-merge
new file mode 100755
index 0000000..a912e66
--- /dev/null
+++ b/.githooks/post-merge
@@ -0,0 +1,3 @@
+#!/bin/sh
+command -v git-lfs >/dev/null 2>&1 || { echo >&2 "\nThis repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting the 'post-merge' file in the hooks directory (set by 'core.hookspath'; usually '.git/hooks').\n"; exit 2; }
+git lfs post-merge "$@"
diff --git a/.githooks/pre-commit b/.githooks/pre-commit
new file mode 100755
index 0000000..99c93f8
--- /dev/null
+++ b/.githooks/pre-commit
@@ -0,0 +1,4 @@
+#!/usr/bin/env bash
+
+tar czf _git.tar.gz --exclude .git/lfs .git
+git add _git.tar.gz
diff --git a/.githooks/pre-push b/.githooks/pre-push
new file mode 100755
index 0000000..0f0089b
--- /dev/null
+++ b/.githooks/pre-push
@@ -0,0 +1,3 @@
+#!/bin/sh
+command -v git-lfs >/dev/null 2>&1 || { echo >&2 "\nThis repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting the 'pre-push' file in the hooks directory (set by 'core.hookspath'; usually '.git/hooks').\n"; exit 2; }
+git lfs pre-push "$@"
diff --git a/README.md b/README.md
index b729878..fe60d4f 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,17 @@
 # Skynet Wiki
 [Wiki for Skynet][1]
 
+
 Uses [mkdocs][2] to generate the site.  
 
 [1]: https://wiki.skynet.ie
 [2]: https://www.mkdocs.org
+
+
+
+## Hooks
+Run this command to set up the hooks properly so teh git information can be stored within the repo
+
+```bash
+git config --local core.hooksPath .githooks/
+```
\ No newline at end of file
diff --git a/_git.tar.gz b/_git.tar.gz
new file mode 100644
index 0000000..21d4b7c
--- /dev/null
+++ b/_git.tar.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:9ccdcbd37e91e19e57bf24c88be97f2ef5fcca928303ff37bc0765589ff7c810
+size 311941
diff --git a/flake.nix b/flake.nix
index b6401ae..31415bf 100644
--- a/flake.nix
+++ b/flake.nix
@@ -19,6 +19,8 @@
         packages = with pkgs.python3Packages; [
           mkdocs
           mkdocs-material
+          mkdocs-git-authors-plugin
+          mkdocs-git-revision-date-localized-plugin
         ];
       in {
         formatter = alejandra.defaultPackage.${system};
@@ -26,7 +28,7 @@
           name = "skynet-wiki";
           src = self;
           buildInputs = packages;
-          buildPhase = "mkdocs build";
+          buildPhase = "tar -zxf _git.tar.gz && mkdocs build";
           installPhase = "mkdir -p $out; cp -R site/* $out;";
         };
 
diff --git a/mkdocs.yml b/mkdocs.yml
index 59ca5c3..a198ca1 100644
--- a/mkdocs.yml
+++ b/mkdocs.yml
@@ -1,6 +1,33 @@
 site_name: Skynet Wiki
 site_url: https://wiki.skynet.ie
 repo_url: https://forgejo.skynet.ie/Skynet/wiki
+edit_uri: src/branch/main/src
 docs_dir: ./src/
 theme:
   name: material
+  palette:
+    # Palette toggle for light mode
+    - scheme: default
+      toggle:
+        icon: material/brightness-7
+        name: Switch to dark mode
+    # Palette toggle for dark mode
+    - scheme: slate
+      toggle:
+        icon: material/brightness-4
+        name: Switch to light mode
+  features:
+    - search.suggest
+    - search.highlight
+    - navigation.expand
+    - content.action.view
+  icon:
+    view: material/eye
+plugins:
+  - search
+  - git-authors:
+      show_email_address: false
+  - git-revision-date-localized:
+      enable_creation_date: true
+markdown_extensions:
+  - tables
\ No newline at end of file