Re-write to cleanup all styles and such (#158)
* Rewrite and re-style the wiki * Fix links * Fix mobile width being wrong * Make the anticheat warning pretty * Fix root pages * Fix code blocks and cleanup some other bits * Fix search * Fix android and iOS sidebar links
This commit is contained in:
1 parent
17e1be5177
commit
09025ac3cb
93 files changed
+595
-3676
No files matched your search
@@ -1,4 +0,0 @@
|
||||
<div class="alert alert-{{ include.type }}" role="alert">
|
||||
<h4 class="alert-heading">{% if include.title %}{{ include.title }}{% else %}{{ include.type }}{% endif %}</h4>
|
||||
{{ include.content }}
|
||||
</div>
|
||||
@@ -1 +0,0 @@
|
||||
<a href="{{ site.baseurl }}/docs/{{ include.path }}">{% if include.name %}{{ include.name }}{% else %}{{ include.path }}{% endif %}</a>
|
||||
@@ -1,6 +0,0 @@
|
||||
<a href="{{ site.repo }}/edit/{% if site.github_branch %}{{ site.github_branch }}{% else %}master{% endif %}/{{ page.path }}" target="_blank"><i class="fa fa-edit fa-fw"></i> Edit this page</a>
|
||||
<a href="{{ site.repo }}/issues/new?labels={% if page.editable %}{{ page.editable }}{% else %}question{% endif %}&title=Question:&body=Question on: {{ site.repo }}/tree/master/{{ page.path }}" target="_blank"><i class="fab fa-github fa-fw"></i> Create Wiki issue/bug report</a>
|
||||
<a href="https://github.com/{{ site.github_user }}/{{ site.github_repo }}/issues/new" target="_blank"><i class="fas fa-tasks fa-fw"></i> Create Geyser issue/bug report</a>
|
||||
<!-- this will parse through the header fields and add a button to open
|
||||
an issue / ask a question on Github. The editable field should be in
|
||||
the post frontend matter, and refer to the label to open the issue for -->
|
||||
@@ -1,44 +0,0 @@
|
||||
{% if site.feedback %}
|
||||
<h5 class="feedback--title">Feedback</h5>
|
||||
<p class="feedback--question">Was this page helpful?</p>
|
||||
<button class="feedback--answer feedback--answer-yes">Yes</button>
|
||||
<button class="feedback--answer feedback--answer-no">No</button>
|
||||
<p class="feedback--response feedback--response-yes">
|
||||
Glad to hear it! Please <a href="{{ site.repo }}/issues/new">tell us how we can improve</a>.
|
||||
</p>
|
||||
<p class="feedback--response feedback--response-no">
|
||||
Sorry to hear that. Please <a href="{{ site.repo }}/issues/new">tell us how we can improve</a>.
|
||||
</p>
|
||||
<script>
|
||||
const yesButton = document.querySelector('.feedback--answer-yes');
|
||||
const noButton = document.querySelector('.feedback--answer-no');
|
||||
const yesResponse = document.querySelector('.feedback--response-yes');
|
||||
const noResponse = document.querySelector('.feedback--response-no');
|
||||
const disableButtons = () => {
|
||||
yesButton.disabled = true;
|
||||
noButton.disabled = true;
|
||||
};
|
||||
const sendFeedback = (value) => {
|
||||
if (typeof ga !== 'function') return;
|
||||
const args = {
|
||||
command: 'send',
|
||||
hitType: 'event',
|
||||
category: 'Helpful',
|
||||
action: 'click',
|
||||
label: window.location.pathname,
|
||||
value: value
|
||||
};
|
||||
ga(args.command, args.hitType, args.category, args.action, args.label, args.value);
|
||||
};
|
||||
yesButton.addEventListener('click', () => {
|
||||
yesResponse.classList.add('feedback--response__visible');
|
||||
disableButtons();
|
||||
sendFeedback(1);
|
||||
});
|
||||
noButton.addEventListener('click', () => {
|
||||
noResponse.classList.add('feedback--response__visible');
|
||||
disableButtons();
|
||||
sendFeedback(0);
|
||||
});
|
||||
</script>{% endif %}<br/>
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
<footer class="py-5 row d-print-none">
|
||||
<div class="container-fluid mx-sm-5">
|
||||
<div class="text-center">
|
||||
<ul class="list-inline mb-0">
|
||||
{% if site.twitter %}
|
||||
<li class="list-inline-item mx-2 h3" data-toggle="tooltip" data-placement="top" title="" aria-label="Twitter" data-original-title="Twitter">
|
||||
<a class="text-white" target="_blank" href="https://twitter.com/{{ site.twitter }}">
|
||||
<i class="fab fa-twitter"></i>
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% if site.linkedin %}
|
||||
<li class="list-inline-item mx-2 h3" data-toggle="tooltip" data-placement="top" title="" aria-label="LinkedIn" data-original-title="LinkedIn">
|
||||
<a class="text-white" target="_blank" href="https://linkedin.com/in/{{ site.linkedin }}">
|
||||
<i class="fab fa-linkedin"></i>
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
<li class="list-inline-item mx-2 h3" data-toggle="tooltip" data-placement="top" title="" aria-label="GitHub" data-original-title="GitHub">
|
||||
<a class="text-white" target="_blank" href="{{ site.repo }}">
|
||||
<i class="fab fa-github"></i>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<small class="text-white">© {{ 'now' | date: "%Y" }} {{ site.author }} All Rights Reserved</small>
|
||||
{% if site.privacy %}<small class="ml-1"><a href="{{ site.privacy }}" target="_blank">Privacy Policy</a></small>{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
@@ -1,9 +0,0 @@
|
||||
{% if site.google-analytics %}<script async src='https://www.google-analytics.com/analytics.js'></script>
|
||||
<script type="application/javascript">
|
||||
var doNotTrack = false;
|
||||
if (!doNotTrack) {
|
||||
window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;
|
||||
ga('create', '{{ site.google-analytics }}', 'auto');
|
||||
ga('send', 'pageview');
|
||||
}
|
||||
</script>{% endif %}
|
||||
@@ -1,40 +0,0 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<!-- Copyright 2019-2021 Vanessa Sochat-->
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<meta name="generator" content="Hugo 0.55.6" />
|
||||
|
||||
<META NAME="ROBOTS" CONTENT="INDEX, FOLLOW">
|
||||
|
||||
<link rel="shortcut icon" href="{{ site.baseurl }}/assets/favicons/favicon.ico" >
|
||||
<link rel="apple-touch-icon" href="{{ site.baseurl }}/assets/favicons/apple-icon-180x180.png" sizes="180x180">
|
||||
<link rel="icon" type="image/png" href="{{ site.baseurl }}/assets/favicons/favicon-16x16.png" sizes="16x16">
|
||||
<link rel="icon" type="image/png" href="{{ site.baseurl }}/assets/favicons/favicon-32x32.png" sizes="32x32">
|
||||
<link rel="icon" type="image/png" href="{{ site.baseurl }}/assets/favicons/android-icon-192x192.png"sizes="192x192">
|
||||
<link rel="icon" type="image/png" href="{{ site.baseurl }}/assets/favicons/android-icon-512x512.png"sizes="512x512">
|
||||
<link rel="manifest" href="{{ site.baseurl }}/assets/favicons/site.webmanifest">
|
||||
<link rel="mask-icon" href="{{ site.baseurl }}/assets/favicons/safari-pinned-tab.svg" color="#009000">
|
||||
|
||||
<title>{% if page.title %}{{ page.title }}{% else %}{{ site.title }}{% endif %}</title>
|
||||
<meta property="og:title" content="{% if page.title %}{{ page.title }}{% else %}{{ site.title }}{% endif %}" />
|
||||
<meta property="og:description" content="{% if page.description %}{{ page.description }}{% else %}{{ site.description }}{% endif %}" />
|
||||
<meta property="og:type" content="website" />
|
||||
<meta property="og:url" content="{{ site.url }}" />
|
||||
<meta property="og:site_name" content="{{ site.url }}" />
|
||||
|
||||
<meta itemprop="name" content="{% if page.title %}{{ page.title }}{% else %}{{ site.title }}{% endif %}">
|
||||
<meta itemprop="description" content="{% if page.description %}{{ page.description | strip_html | strip_newlines | truncate: 160 }}{% else %}{{ site.description }}{% endif %}">
|
||||
|
||||
<meta name="twitter:card" content="summary"/>
|
||||
<meta name="twitter:title" content="{% if page.title %}{{ page.title }}{% else %}{{ site.title }}{% endif %}"/>
|
||||
<meta name="twitter:description" content="{% if page.description %}{{ page.description | strip_html | strip_newlines | truncate: 160 }}{% else %}{{ site.description }}{% endif %}"/>
|
||||
|
||||
<meta name="theme-color" content="{{ site.color }}">
|
||||
|
||||
<link rel="stylesheet" href="{{ site.baseurl }}/assets/css/main.css">
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"
|
||||
integrity="sha512-894YE6QWD5I59HgZOGReFYm4dnWc1Qt5NtvYSaNcOP+u1T9qYdvdihz0PPSiiqn/+/3e7Jo4EaG7TubfWGUrMQ=="
|
||||
crossorigin="anonymous"
|
||||
referrerpolicy="no-referrer"></script>
|
||||
</head>
|
||||
@@ -1,46 +0,0 @@
|
||||
<header>
|
||||
<nav class="js-navbar-scroll navbar navbar-expand navbar-dark flex-column flex-md-row td-navbar">
|
||||
<a class="navbar-brand" href="{{ site.baseurl }}/">
|
||||
<span class="navbar-logo"></span><img src="https://geysermc.org/android-chrome-512x512.png" /><span class="text-uppercase font-weight-bold">{{ site.title }}</span>
|
||||
</a>
|
||||
<div class="td-navbar-nav-scroll ml-md-auto" id="main_navbar">
|
||||
<ul class="navbar-nav mt-2 mt-md-0">
|
||||
{% for link in site.data.navigation %}
|
||||
<li class="nav-item mr-2 ml-2 mr-md-4 ml-md-0 mb-2 mb-lg-0 text-center">
|
||||
<a class="nav-link" href="{% if link.url %}{{ site.baseurl }}/{{ link.url }}{% else %}{{ link.external_url }}{% endif %}" ><span>{{ link.title }}</span></a>
|
||||
</li>{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
<div class="navbar-nav d-none d-lg-block">
|
||||
<input type="search" class="form-control td-search-input" placeholder=" Search this site…" aria-label="Search this site…" autocomplete="off">
|
||||
</div>
|
||||
|
||||
<div class="navbar-nav d-none d-lg-block">
|
||||
<a class="gh-source" data-gh-source="github" href="https://github.com/{{ site.github_user }}/{{ site.github_repo }}" title="Go to repository" data-md-state="done">
|
||||
<div class="gh-source__repository">
|
||||
<i class="fab fa-github fa-2x" style='padding-right:20px; float:left; margin-top:5px'></i>
|
||||
{{ site.github_user }}/{{ site.github_repo }}
|
||||
<ul class="gh-source__facts"><li class="gh-source__fact" id='stars'></li><li id="forks" class="gh-source__fact"></li></ul></div></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</nav>
|
||||
</header>
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
var url = "https://api.github.com/search/repositories?q={{ site.github_user }}/{{ site.github_repo }}";
|
||||
fetch(url, {
|
||||
headers: {"Accept":"application/vnd.github.v3+json"}
|
||||
}).then(function(e) {
|
||||
return e.json()
|
||||
}).then(function(r) {
|
||||
if (r.items[0].full_name !== "{{ site.github_user }}/{{ site.github_repo }}") return
|
||||
stars = r.items[0]['stargazers_count']
|
||||
forks = r.items[0]['forks_count']
|
||||
$('#stars').text(stars + " Stars")
|
||||
$('#forks').text(forks + " Forks")
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@@ -1,12 +0,0 @@
|
||||
<script>
|
||||
var headers = ["h1", "h2", "h3", "h4"]
|
||||
var colors = ["red", "orange", "green", "blue"]
|
||||
|
||||
$.each(headers, function(i, header){
|
||||
var color = colors[i];
|
||||
$(header).each(function () {
|
||||
var href=$(this).attr("id");
|
||||
$(this).append('<a class="headerlink" style="color:' + color + '" href="#' + href + '" title="Permanent link">¶</a>')
|
||||
});
|
||||
})
|
||||
</script>
|
||||
@@ -1,3 +0,0 @@
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
|
||||
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script>
|
||||
<script src="{{ site.baseurl }}/assets/js/main.js"></script>
|
||||
@@ -1,20 +0,0 @@
|
||||
<button onclick="topFunction()" id="scrolltop" title="Go to top">🔝</button>
|
||||
|
||||
<script>
|
||||
// When the user scrolls down 20px from the top of the document, show the button
|
||||
window.onscroll = function() {scrollFunction()};
|
||||
|
||||
function scrollFunction() {
|
||||
if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {
|
||||
document.getElementById("scrolltop").style.display = "block";
|
||||
} else {
|
||||
document.getElementById("scrolltop").style.display = "none";
|
||||
}
|
||||
}
|
||||
|
||||
// When the user clicks on the button, scroll to the top of the document
|
||||
function topFunction() {
|
||||
document.body.scrollTop = 0; // For Safari
|
||||
document.documentElement.scrollTop = 0; // For Chrome, Firefox, IE and Opera
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,29 @@
|
||||
<nav class="navbar navbar-expand-md">
|
||||
<div class="container-fluid">
|
||||
<div class="d-block d-md-none">Wiki Navigation</div>
|
||||
<button class="navbar-toggler mb-2" type="button" data-bs-toggle="collapse" data-bs-target="#sidebarNav" aria-controls="sidebarNav" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<div class="collapse navbar-collapse flex-column align-items-start" id="sidebarNav">
|
||||
{% for section in site.data.toc %}
|
||||
<a class="fw-bold" href="{% if section.url %}{{ site.baseurl }}/{{ section.url }}{% else %}{{ section.external_url }}{% endif %}">{{ section.title }}</a>
|
||||
<ul class="pe-3">
|
||||
{% for entry in section.links %}
|
||||
<li>
|
||||
<a href="{% if entry.url %}{{ site.baseurl }}/{{ entry.url }}{% else %}{{ entry.external_url }}{% endif %}">{{ entry.title }}</a>
|
||||
{% if entry.children %}
|
||||
<ul>
|
||||
{% for child in entry.children %}
|
||||
<li>
|
||||
<a href="{% if child.url %}{{ site.baseurl }}/{{ child.url }}{% else %}{{ child.external_url }}{% endif %}">{{ child.title }}</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
@@ -0,0 +1,5 @@
|
||||
<a class="d-block text-decoration-none" href="{{ site.repo }}/edit/{% if site.github_branch %}{{ site.github_branch }}{% else %}master{% endif %}/{{ page.path }}" target="_blank"><i class="bi bi-pencil"></i> Edit this page</a>
|
||||
<a class="d-block text-decoration-none" href="{{ site.repo }}/issues/new?labels={% if page.editable %}{{ page.editable }}{% else %}question{% endif %}&title=Question:&body=Question on: {{ page.path }}" target="_blank"><i class="bi bi-github"></i> Create Wiki issue/bug report</a>
|
||||
<a class="d-block text-decoration-none" href="{{ page.repo }}/issues/new" target="_blank"><i class="bi bi-list-check"></i> Create Geyser issue/bug report</a>
|
||||
|
||||
<div id="page-nav" class="py-3"></div>
|
||||
@@ -1,54 +0,0 @@
|
||||
<div id="td-sidebar-menu" class="td-sidebar__inner">
|
||||
|
||||
<form class="td-sidebar__search d-flex align-items-center">
|
||||
<input type="search" class="form-control td-search-input" placeholder=" Search this site…" aria-label="Search this site…" autocomplete="off">
|
||||
<button class="btn btn-link td-sidebar__toggle d-md-none p-0 ml-3 fas fa-bars" type="button" data-toggle="collapse" data-target="#td-section-nav" aria-controls="td-docs-nav" aria-expanded="false" aria-label="Toggle section navigation">
|
||||
</button>
|
||||
</form>
|
||||
|
||||
<nav class="collapse td-sidebar-nav pt-2 pl-4" id="td-section-nav">
|
||||
{% for section in site.data.toc %}
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
{% capture sectionUrl %}
|
||||
{{ section.url | replace: "/", "" }}
|
||||
{% endcapture %}
|
||||
{% capture pageUrl %}
|
||||
{{ page.url | replace: "/", "" }}
|
||||
{% endcapture %}
|
||||
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="{% if section.url %}{{ site.baseurl }}/{{ section.url }}{% else %}{{ section.external_url }}{% endif %}" class="align-left pl-0 pr-2 active td-sidebar-link td-sidebar-link__section">{{ section.title }}</a>
|
||||
</li>
|
||||
{% if section.links %}
|
||||
<ul>
|
||||
<li class="collapse show" id="{{ section.title | slugify }}">
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
{% for entry in section.links %}
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="{% if entry.url %}
|
||||
{{ site.baseurl }}/{{ entry.url }}
|
||||
{% else %}
|
||||
{{ entry.external_url }}
|
||||
{% endif %}"
|
||||
class="align-left pl-0 pr-2 td-sidebar-link td-sidebar-link__section">{{ entry.title }}
|
||||
</a>
|
||||
</li>
|
||||
{% if page.url contains entry.url or pageUrl == sectionUrl %}
|
||||
<ul>
|
||||
<li class="collapse show" id="{{ child.title | slugify }}">
|
||||
{% if entry.children %}
|
||||
{% for child in entry.children %}
|
||||
<a class="td-sidebar-link td-sidebar-link__page " id="m-{{ section.title | slugify }}-{{ entry.title | slugify }}-{{ child.title | slugify }}" href="{% if child.url %}{{ site.baseurl }}/{{ child.url }}{% else %}{{ child.external_url }}{% endif %}">{{ child.title }}</a>{% endfor %}
|
||||
{% endif %}
|
||||
</li>
|
||||
</ul>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
{% endif %}
|
||||
</ul>
|
||||
{% endfor %}
|
||||
</nav>
|
||||
</div>
|
||||
@@ -1,2 +0,0 @@
|
||||
{% if page.tags %}<script>
|
||||
$('h1').first().append('<div>{% for tag in page.tags %}<span style="font-size:12px" class="badge badge-{{ site.tag_color }}"><a style="cursor:pointer; color:white" href="{% if site.tag_search_endpoint %}{{ site.tag_search_endpoint }}{{ tag }}{% else %}{{ site.url }}{{ site.baseurl }}/tags#{{ tag }} {% endif %}">{{ tag }}</a></span>{% endfor %}</div>')</script>{% endif %}
|
||||
@@ -1,35 +0,0 @@
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"
|
||||
integrity="sha512-894YE6QWD5I59HgZOGReFYm4dnWc1Qt5NtvYSaNcOP+u1T9qYdvdihz0PPSiiqn/+/3e7Jo4EaG7TubfWGUrMQ=="
|
||||
crossorigin="anonymous"
|
||||
referrerpolicy="no-referrer"></script>
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
|
||||
var toc = $('#TOC');
|
||||
|
||||
// Select each header
|
||||
sections = $('.td-content h1');
|
||||
$.each(sections, function(idx, v) {
|
||||
section = $(v);
|
||||
var div_id = $(section).attr('id');
|
||||
var div_text = section.text().split('¶')[0];
|
||||
var parent = $("#" + div_id)
|
||||
var content = '<li id="link_' + div_id + '" class="md-nav__item"><a class="md-nav__link" href="#' + div_id + '" title="' + div_text +'">' + div_text +'</a></li>';
|
||||
$(toc).append(content);
|
||||
|
||||
// Add section code to subnavigation
|
||||
var children = $('<nav class="md-nav"><ul class="md-nav__list"></nav></ul>')
|
||||
var contenders = $("#" + div_id).nextUntil("h1");
|
||||
$.each(contenders, function(idx, contender){
|
||||
if($(contender).is('h2') || $(contender).is('h3')) {
|
||||
var contender_id = $(contender).attr('id');
|
||||
var contender_text = $(contender).text().split('¶')[0];
|
||||
var content = '<li class="md-nav__item"><a class="md-nav__link" href="#' + contender_id + '" title="' + contender_text +'">' + contender_text +'</a></li>';
|
||||
children.append(content);
|
||||
}
|
||||
})
|
||||
$("#link_" + div_id).append(children);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
Reference in new issue
Block a user