Skip to content

Commit 80741cb

Browse files
committed
bugfix
1 parent aa98c46 commit 80741cb

File tree

98 files changed

+260
-224
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+260
-224
lines changed

content/_includes/petrapixel.njk

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -310,9 +310,8 @@ testingOnLocalhost: false
310310
<li aria-label="watching:">
311311
<img src="{{ nesting }}assets/img/layout/icon-tv.png" alt="" title="watching:" aria-hidden="true" />
312312
<a href="https://app.tvtime.com/user/33116783" target="_blank"
313-
>-
314-
<!--<span style="font-family: sans-serif; font-size: 0.9em">↺</span
315-
>--></a
313+
>WWDITS <span style="font-family: sans-serif; font-size: 0.9em">↺</span
314+
><!----></a
316315
>
317316
</li>
318317
<li aria-label="reading:">

content/coding/snippets.html

Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ <h3>Automatic Tab Title Suffix</h3>
3535
<p>for example, changing "about me" in the browser tab to "about me | your site name"</p>
3636
<details>
3737
<summary>Show/Hide</summary>
38-
<pre><code>
39-
const tabTitle = document.title;
38+
<pre><code>const tabTitle = document.title;
4039
if (tabTitle !== "YOUR HOME TITLE") {
4140
document.title = tabTitle + " | some text";
4241
}
@@ -50,8 +49,7 @@ <h3>Highlight active links</h3>
5049
<p>You can give the class "active" to any active navigation links automatically</p>
5150
<details>
5251
<summary>Show/Hide</summary>
53-
<pre><code>
54-
const linkElements = document.querySelectorAll("nav a");
52+
<pre><code>const linkElements = document.querySelectorAll("nav a");
5553
[...linkElements].forEach((el) => {
5654
const href = el.getAttribute("href").replace(".html", "").replace("/public", "");
5755

@@ -80,29 +78,32 @@ <h3>Automatic Table of Contents</h3>
8078
<pre><code>&lt;div id="toc"&gt;&lt;/div&gt;
8179
</code></pre>
8280
<p>The JavaScript:</p>
83-
<pre><code>
84-
const container = document.querySelector("#toc");
85-
if (!container) return;
86-
const allHeadings = document.querySelectorAll("h2");
87-
if (allHeadings.length &lt; 2) return;
88-
let output = "&lt;b&gt;Table of Contents:&lt;/b&gt;&lt;ol&gt;";
89-
[...allHeadings].forEach((headingEl) =&gt; {
90-
const title = headingEl.innerHTML;
91-
const link =
92-
headingEl.getAttribute("id") ||
93-
encodeURI(
94-
title
95-
.replaceAll(" ", "-")
96-
.replaceAll("#", "")
97-
.replaceAll("&amp;", "")
98-
.replaceAll(/&lt;[^&gt;]*&gt;?/gm, "")
99-
.replaceAll("--", "-")
100-
).toLowerCase();
101-
headingEl.setAttribute("id", link);
102-
output += `&lt;li&gt;&lt;a href="#${link}"&gt;${title}&lt;/a&gt;&lt;/li&gt;`;
103-
});
104-
container.innerHTML = output + "&lt;/ol&gt;";
105-
</code></pre>
81+
<pre><code>initTableOfContents();
82+
83+
function initTableOfContents() {
84+
const container = document.querySelector(&quot;#toc&quot;);
85+
if (!container) return;
86+
87+
const allHeadings = document.querySelectorAll(&quot;h2&quot;);
88+
if (allHeadings.length &lt; 2) return;
89+
let output = &quot;&lt;b&gt;Table of Contents:&lt;/b&gt;&lt;ol&gt;&quot;;
90+
[...allHeadings].forEach((headingEl) =&gt; {
91+
const title = headingEl.innerHTML;
92+
const link =
93+
headingEl.getAttribute(&quot;id&quot;) ||
94+
encodeURI(
95+
title
96+
.replaceAll(&quot; &quot;, &quot;-&quot;)
97+
.replaceAll(&quot;#&quot;, &quot;&quot;)
98+
.replaceAll(&quot;&amp;&quot;, &quot;&quot;)
99+
.replaceAll(/&lt;[^&gt;]*&gt;?/gm, &quot;&quot;)
100+
.replaceAll(&quot;--&quot;, &quot;-&quot;)
101+
).toLowerCase();
102+
headingEl.setAttribute(&quot;id&quot;, link);
103+
output += `&lt;li&gt;&lt;a href=&quot;#${link}&quot;&gt;${title}&lt;/a&gt;&lt;/li&gt;`;
104+
});
105+
container.innerHTML = output + &quot;&lt;/ol&gt;&quot;;
106+
}</code></pre>
106107
<p>Change the selector (default: "h2") to any selector that targets the headings you want to turn into the table of contents.</p>
107108
<p>You can override the automatically generated ID of a heading by simply setting a custom one in the HTML.</p>
108109
</details>

content/layout-generator/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<!DOCTYPE html>
22
<html lang="en">
33
<head>
4-
<title>petrapixel's layout generator</title>
5-
<meta name="description" content="A layout builder / template generator for Neocities / the Indie Web and coding beginners." />
4+
<title>layout generator</title>
5+
<meta name="description" content="" />
66
<script src="../assets/js/layoutGenerator.js{{ nocache }}"></script>
77
<link rel="stylesheet" href="../assets/layoutGenerator.css{{ nocache }}" />
88
<meta content="text/html;charset=utf-8" http-equiv="Content-Type" />

content/widgets/comments.html

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<!DOCTYPE html>
2+
<html lang="de" xml:lang="de">
3+
<head>
4+
<title>comments</title>
5+
<meta content="text/html;charset=utf-8" http-equiv="Content-Type" />
6+
<meta charset="UTF-8" />
7+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
8+
<meta name="robots" content="noindex, nofollow" />
9+
<script src="widgets.js{{ nocache }}"></script>
10+
<style>
11+
body {
12+
background: transparent;
13+
margin: 0;
14+
padding: 0;
15+
display: flex;
16+
flex-direction: column;
17+
}
18+
19+
body main {
20+
margin: 0 auto;
21+
}
22+
</style>
23+
</head>
24+
<body>
25+
<main>
26+
<a data-credit="Widget by Petrapixel" href="https://petrapixel.neocities.org/coding/widgets" style="display: none"></a>
27+
<div>WIP</div>
28+
</main>
29+
</body>
30+
</html>

content/widgets/wip.html

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<!DOCTYPE html>
2+
<html lang="de" xml:lang="de">
3+
<head>
4+
<title>wip</title>
5+
<meta content="text/html;charset=utf-8" http-equiv="Content-Type" />
6+
<meta charset="UTF-8" />
7+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
8+
<meta name="robots" content="noindex, nofollow" />
9+
<script src="widgets.js{{ nocache }}"></script>
10+
<style>
11+
body {
12+
background: transparent;
13+
margin: 0;
14+
padding: 0;
15+
display: flex;
16+
flex-direction: column;
17+
}
18+
19+
body main {
20+
margin: 0 auto;
21+
}
22+
</style>
23+
</head>
24+
<body>
25+
<main>
26+
<a data-credit="Widget by Petrapixel" href="https://petrapixel.neocities.org/coding/widgets" style="display: none"></a>
27+
<div>WIP</div>
28+
</main>
29+
</body>
30+
</html>

content/zz/changelog.html

Lines changed: 0 additions & 28 deletions
This file was deleted.

content/zz/preview.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@
7979
<aside>✨</aside>-->
8080
<main>
8181
<b>updated!</b>
82-
<div>{{ changelog[1].text }}</div>
82+
<!-- <div>{{ changelog[1].text }}</div>
83+
<div>check changelog for details!</div>-->
8384
</main>
8485
</body>
8586
</html>

public/about/about-me.html

Lines changed: 2 additions & 2 deletions
Large diffs are not rendered by default.

public/about/about-the-site.html

Lines changed: 2 additions & 2 deletions
Large diffs are not rendered by default.

public/about/blinkies.html

Lines changed: 2 additions & 2 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)