Fix invalid HTML

wiki.html:29 is a total mess because it opens and closes tags in weird places...
Good enough tho ¯\_(ツ)_/¯
This commit is contained in:
Pk11 2020-12-21 22:41:50 -06:00
parent a23167956e
commit ab275368f0
2 changed files with 30 additions and 29 deletions

View File

@ -19,33 +19,36 @@ layout: compress
<div class="rounded-3 border sidebar-container mb-3 p-3"> <div class="rounded-3 border sidebar-container mb-3 p-3">
{% assign items = site[page.collection] | where: "section", page.section | sort: "category" %} {% assign items = site[page.collection] | where: "section", page.section | sort: "category" %}
<ul class="list-unstyled"> <ul class="list-unstyled">
<!-- First check for index --> <!-- First check for index -->
{% for item in items %} {% for item in items %}
{% if item.url contains "index.html" %} {% if item.url contains "index.html" %}
<li {% unless item contains category %}class="li-bullet"{% endunless %}><a href="{{ item.url }}">{{ item.title }}</a></li> <li {% unless item contains category %}class="li-bullet"{% endunless %}><a href="{{ item.url }}">{{ item.title }}</a></li>
{% endif %}
{% endfor %}
{% for item in items %}
{% unless item.url contains "index.html" %}
{% if item.category and category != item.category %}
{% if category %}
</ul>
</li>
</details>
{% endif %}
{% assign category = item.category %}
<li>
<details {% if page.category == category %}open{% endif %}>
<summary>{{ category }}</summary>
<ul>
{% endif %} {% endif %}
<li {% unless item contains category %}class="li-bullet"{% endunless %}><a href="{{ item.url }}">{{ item.title }}</a></li> {% endfor %}
{% endunless %} <!-- Then the other pages -->
{% endfor %} {% for item in items %}
{% if category %} {% unless item.url contains "index.html" %}
</ul> {% if item.category and category != item.category %}
</details> {% if category %}
{% endif %} </ul>
</details>
</li>
{% endif %}
{% assign category = item.category %}
<li>
<details {% if page.category == category %}open{% endif %}>
<summary>{{ category }}</summary>
<ul>
{% endif %}
<li {% unless item contains category %}class="li-bullet"{% endunless %}><a href="{{ item.url }}">{{ item.title }}</a></li>
{% endunless %}
{% endfor %}
{% if category %}
</ul>
</details>
</li>
{% endif %}
</ul>
</div> </div>
</div> </div>
<div class="col-sm-9"> <div class="col-sm-9">

View File

@ -7,17 +7,15 @@ if(!languageID.match(/[a-z][a-z]-[A-Z][A-Z]/)) {
if(languageID) { if(languageID) {
for(let language of document.getElementById("language-dropdown").children) { for(let language of document.getElementById("language-dropdown").children) {
if(language.children[0].dataset.languageId == languageID && !language.children[0].classList.contains("active")) { if(language.children[0].dataset.languageId == languageID && !language.children[0].classList.contains("active")) {
console.log(languageID)
for(let languageAlert of document.getElementsByClassName("language-alert")) { for(let languageAlert of document.getElementsByClassName("language-alert")) {
languageAlert.classList.remove("d-none"); languageAlert.classList.remove("d-none");
let a = document.createElement("a"); let a = document.createElement("a");
a.href = `${languageID == "en-US" ? "" : ("/" + languageID)}${window.location.pathname.replace(/[a-z][a-z]-[A-Z][A-Z]\//, "")}`; a.href = `${languageID == "en-US" ? "" : ("/" + languageID)}${window.location.pathname.replace(/[a-z][a-z]-[A-Z][A-Z]\//, "")}`;
console.log(a.href);
languageAlert.prepend(a); languageAlert.prepend(a);
import(`./i18n/${languageID}.js`).then(obj => { import(`./i18n/${languageID}.js`).then(obj => {
a.innerHTML = obj.default.pageIsInYourLanguage; a.innerHTML = obj.default.pageIsInYourLanguage;
}).catch((err) => {console.log(err); a.innerHTML = "This page is available in your language!"}); }).catch(() => a.innerHTML = "This page is available in your language!");
break; break;
} }
} }