diff --git a/docs/assets/js/aki-navigator.js b/docs/assets/js/aki-navigator.js
new file mode 100644
index 0000000..51dfe70
--- /dev/null
+++ b/docs/assets/js/aki-navigator.js
@@ -0,0 +1,59 @@
+'use strict';
+
+class AkiNavigator {
+ constructor(defaultView, fetchPath = 'content') {
+ this.header = undefined;
+ this.contentOutlet = undefined;
+ this.defaultView = defaultView;
+ this.fetchPath = fetchPath;
+
+ this.onExec();
+ }
+
+ onExec() {
+ this.header = document.querySelector('header');
+ this.contentOutlet = document.querySelector('#router-outlet');
+
+ window.addEventListener('hashchange', () => this.displayView(window.location.hash.substr(1)));
+
+ if (window.location.hash) {
+ this.displayView(window.location.hash.substr(1));
+ } else if (typeof this.defaultView !== 'undefined') {
+ this.displayView(this.defaultView);
+ }
+ }
+
+ removeChildren(element) {
+ let count = element.childNodes.length;
+
+ while (count--) {
+ element.removeChild(element.lastChild);
+ }
+ }
+
+ async fetchView(view) {
+ const response = await fetch(`${this.fetchPath}/${view}.html`);
+ const text = await response.text();
+
+ this.removeChildren(this.contentOutlet);
+ this.contentOutlet.innerHTML = text;
+ }
+
+ displayView(view) {
+ this.fetchView(view);
+
+ const activeLinks = document.querySelectorAll('a[active]');
+ const newActiveLinks = document.querySelectorAll(`a[href='#${view}']`);
+
+ if (activeLinks.length > 0) {
+ activeLinks.forEach(link => link.removeAttribute('active'));
+ }
+
+ newActiveLinks.forEach(newLink => newLink.setAttribute('active', ''));
+
+ this.contentOutlet.scrollTop = 0;
+
+ // FIXME: history push is fucked rn.
+ // window.history.pushState(null, `${view}`, `#${view}`);
+ }
+}
diff --git a/docs/assets/js/akiNavigatorRouter.js b/docs/assets/js/akiNavigatorRouter.js
deleted file mode 100644
index fadad97..0000000
--- a/docs/assets/js/akiNavigatorRouter.js
+++ /dev/null
@@ -1,85 +0,0 @@
-/**
- * Contains edits to better suit the docs web app.
- */
-
-'use strict';
-
-class AkiNavigatorRouter {
- constructor(routes, ...callbacks) {
- this._header = undefined;
- this._routerOutlet = undefined;
- this._routes = routes;
-
- this._onExec(callbacks);
- }
-
- _onExec(callbacks) {
- this._getReferences();
-
- window.addEventListener("hashchange", () => this.displayView(window.location.hash.substr(1)));
-
- if (window.location.hash) {
- this.displayView(window.location.hash.substr(1));
- }
-
- if (callbacks.length > 0) {
- callbacks.forEach(callback => {
- if (typeof callback == 'function') {
- callback();
- }
- });
- }
- }
-
- _getReferences() {
- this._header = document.querySelector('header');
- this._routerOutlet = document.querySelector('#router-outlet');
- }
-
- _removeChildren(element) {
- let count = element.childNodes.length;
-
- while (count--) {
- element.removeChild(element.lastChild);
- }
- }
-
- async _fetchView(view) {
- const response = await fetch(`md/${view}`);
- const text = await response.text();
-
- this._removeChildren(this._routerOutlet);
- // this._routerOutlet.innerHTML = text;
-
- this._routerOutlet.innerHTML = marked(text);
- Prism.highlightAll();
- }
-
- displayView(view) {
- // Useless here. Only fetch is used.
- // if (this._mode === 'fetch') {
- // this._fetchView(view);
- // } else {
- // this._setView(view);
- // }
-
- this._fetchView(view);
-
- const activeLinks = document.querySelectorAll('a[active]');
- const newActiveLinks = document.querySelectorAll(`a[href='#${view}']`);
-
- console.log('view:', view);
- console.log('activeLinks:', activeLinks);
- console.log('newActiveLinks:', newActiveLinks);
-
- if (activeLinks.length > 0) {
- activeLinks.forEach(link => link.removeAttribute('active'));
- }
-
- newActiveLinks.forEach(newLink => newLink.setAttribute('active', ''));
-
- this._routerOutlet.scrollTop = 0;
- // FIXME: history push is fucked rn.
- // window.history.pushState(null, `${view}`, `#${view}`);
- }
-}
\ No newline at end of file
diff --git a/docs/index.html b/docs/index.html
index e79f179..d7bfdff 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -24,7 +24,6 @@
Website
Workshop
Gitea
-
@@ -42,17 +41,37 @@
-
+