Compare commits

...

5 commits

Author SHA1 Message Date
61956a69c9
templates/*: move to bootstrap 5
All checks were successful
/ preview (pull_request) Successful in 38s
2024-09-08 17:24:20 -04:00
fdebe12df7
templates/pages: trailing if statement
Some checks failed
/ preview (pull_request) Successful in 44s
/ cleanup (pull_request) Failing after 28s
2024-09-08 16:27:20 -04:00
b039af4160
templates/page: drop dynamic
Some checks failed
/ preview (pull_request) Failing after 31s
2024-09-08 16:25:19 -04:00
79d1dccf32
templates/page: drop comments 2024-09-08 16:24:28 -04:00
7fb0d721d3
templates/*: Drop HTML5 conditions 2024-09-08 16:23:23 -04:00
5 changed files with 39 additions and 185 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -6,11 +6,6 @@
<meta name="viewport" content="width=device-width, initial-scale=1" />
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<TMPL_IF NAME="META"><TMPL_VAR META></TMPL_IF>
<TMPL_IF DYNAMIC>
<TMPL_IF FORCEBASEURL><base href="<TMPL_VAR FORCEBASEURL>" /><TMPL_ELSE>
<TMPL_IF BASEURL><base href="<TMPL_VAR BASEURL>" /></TMPL_IF>
</TMPL_IF>
</TMPL_IF>
<title><TMPL_VAR TITLE> - <TMPL_VAR WIKINAME></title>
@ -30,17 +25,11 @@
<!-- Bootstrap core CSS -->
<!-- those checksums can be verified with: shasum -b -a 384 $file | xxd -r -p | base64 -->
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous" />
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65" crossorigin="anonymous">
<!-- Custom styles for this template -->
<link href="<TMPL_VAR BASEURL>bootstrap.local.css" rel="stylesheet" />
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<!-- Custom styles for derivatives -->
<TMPL_IF LOCAL_CSS>
<link rel="stylesheet" href="<TMPL_VAR BASEURL><TMPL_VAR LOCAL_CSS>" type="text/css" />
@ -48,47 +37,27 @@
<link rel="stylesheet" href="<TMPL_VAR BASEURL>local.css" type="text/css" />
</TMPL_IF>
<TMPL_UNLESS DYNAMIC>
<TMPL_IF EDITURL>
<link rel="alternate" type="application/x-wiki" title="Edit this page" href="<TMPL_VAR EDITURL>" />
</TMPL_IF>
<TMPL_IF FEEDLINKS><TMPL_VAR FEEDLINKS></TMPL_IF>
<TMPL_IF RELVCS><TMPL_VAR RELVCS></TMPL_IF>
<TMPL_IF META><TMPL_VAR META></TMPL_IF>
<TMPL_LOOP TRAILLOOP>
<TMPL_IF PREVPAGE>
<link rel="prev" href="<TMPL_VAR PREVURL>" title="<TMPL_VAR PREVTITLE>" />
</TMPL_IF>
<link rel="up" href="<TMPL_VAR TRAILURL>" title="<TMPL_VAR TRAILTITLE>" />
<TMPL_IF NEXTPAGE>
<link rel="next" href="<TMPL_VAR NEXTURL>" title="<TMPL_VAR NEXTTITLE>" />
</TMPL_IF>
</TMPL_LOOP>
</TMPL_UNLESS>
</head>
<body>
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container">
<nav class="navbar fixed-top navbar-light bg-light">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<button class="navbar-toggler collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbarScroll" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<a class="navbar-brand" href="<TMPL_VAR BASEURL>">
<img alt="<TMPL_VAR WIKINAME>" src="<TMPL_VAR BASEURL>favicon.png" width="48" height="48" />
</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<TMPL_IF SIDEBAR>
<TMPL_VAR SIDEBAR>
</TMPL_IF>
</div>
<TMPL_IF OTHERLANGUAGES>
<div class="dropdown navbar-left">
<button class="btn language-switcher dropdown-toggle" type="button" id="language-menu-top" data-toggle=
"dropdown" aria-haspopup="true" aria-expanded="true">
<TMPL_VAR LANG_NAME>
<div class="dropdown">
<button class="btn language-switcher dropdown-toggle" type="button" id="language-menu-top" data-bs-toggle="dropdown" aria-expanded="false">
<img src="<TMPL_VAR BASEURL>wikiicons/languages.png">
</button>
<ul class="dropdown-menu" aria-labelledby="language-menu-top">
@ -105,22 +74,6 @@
</ul>
</div>
</TMPL_IF>
<TMPL_IF SIDEBAR>
<TMPL_VAR SIDEBAR>
</TMPL_IF>
<ul class="nav navbar-nav">
<TMPL_LOOP BOOTMENU>
<TMPL_IF FIRSTNAV>
<li <TMPL_IF ACTIVE>class="active"</TMPL_IF>><a href="<TMPL_VAR URL>"><TMPL_VAR PAGE></a></li>
</TMPL_IF>
</TMPL_LOOP>
</ul>
</div>
</div>
</nav>
@ -129,101 +82,18 @@
<TMPL_VAR CONTENT>
<TMPL_IF ENCLOSURE>
<TMPL_IF HTML5><section id="enclosure"><TMPL_ELSE><div id="enclosure"></TMPL_IF>
<section id="enclosure">
<a href="<TMPL_VAR ENCLOSURE>">Download</a>
<TMPL_IF HTML5></section><TMPL_ELSE></div></TMPL_IF>
</section>
</TMPL_IF>
<TMPL_IF TRAILS>
<TMPL_VAR TRAILS>
</TMPL_IF>
<TMPL_UNLESS DYNAMIC>
<!-- legacy Ikiwiki comments.pm section -->
<TMPL_IF COMMENTS>
<TMPL_IF HTML5><section id="comments"><TMPL_ELSE><div id="comments"></TMPL_IF>
<TMPL_VAR COMMENTS>
<TMPL_IF ADDCOMMENTURL>
<div class="addcomment">
<a href="<TMPL_VAR ADDCOMMENTURL>">Add a comment</a>
</div>
<TMPL_ELSE>
<TMPL_UNLESS mastodon_host>
<div class="addcomment">Comments on this page are closed.</div>
</TMPL_UNLESS>
</TMPL_IF>
<TMPL_IF HTML5></section><TMPL_ELSE></div></TMPL_IF>
</TMPL_IF>
<!-- Mastodon comments -->
<TMPL_IF mastodon_host>
<div class="mastodon-comments comments">
<p>You can use your Mastodon account to reply to this <a class="link" href="https://<TMPL_VAR mastodon_host>/@<TMPL_VAR mastodon_username>/<TMPL_VAR mastodon_post>">post</a>.</p>
<p id="mastodon-comments-list"><button id="load-comment">Load comments</button></p>
<noscript><p>You need JavaScript to view the comments.</p></noscript>
<script src="<TMPL_VAR BASEURL>assets/js/purify.min.js"></script>
<script type="text/javascript">
function escapeHtml(unsafe) {
return unsafe
.replace(/&/g, "&amp;")
.replace(/</g, "&lt;")
.replace(/>/g, "&gt;")
.replace(/"/g, "&quot;")
.replace(/'/g, "&#039;");
}
document.getElementById("load-comment").addEventListener("click", function() {
document.getElementById("load-comment").innerHTML = "Loading...";
fetch('https://<TMPL_VAR mastodon_host>/api/v1/statuses/<TMPL_VAR mastodon_post>/context')
.then(function(response) {
return response.json();
})
.then(function(data) {
if(data['descendants'] &&
Array.isArray(data['descendants']) &&
data['descendants'].length > 0) {
document.getElementById('mastodon-comments-list').innerHTML = "";
data['descendants'].forEach(function(reply) {
reply.account.display_name = escapeHtml(reply.account.display_name);
reply.account.emojis.forEach(emoji => {
reply.account.display_name = reply.account.display_name.replace(`:${emoji.shortcode}:`,
`<img src="${escapeHtml(emoji.static_url)}" alt="Emoji ${emoji.shortcode}" height="20" width="20" />`);
});
mastodonComment =
`<div class="mastodon-comment comment">
<div class="avatar">
<img src="${escapeHtml(reply.account.avatar_static)}" height=60 width=60 alt="">
</div>
<div class="content">
<div class="author">
<a href="${reply.account.url}" rel="nofollow">
<span>${reply.account.display_name}</span>
<span class="disabled">${escapeHtml(reply.account.acct)}</span>
</a>
<a class="post" href="${reply.uri}" rel="nofollow">
<time datetime="${reply.created_at}" pubdate="pubdate">
${reply.created_at.replace(/(T\d+:\d+):\d+(\.\d+)?(.*)/, "$1$3")}
</time>
</a>
</div>
<div class="mastodon-comment-content">${reply.content}</div>
</div>
</div>`;
document.getElementById('mastodon-comments-list').appendChild(DOMPurify.sanitize(mastodonComment, {'RETURN_DOM_FRAGMENT': true}));
});
} else {
document.getElementById('mastodon-comments-list').innerHTML = "<p>Not comments found</p>";
}
});
});
</script>
</div>
</TMPL_IF>
</TMPL_UNLESS>
</div> <!-- /container -->
<TMPL_IF HTML5><footer<TMPL_ELSE><div</TMPL_IF> class="footer" role="contentinfo">
<footer class="footer" role="contentinfo">
<div class="container">
<TMPL_IF FOOTER>
@ -231,14 +101,15 @@
</TMPL_IF>
</div>
<TMPL_IF HTML5></footer><TMPL_ELSE></div></TMPL_IF>
</footer>
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="https://code.jquery.com/jquery-3.2.1.min.js" crossorigin="anonymous" integrity="sha384-xBuQ/xzmlsLoJpyjoggmTEz8OWUFM0/RC5BsqQBDX2v5cMvDHcMakNTNrHIW2I5f"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" crossorigin="anonymous" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa"></script>
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.6/dist/umd/popper.min.js" integrity="sha384-oBqDVmMz9ATKxIep9tiCxS/Z9fNfEXiDAYTujMAeBAsjFuCZSmKbSSUnQlmh/jp3" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-kenU1KFdBIe4zVF0s0G1M5b4hcpxyD9F7jL+jjXkk+Q2h455rYXK/7HAuoJl+0I4" crossorigin="anonymous"></script>
<!-- TODO: Find other ways to setup analytics
<script data-goatcounter="https://analytics.anarc.at/count" async src="//analytics.anarc.at/count.js"></script>

View file

@ -1,4 +1,4 @@
<form method="get" action="<TMPL_VAR SEARCHACTION>" class="navbar-form navbar-left" role="search">
<input type="text" class="form-control" name="P" value="" size="16"
<TMPL_IF HTML5>placeholder="search"</TMPL_IF> />
placeholder="search" />
</form>