annotate src/site.js @ 22:bdf000a32b24

rel canonical
author Franklin Schmidt <fschmidt@gmail.com>
date Sat, 20 Sep 2025 09:50:42 -0600
parents d8113ea9879e
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
45a3989c3447 start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
1 'use strict';
45a3989c3447 start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
2
45a3989c3447 start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
3 function head() {
45a3989c3447 start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
4 document.write(`\
45a3989c3447 start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
5 <meta name="viewport" content="width=device-width, initial-scale=1">
22
bdf000a32b24 rel canonical
Franklin Schmidt <fschmidt@gmail.com>
parents: 14
diff changeset
6 <link rel="canonical" href="https://www.arkian.net${location.pathname}${location.search}" />
0
45a3989c3447 start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
7 <style>
45a3989c3447 start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
8 @import "/site.css";
45a3989c3447 start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
9 </style>
45a3989c3447 start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
10 ` );
45a3989c3447 start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
11 }
45a3989c3447 start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
12
45a3989c3447 start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
13 function header() {
45a3989c3447 start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
14 document.write(`\
45a3989c3447 start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
15 <div header>
45a3989c3447 start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
16 <span breadcrumbs>
45a3989c3447 start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
17 <a href="/">Arkian</a>
45a3989c3447 start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
18 </span>
45a3989c3447 start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
19 <span>by <a href="https://linkmy.style/fschmidt">fschmidt</a></span>
45a3989c3447 start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
20 </div>
45a3989c3447 start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
21 ` );
45a3989c3447 start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
22 }
45a3989c3447 start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
23
45a3989c3447 start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
24 function showToc(content) {
45a3989c3447 start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
25 document.writeln('<ul>');
45a3989c3447 start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
26 for( let id in content ) {
45a3989c3447 start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
27 let info = content[id];
45a3989c3447 start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
28 document.writeln(`<li><a id="c_${id}" href="#${id}">${info.title}</a>`);
45a3989c3447 start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
29 let subs = info.subs;
45a3989c3447 start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
30 if( subs ) {
45a3989c3447 start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
31 showToc(subs);
45a3989c3447 start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
32 }
45a3989c3447 start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
33 document.writeln('</li>');
45a3989c3447 start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
34 }
45a3989c3447 start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
35 document.writeln('</ul>');
45a3989c3447 start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
36 }
45a3989c3447 start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
37
45a3989c3447 start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
38 function showContent(content,h) {
45a3989c3447 start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
39 for( let id in content ) {
45a3989c3447 start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
40 let info = content[id];
45a3989c3447 start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
41 document.write(`\
45a3989c3447 start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
42 <div heading>
45a3989c3447 start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
43 <h${h}><a id="${id}" href="#${id}">${info.title}</a></h${h}>
45a3989c3447 start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
44 <a href="#c_${id}">contents</a>
45a3989c3447 start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
45 </div>
45a3989c3447 start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
46 ` );
45a3989c3447 start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
47 if( info.content )
45a3989c3447 start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
48 document.write(info.content);
45a3989c3447 start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
49 let subs = info.subs;
45a3989c3447 start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
50 if( subs ) {
45a3989c3447 start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
51 showContent(subs,h+1)
45a3989c3447 start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
52 }
45a3989c3447 start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
53 }
45a3989c3447 start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
54 }
6
38e5ff291f96 start mikraite
Franklin Schmidt <fschmidt@gmail.com>
parents: 0
diff changeset
55
14
d8113ea9879e mikraite year
Franklin Schmidt <fschmidt@gmail.com>
parents: 6
diff changeset
56 function mikraite(url,year) {
d8113ea9879e mikraite year
Franklin Schmidt <fschmidt@gmail.com>
parents: 6
diff changeset
57 document.writeln(`<p>From <a href="${url}">Mikraite Forum</a> in ${year}</p>`);
6
38e5ff291f96 start mikraite
Franklin Schmidt <fschmidt@gmail.com>
parents: 0
diff changeset
58 }