annotate src/site.js @ 12:5551c7b1a4cb

add private
author Franklin Schmidt <fschmidt@gmail.com>
date Mon, 15 Sep 2025 18:12:59 -0600
parents 38e5ff291f96
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">
45a3989c3447 start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
6 <style>
45a3989c3447 start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
7 @import "/site.css";
45a3989c3447 start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
8 </style>
45a3989c3447 start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
9 ` );
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 function header() {
45a3989c3447 start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
13 document.write(`\
45a3989c3447 start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
14 <div header>
45a3989c3447 start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
15 <span breadcrumbs>
45a3989c3447 start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
16 <a href="/">Arkian</a>
45a3989c3447 start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
17 </span>
45a3989c3447 start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
18 <span>by <a href="https://linkmy.style/fschmidt">fschmidt</a></span>
45a3989c3447 start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
19 </div>
45a3989c3447 start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
20 ` );
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 function showToc(content) {
45a3989c3447 start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
24 document.writeln('<ul>');
45a3989c3447 start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
25 for( let id in content ) {
45a3989c3447 start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
26 let info = content[id];
45a3989c3447 start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
27 document.writeln(`<li><a id="c_${id}" href="#${id}">${info.title}</a>`);
45a3989c3447 start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
28 let subs = info.subs;
45a3989c3447 start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
29 if( subs ) {
45a3989c3447 start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
30 showToc(subs);
45a3989c3447 start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
31 }
45a3989c3447 start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
32 document.writeln('</li>');
45a3989c3447 start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
33 }
45a3989c3447 start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
34 document.writeln('</ul>');
45a3989c3447 start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
35 }
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 function showContent(content,h) {
45a3989c3447 start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
38 for( let id in content ) {
45a3989c3447 start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
39 let info = content[id];
45a3989c3447 start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
40 document.write(`\
45a3989c3447 start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
41 <div heading>
45a3989c3447 start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
42 <h${h}><a id="${id}" href="#${id}">${info.title}</a></h${h}>
45a3989c3447 start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
43 <a href="#c_${id}">contents</a>
45a3989c3447 start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
44 </div>
45a3989c3447 start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
45 ` );
45a3989c3447 start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
46 if( info.content )
45a3989c3447 start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
47 document.write(info.content);
45a3989c3447 start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
48 let subs = info.subs;
45a3989c3447 start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
49 if( subs ) {
45a3989c3447 start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
50 showContent(subs,h+1)
45a3989c3447 start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
51 }
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 }
6
38e5ff291f96 start mikraite
Franklin Schmidt <fschmidt@gmail.com>
parents: 0
diff changeset
54
38e5ff291f96 start mikraite
Franklin Schmidt <fschmidt@gmail.com>
parents: 0
diff changeset
55 function mikraite(url) {
38e5ff291f96 start mikraite
Franklin Schmidt <fschmidt@gmail.com>
parents: 0
diff changeset
56 document.writeln(`<p>From <a href="${url}">Mikraite Forum</a></p>`);
38e5ff291f96 start mikraite
Franklin Schmidt <fschmidt@gmail.com>
parents: 0
diff changeset
57 }