mirror of
https://gitlab.com/thelazyoxymoron/siddhartha-golu-website.git
synced 2025-07-27 04:47:59 +02:00
472 lines
27 KiB
HTML
472 lines
27 KiB
HTML
<!DOCTYPE html>
|
||
<html lang="en" dir="auto">
|
||
|
||
<head><meta charset="utf-8">
|
||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||
<meta name="robots" content="index, follow">
|
||
<title>Parenting Beyond Belief by Dale McGowan | Siddhartha Golu</title>
|
||
<meta name="keywords" content="religion, non-fiction, parenting, favourites">
|
||
<meta name="description" content="Check it out on Goodreads
|
||
I have had a very curious relationship with religion, although now that I talk to others, it was a much more normal experience than what I led myself to believe. I followed the typical path of receiving a particular religion from my parents (born a “Hindu child”), which had a supporting role in my life up until my late-teenage/early-adolescent years.
|
||
As is the norm for every child brought up in religion, I used to consider myself special believing that I had a “personal relationship” with God.">
|
||
<meta name="author" content="Siddhartha Golu">
|
||
<link rel="canonical" href="https://www.siddharthagolu.com/posts/reading/parenting/">
|
||
<link crossorigin="anonymous" href="/assets/css/stylesheet.66857e85d743ed43ea67ff6c21de89acf86c4e0d759944d3eed3e3cc709b1266.css" integrity="sha256-ZoV+hddD7UPqZ/9sId6JrPhsTg11mUTT7tPjzHCbEmY=" rel="preload stylesheet" as="style">
|
||
<link rel="icon" href="https://www.siddharthagolu.com/favicon.ico">
|
||
<link rel="icon" type="image/png" sizes="16x16" href="https://www.siddharthagolu.com/favicon-16x16.png">
|
||
<link rel="icon" type="image/png" sizes="32x32" href="https://www.siddharthagolu.com/favicon-32x32.png">
|
||
<link rel="apple-touch-icon" href="https://www.siddharthagolu.com/apple-touch-icon.png">
|
||
<link rel="mask-icon" href="https://www.siddharthagolu.com/safari-pinned-tab.svg">
|
||
<meta name="theme-color" content="#2e2e33">
|
||
<meta name="msapplication-TileColor" content="#2e2e33">
|
||
<noscript>
|
||
<style>
|
||
#theme-toggle,
|
||
.top-link {
|
||
display: none;
|
||
}
|
||
|
||
</style>
|
||
<style>
|
||
@media (prefers-color-scheme: dark) {
|
||
:root {
|
||
--theme: rgb(29, 30, 32);
|
||
--entry: rgb(46, 46, 51);
|
||
--primary: rgb(218, 218, 219);
|
||
--secondary: rgb(155, 156, 157);
|
||
--tertiary: rgb(65, 66, 68);
|
||
--content: rgb(196, 196, 197);
|
||
--code-block-bg: rgb(46, 46, 51);
|
||
--code-bg: rgb(55, 56, 62);
|
||
--border: rgb(51, 51, 51);
|
||
}
|
||
|
||
.list {
|
||
background: var(--theme);
|
||
}
|
||
|
||
.list:not(.dark)::-webkit-scrollbar-track {
|
||
background: 0 0;
|
||
}
|
||
|
||
.list:not(.dark)::-webkit-scrollbar-thumb {
|
||
border-color: var(--theme);
|
||
}
|
||
}
|
||
|
||
</style>
|
||
</noscript><details id="commentsDropdown">
|
||
<summary>Comments</summary>
|
||
<script id="issoScript" src="" data-isso="https://comments.siddharthagolu.com/" src="https://comments.siddharthagolu.com/js/embed.min.js"></script>
|
||
</details>
|
||
|
||
<script>
|
||
document.getElementById('commentsDropdown').addEventListener('toggle', function() {
|
||
if (this.open) {
|
||
var script = document.getElementById('issoScript');
|
||
script.src = script.getAttribute('data-isso') + '/js/embed.min.js';
|
||
}
|
||
});
|
||
</script>
|
||
<meta property="og:title" content="Parenting Beyond Belief by Dale McGowan" />
|
||
<meta property="og:description" content="Check it out on Goodreads
|
||
I have had a very curious relationship with religion, although now that I talk to others, it was a much more normal experience than what I led myself to believe. I followed the typical path of receiving a particular religion from my parents (born a “Hindu child”), which had a supporting role in my life up until my late-teenage/early-adolescent years.
|
||
As is the norm for every child brought up in religion, I used to consider myself special believing that I had a “personal relationship” with God." />
|
||
<meta property="og:type" content="article" />
|
||
<meta property="og:url" content="https://www.siddharthagolu.com/posts/reading/parenting/" />
|
||
<meta property="og:image" content="https://www.siddharthagolu.com/posts/reading/parenting/images/parenting.jpg" /><meta property="article:section" content="posts" />
|
||
<meta property="article:published_time" content="2021-03-18T22:14:21+05:30" />
|
||
<meta property="article:modified_time" content="2023-06-25T16:19:25+05:30" /><meta property="og:site_name" content="Siddhartha Golu" />
|
||
|
||
<meta name="twitter:card" content="summary_large_image" />
|
||
<meta name="twitter:image" content="https://www.siddharthagolu.com/posts/reading/parenting/images/parenting.jpg" />
|
||
<meta name="twitter:title" content="Parenting Beyond Belief by Dale McGowan"/>
|
||
<meta name="twitter:description" content="Check it out on Goodreads
|
||
I have had a very curious relationship with religion, although now that I talk to others, it was a much more normal experience than what I led myself to believe. I followed the typical path of receiving a particular religion from my parents (born a “Hindu child”), which had a supporting role in my life up until my late-teenage/early-adolescent years.
|
||
As is the norm for every child brought up in religion, I used to consider myself special believing that I had a “personal relationship” with God."/>
|
||
|
||
|
||
<script type="application/ld+json">
|
||
{
|
||
"@context": "https://schema.org",
|
||
"@type": "BreadcrumbList",
|
||
"itemListElement": [
|
||
{
|
||
"@type": "ListItem",
|
||
"position": 1 ,
|
||
"name": "Posts",
|
||
"item": "https://www.siddharthagolu.com/posts/"
|
||
},
|
||
{
|
||
"@type": "ListItem",
|
||
"position": 2 ,
|
||
"name": "Parenting Beyond Belief by Dale McGowan",
|
||
"item": "https://www.siddharthagolu.com/posts/reading/parenting/"
|
||
}
|
||
]
|
||
}
|
||
</script>
|
||
<script type="application/ld+json">
|
||
{
|
||
"@context": "https://schema.org",
|
||
"@type": "BlogPosting",
|
||
"headline": "Parenting Beyond Belief by Dale McGowan",
|
||
"name": "Parenting Beyond Belief by Dale McGowan",
|
||
"description": "Check it out on Goodreads\nI have had a very curious relationship with religion, although now that I talk to others, it was a much more normal experience than what I led myself to believe. I followed the typical path of receiving a particular religion from my parents (born a \u0026ldquo;Hindu child\u0026rdquo;), which had a supporting role in my life up until my late-teenage/early-adolescent years.\nAs is the norm for every child brought up in religion, I used to consider myself special believing that I had a \u0026ldquo;personal relationship\u0026rdquo; with God.",
|
||
"keywords": [
|
||
"religion", "non-fiction", "parenting", "favourites"
|
||
],
|
||
"articleBody": "Check it out on Goodreads\nI have had a very curious relationship with religion, although now that I talk to others, it was a much more normal experience than what I led myself to believe. I followed the typical path of receiving a particular religion from my parents (born a “Hindu child”), which had a supporting role in my life up until my late-teenage/early-adolescent years.\nAs is the norm for every child brought up in religion, I used to consider myself special believing that I had a “personal relationship” with God. There are so many good things about religion, but this in particular I believe to be the best part - this soothing feeling that somebody is watching over you in times of distress. During my early college years when I lost my faith, I was most afraid of having lost this rescuer of last resort (I wrote a short poem on this which you can read here). During times of despair, I frequently wondered what would’ve happened had I not been brought up in a religious family.\nThis book combines two of the most morally contentious issues that have always puzzled me - Religion and having a child. While I don’t swing to the other extreme of subscribing to antinatalistic views, I do frequently wonder how it is that people don’t question the morality of bringing a sentient being into the world, whose life (to a major extent) will be affected by how they are brought up by their parents. Children are shaped by the identity of their parents during their formative years, and require a significant struggle during their adolescence to be able to make independent decisions of their own. This struggle is more pronounced in matters of faith - an overwhelming majority of children wind up believing in the same gods that their parents believe in.\nWhat can be done to lessen this automatic behavior so that children are more confident of picking their own battles and faith? This book presents insights from the people who tried to do exactly that.\nIt is a wonderful collection of essays from parents who are non-religious and want to bring up their child in an environment which enables them to question the authority and dogma. While just raising them secular doesn’t make them superior to everybody else - bigotry is never dependent on faith - it is the independent exploration that is crucial. The essays deal with nuances of raising children in secular homes, going pretty much against the society, and how to deal with disagreements. Unfortunately, there are few essays in the end which swings the pendulum to the other end, concerned with finding “Humanist” and “Unitarian” communities which I found to be dull, however, the rest of the book remains a pleasant and insightful read.\nMy notebook is filled with highlights from the book, but there’s one paragraph in particular that I want to share, which nicely defines the central theme of these essays.\nOne thread runs throughout this book: Encourage a child to think well, then trust her to do so. Removing religion by no means guarantees kids will think independently and well. Consider religion itself: Kids growing up in a secular home are at the same risk of making uninformed decisions about religion as are those in deeply religious homes. In order to really think for themselves about religion, kids must learn as much as possible about religion as a human cultural expression while being kept free of the sickening idea that they will be rewarded in heaven or punished in hell based on what they decide—a bit of intellectual terrorism we should never inflict on our kids, nor on each other. They must also learn what has been said and thought in opposition to religious ideas. If my kids think independently and well, then end up coming to conclusions different from my own—well, I’d have to consider the possibility that I’ve gotten it all wrong, then. Either way, in order to own and be nourished by their convictions, kids must ultimately come to them independently. Part of our wonderfully complex job as parents is to facilitate that process without controlling it.\nI’d highly recommend this book to everyone.\n",
|
||
"wordCount" : "703",
|
||
"inLanguage": "en",
|
||
"image":"https://www.siddharthagolu.com/posts/reading/parenting/images/parenting.jpg","datePublished": "2021-03-18T22:14:21+05:30",
|
||
"dateModified": "2023-06-25T16:19:25+05:30",
|
||
"author":[{
|
||
"@type": "Person",
|
||
"name": "Siddhartha Golu"
|
||
}],
|
||
"mainEntityOfPage": {
|
||
"@type": "WebPage",
|
||
"@id": "https://www.siddharthagolu.com/posts/reading/parenting/"
|
||
},
|
||
"publisher": {
|
||
"@type": "Organization",
|
||
"name": "Siddhartha Golu",
|
||
"logo": {
|
||
"@type": "ImageObject",
|
||
"url": "https://www.siddharthagolu.com/favicon.ico"
|
||
}
|
||
}
|
||
}
|
||
</script>
|
||
</head>
|
||
|
||
<body class="" id="top">
|
||
<script>
|
||
if (localStorage.getItem("pref-theme") === "dark") {
|
||
document.body.classList.add('dark');
|
||
} else if (localStorage.getItem("pref-theme") === "light") {
|
||
document.body.classList.remove('dark')
|
||
} else if (window.matchMedia('(prefers-color-scheme: dark)').matches) {
|
||
document.body.classList.add('dark');
|
||
}
|
||
|
||
</script>
|
||
|
||
<header class="header">
|
||
<nav class="nav">
|
||
<div class="logo">
|
||
<a href="https://www.siddharthagolu.com/" accesskey="h" title="Siddhartha Golu (Alt + H)">
|
||
<img src="https://www.siddharthagolu.com/apple-touch-icon.png" alt="" aria-label="logo"
|
||
height="30">Siddhartha Golu</a>
|
||
<div class="logo-switches">
|
||
<button id="theme-toggle" accesskey="t" title="(Alt + T)">
|
||
<svg id="moon" xmlns="http://www.w3.org/2000/svg" width="24" height="18" viewBox="0 0 24 24"
|
||
fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"
|
||
stroke-linejoin="round">
|
||
<path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"></path>
|
||
</svg>
|
||
<svg id="sun" xmlns="http://www.w3.org/2000/svg" width="24" height="18" viewBox="0 0 24 24"
|
||
fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"
|
||
stroke-linejoin="round">
|
||
<circle cx="12" cy="12" r="5"></circle>
|
||
<line x1="12" y1="1" x2="12" y2="3"></line>
|
||
<line x1="12" y1="21" x2="12" y2="23"></line>
|
||
<line x1="4.22" y1="4.22" x2="5.64" y2="5.64"></line>
|
||
<line x1="18.36" y1="18.36" x2="19.78" y2="19.78"></line>
|
||
<line x1="1" y1="12" x2="3" y2="12"></line>
|
||
<line x1="21" y1="12" x2="23" y2="12"></line>
|
||
<line x1="4.22" y1="19.78" x2="5.64" y2="18.36"></line>
|
||
<line x1="18.36" y1="5.64" x2="19.78" y2="4.22"></line>
|
||
</svg>
|
||
</button>
|
||
</div>
|
||
</div>
|
||
<ul id="menu">
|
||
<li>
|
||
<a href="https://www.siddharthagolu.com/about" title="About">
|
||
<span>About</span>
|
||
</a>
|
||
</li>
|
||
<li>
|
||
<a href="https://www.siddharthagolu.com/archive" title="Archive">
|
||
<span>Archive</span>
|
||
</a>
|
||
</li>
|
||
<li>
|
||
<a href="https://www.siddharthagolu.com/categories" title="Categories">
|
||
<span>Categories</span>
|
||
</a>
|
||
</li>
|
||
<li>
|
||
<a href="https://www.siddharthagolu.com/tags/" title="Tags">
|
||
<span>Tags</span>
|
||
</a>
|
||
</li>
|
||
<li>
|
||
<a href="https://www.siddharthagolu.com/search/" title="Search (Alt + /)" accesskey=/>
|
||
<span>Search</span>
|
||
</a>
|
||
</li>
|
||
</ul>
|
||
</nav>
|
||
</header>
|
||
<main class="main">
|
||
|
||
<article class="post-single">
|
||
<header class="post-header">
|
||
<div class="breadcrumbs"><a href="https://www.siddharthagolu.com/">Home</a> » <a href="https://www.siddharthagolu.com/posts/">Posts</a></div>
|
||
<h1 class="post-title entry-hint-parent">
|
||
Parenting Beyond Belief by Dale McGowan
|
||
</h1>
|
||
<div class="post-meta"><span title='2021-03-18 22:14:21 +0530 IST'>🗓 March 18, 2021</span> · 4 min · 🔖 <a href="/tags/religion"> religion</a> · <a href="/tags/non-fiction"> non-fiction</a> · <a href="/tags/parenting"> parenting</a> · <a href="/tags/favourites"> favourites</a>
|
||
|
||
</div>
|
||
</header>
|
||
<div class="post-content"><p><a href="https://www.goodreads.com/review/show/2833252009">Check it out on Goodreads</a></p>
|
||
<hr>
|
||
<p><img loading="lazy" src="/images/parenting.jpg#center" alt="Parenting Cover" title="Parenting Cover" />
|
||
</p>
|
||
<p>I have had a very curious relationship with religion, although now that I talk to others, it was a much more normal experience than what I led myself to believe. I followed the typical path of receiving a particular religion from my parents (born a “Hindu child”), which had a supporting role in my life up until my late-teenage/early-adolescent years.</p>
|
||
<p>As is the norm for every child brought up in religion, I used to consider myself special believing that I had a “personal relationship” with God. There are so many good things about religion, but this in particular I believe to be the best part - this soothing feeling that somebody is watching over you in times of distress. During my early college years when I lost my faith, I was most afraid of having lost this rescuer of last resort (I wrote a short poem on this <a href="/posts/deference-vs-indifference/">which you can read here</a>). During times of despair, I frequently wondered what would’ve happened had I not been brought up in a religious family.</p>
|
||
<p>This book combines two of the most morally contentious issues that have always puzzled me - Religion and having a child. While I don’t swing to the other extreme of subscribing to <a href="https://en.wikipedia.org/wiki/Antinatalism">antinatalistic</a> views, I do frequently wonder how it is that people don’t question the morality of bringing a sentient being into the world, whose life (to a major extent) will be affected by how they are brought up by their parents. Children are shaped by the identity of their parents during their formative years, and require a significant struggle during their adolescence to be able to make independent decisions of their own. This struggle is more pronounced in matters of faith - an overwhelming majority of children wind up believing in the same gods that their parents believe in.</p>
|
||
<p>What can be done to lessen this automatic behavior so that children are more confident of picking their own battles and faith? This book presents insights from the people who tried to do exactly that.</p>
|
||
<p>It is a wonderful collection of essays from parents who are non-religious and want to bring up their child in an environment which enables them to question the authority and dogma. While just raising them secular doesn’t make them superior to everybody else - bigotry is never dependent on faith - it is the independent exploration that is crucial. The essays deal with nuances of raising children in secular homes, going pretty much against the society, and how to deal with disagreements. Unfortunately, there are few essays in the end which swings the pendulum to the other end, concerned with finding “Humanist” and “Unitarian” communities which I found to be dull, however, the rest of the book remains a pleasant and insightful read.</p>
|
||
<p>My notebook is filled with highlights from the book, but there’s one paragraph in particular that I want to share, which nicely defines the central theme of these essays.</p>
|
||
<blockquote>
|
||
<p>One thread runs throughout this book: Encourage a child to think well, then trust her to do so. Removing religion by no means guarantees kids will think independently and well. Consider religion itself: Kids growing up in a secular home are at the same risk of making uninformed decisions about religion as are those in deeply religious homes. In order to really think for themselves about religion, kids must learn as much as possible about religion as a human cultural expression while being kept free of the sickening idea that they will be rewarded in heaven or punished in hell based on what they decide—a bit of intellectual terrorism we should never inflict on our kids, nor on each other. They must also learn what has been said and thought in opposition to religious ideas. If my kids think independently and well, then end up coming to conclusions different from my own—well, I’d have to consider the possibility that I’ve gotten it all wrong, then. Either way, in order to own and be nourished by their convictions, kids must ultimately come to them independently. Part of our wonderfully complex job as parents is to facilitate that process without controlling it.</p>
|
||
</blockquote>
|
||
<p>I’d highly recommend this book to everyone.</p>
|
||
|
||
|
||
</div>
|
||
|
||
<footer class="post-footer">
|
||
<ul class="post-tags">
|
||
<li><a href="https://www.siddharthagolu.com/tags/religion/">religion</a></li>
|
||
<li><a href="https://www.siddharthagolu.com/tags/non-fiction/">non-fiction</a></li>
|
||
<li><a href="https://www.siddharthagolu.com/tags/parenting/">parenting</a></li>
|
||
<li><a href="https://www.siddharthagolu.com/tags/favourites/">favourites</a></li>
|
||
</ul>
|
||
<nav class="paginav">
|
||
<a class="prev" href="https://www.siddharthagolu.com/posts/reading/annihilation-of-caste/">
|
||
<span class="title">« Prev</span>
|
||
<br>
|
||
<span>Annihilation of Caste(Annotated Edition) by Arundhati Roy</span>
|
||
</a>
|
||
<a class="next" href="https://www.siddharthagolu.com/posts/cinema/winter-sleep/">
|
||
<span class="title">Next »</span>
|
||
<br>
|
||
<span>Winter Sleep (2014) by Nuri Bilge Ceylan</span>
|
||
</a>
|
||
</nav>
|
||
|
||
</footer>
|
||
|
||
<hr>
|
||
<section class="webring">
|
||
<h3 class="header">Articles from blogs I follow around the net</h3>
|
||
<section class="articles">
|
||
|
||
<div class="article">
|
||
<h4 class="title">
|
||
<a href="https://www.lilysthings.org/blog/discord-dialup/" target="_blank" rel="noopener">Dial-up over a Discord Call</a>
|
||
</h4>
|
||
<p class="summary">
|
||
|
||
Comments
|
||
</p>
|
||
<small class="source">
|
||
via <a href="https://lobste.rs/">Lobsters</a>
|
||
</small>
|
||
<small class="date">December 22, 2023</small>
|
||
</div>
|
||
|
||
<div class="article">
|
||
<h4 class="title">
|
||
<a href="https://www.benkuhn.net/newmgr/" target="_blank" rel="noopener">Some mistakes I made as a new manager</a>
|
||
</h4>
|
||
<p class="summary">the trough of zero dopamine • managing the wrong amount • procrastinating on hard questions • indefinitely deferring maintenance • angsting instead of asking</p>
|
||
<small class="source">
|
||
via <a href="https://www.benkuhn.net/">benkuhn.net</a>
|
||
</small>
|
||
<small class="date">April 23, 2023</small>
|
||
</div>
|
||
|
||
<div class="article">
|
||
<h4 class="title">
|
||
<a href="https://www.joelonsoftware.com/2022/12/19/progress-on-the-block-protocol/" target="_blank" rel="noopener">Progress on the Block Protocol</a>
|
||
</h4>
|
||
<p class="summary">Since the 1990s, the web has been a publishing place for human-readable documents. Documents published on the web are in HTML. HTML has a little bit of… Read more "Progress on the Block Protocol"</p>
|
||
<small class="source">
|
||
via <a href="https://www.joelonsoftware.com">Joel on Software</a>
|
||
</small>
|
||
<small class="date">December 19, 2022</small>
|
||
</div>
|
||
|
||
</section>
|
||
<p class="attribution">
|
||
Generated by
|
||
<a href="https://git.sr.ht/~sircmpwn/openring">openring</a>
|
||
</p>
|
||
</section>
|
||
<style>
|
||
.webring .header {
|
||
margin: 0 0 12px;
|
||
}
|
||
.webring .articles {
|
||
display: flex;
|
||
flex-wrap: wrap;
|
||
margin: -0.5rem;
|
||
}
|
||
.webring .title {
|
||
margin: 4px 0 12px;
|
||
}
|
||
.webring .article {
|
||
flex: 1 1 0;
|
||
display: flex;
|
||
flex-direction: column;
|
||
margin: 0.5rem;
|
||
padding: 0.5rem;
|
||
background: var(--openring-bg);
|
||
min-width: 10rem;
|
||
}
|
||
.webring .summary {
|
||
font-size: 0.8rem;
|
||
flex: 1 1 0;
|
||
}
|
||
.webring .attribution {
|
||
text-align: right;
|
||
font-size: 0.8rem;
|
||
color: #555;
|
||
}
|
||
</style>
|
||
<!-- begin comments //-->
|
||
<section id = "isso-thread">
|
||
|
||
</section>
|
||
<!-- end comments //-->
|
||
|
||
</article>
|
||
</main>
|
||
|
||
<footer class="footer">
|
||
<span>© 2024 <a href="https://www.siddharthagolu.com/">Siddhartha Golu</a></span>
|
||
<span>
|
||
Powered by
|
||
<a href="https://gohugo.io/" rel="noopener noreferrer" target="_blank">Hugo</a> &
|
||
<a href="https://github.com/adityatelange/hugo-PaperMod/" rel="noopener" target="_blank">PaperMod</a>
|
||
</span>
|
||
</footer>
|
||
<a href="#top" aria-label="go to top" title="Go to Top (Alt + G)" class="top-link" id="top-link" accesskey="g">
|
||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 6" fill="currentColor">
|
||
<path d="M12 6H0l6-6z" />
|
||
</svg>
|
||
</a>
|
||
|
||
<script>
|
||
let menu = document.getElementById('menu')
|
||
if (menu) {
|
||
menu.scrollLeft = localStorage.getItem("menu-scroll-position");
|
||
menu.onscroll = function () {
|
||
localStorage.setItem("menu-scroll-position", menu.scrollLeft);
|
||
}
|
||
}
|
||
|
||
document.querySelectorAll('a[href^="#"]').forEach(anchor => {
|
||
anchor.addEventListener("click", function (e) {
|
||
e.preventDefault();
|
||
var id = this.getAttribute("href").substr(1);
|
||
if (!window.matchMedia('(prefers-reduced-motion: reduce)').matches) {
|
||
document.querySelector(`[id='${decodeURIComponent(id)}']`).scrollIntoView({
|
||
behavior: "smooth"
|
||
});
|
||
} else {
|
||
document.querySelector(`[id='${decodeURIComponent(id)}']`).scrollIntoView();
|
||
}
|
||
if (id === "top") {
|
||
history.replaceState(null, null, " ");
|
||
} else {
|
||
history.pushState(null, null, `#${id}`);
|
||
}
|
||
});
|
||
});
|
||
|
||
</script>
|
||
<script>
|
||
var mybutton = document.getElementById("top-link");
|
||
window.onscroll = function () {
|
||
if (document.body.scrollTop > 800 || document.documentElement.scrollTop > 800) {
|
||
mybutton.style.visibility = "visible";
|
||
mybutton.style.opacity = "1";
|
||
} else {
|
||
mybutton.style.visibility = "hidden";
|
||
mybutton.style.opacity = "0";
|
||
}
|
||
};
|
||
|
||
</script>
|
||
<script>
|
||
document.getElementById("theme-toggle").addEventListener("click", () => {
|
||
if (document.body.className.includes("dark")) {
|
||
document.body.classList.remove('dark');
|
||
localStorage.setItem("pref-theme", 'light');
|
||
} else {
|
||
document.body.classList.add('dark');
|
||
localStorage.setItem("pref-theme", 'dark');
|
||
}
|
||
})
|
||
|
||
</script>
|
||
<script>
|
||
document.querySelectorAll('pre > code').forEach((codeblock) => {
|
||
const container = codeblock.parentNode.parentNode;
|
||
|
||
const copybutton = document.createElement('button');
|
||
copybutton.classList.add('copy-code');
|
||
copybutton.innerHTML = 'copy';
|
||
|
||
function copyingDone() {
|
||
copybutton.innerHTML = 'copied!';
|
||
setTimeout(() => {
|
||
copybutton.innerHTML = 'copy';
|
||
}, 2000);
|
||
}
|
||
|
||
copybutton.addEventListener('click', (cb) => {
|
||
if ('clipboard' in navigator) {
|
||
navigator.clipboard.writeText(codeblock.textContent);
|
||
copyingDone();
|
||
return;
|
||
}
|
||
|
||
const range = document.createRange();
|
||
range.selectNodeContents(codeblock);
|
||
const selection = window.getSelection();
|
||
selection.removeAllRanges();
|
||
selection.addRange(range);
|
||
try {
|
||
document.execCommand('copy');
|
||
copyingDone();
|
||
} catch (e) { };
|
||
selection.removeRange(range);
|
||
});
|
||
|
||
if (container.classList.contains("highlight")) {
|
||
container.appendChild(copybutton);
|
||
} else if (container.parentNode.firstChild == container) {
|
||
|
||
} else if (codeblock.parentNode.parentNode.parentNode.parentNode.parentNode.nodeName == "TABLE") {
|
||
|
||
codeblock.parentNode.parentNode.parentNode.parentNode.parentNode.appendChild(copybutton);
|
||
} else {
|
||
|
||
codeblock.parentNode.appendChild(copybutton);
|
||
}
|
||
});
|
||
</script>
|
||
</body>
|
||
|
||
</html>
|