mirror of
https://gitlab.com/thelazyoxymoron/siddhartha-golu-website.git
synced 2025-07-27 04:47:59 +02:00
534 lines
22 KiB
HTML
534 lines
22 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>Deference vs. Indifference | Siddhartha Golu</title>
|
||
<meta name="keywords" content="poetry, writing">
|
||
<meta name="description" content="(See this picture on Flickr)
|
||
Deference vs. Indifference There used to be a time
|
||
when things used to be simple.
|
||
I’d wake up, rub my eyes, sit up straight, close my eyes,
|
||
And pray that He will continue to guide me
|
||
as He had done the previous day.
|
||
There used to be a time
|
||
when I used to love the aroma
|
||
of the stick when it burned,
|
||
lighting up my day with the secret enchantments,">
|
||
<meta name="author" content="Siddhartha Golu">
|
||
<link rel="canonical" href="https://www.siddharthagolu.com/posts/deference-vs-indifference/">
|
||
<link crossorigin="anonymous" href="/assets/css/stylesheet.53bb04f4aba62c3f850b0b622140c2cc64a7f75a7f7b0c6acde33a5f70de0244.css" integrity="sha256-U7sE9KumLD+FCwtiIUDCzGSn91p/ewxqzeM6X3DeAkQ=" 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">
|
||
<link rel="alternate" hreflang="en" href="https://www.siddharthagolu.com/posts/deference-vs-indifference/">
|
||
<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><script async defer data-website-id="34ce8dc6-488b-49ee-9a2f-8e70a7009f17" src="https://batman.siddharthagolu.com/batman.js"></script><a rel="me" href="https://fosstodon.org/@thelazyoxymoron" id="mastodon-link"></a>
|
||
<style>
|
||
.mastodon-link {
|
||
display: none;
|
||
}
|
||
</style>
|
||
|
||
|
||
|
||
<meta property="og:title" content="Deference vs. Indifference" />
|
||
<meta property="og:description" content="(See this picture on Flickr)
|
||
Deference vs. Indifference There used to be a time
|
||
when things used to be simple.
|
||
I’d wake up, rub my eyes, sit up straight, close my eyes,
|
||
And pray that He will continue to guide me
|
||
as He had done the previous day.
|
||
There used to be a time
|
||
when I used to love the aroma
|
||
of the stick when it burned,
|
||
lighting up my day with the secret enchantments," />
|
||
<meta property="og:type" content="article" />
|
||
<meta property="og:url" content="https://www.siddharthagolu.com/posts/deference-vs-indifference/" />
|
||
<meta property="og:image" content="https://www.siddharthagolu.com/images/Love_for_mountains.jpeg" />
|
||
<meta property="article:section" content="posts" />
|
||
<meta property="article:published_time" content="2019-03-15T22:27:30+05:30" />
|
||
<meta property="article:modified_time" content="2024-01-27T20:41:04+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/images/Love_for_mountains.jpeg" />
|
||
<meta name="twitter:title" content="Deference vs. Indifference"/>
|
||
<meta name="twitter:description" content="(See this picture on Flickr)
|
||
Deference vs. Indifference There used to be a time
|
||
when things used to be simple.
|
||
I’d wake up, rub my eyes, sit up straight, close my eyes,
|
||
And pray that He will continue to guide me
|
||
as He had done the previous day.
|
||
There used to be a time
|
||
when I used to love the aroma
|
||
of the stick when it burned,
|
||
lighting up my day with the secret enchantments,"/>
|
||
|
||
|
||
<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": "Deference vs. Indifference",
|
||
"item": "https://www.siddharthagolu.com/posts/deference-vs-indifference/"
|
||
}
|
||
]
|
||
}
|
||
</script>
|
||
<script type="application/ld+json">
|
||
{
|
||
"@context": "https://schema.org",
|
||
"@type": "BlogPosting",
|
||
"headline": "Deference vs. Indifference",
|
||
"name": "Deference vs. Indifference",
|
||
"description": "(See this picture on Flickr)\nDeference vs. Indifference There used to be a time\nwhen things used to be simple.\nI\u0026rsquo;d wake up, rub my eyes, sit up straight, close my eyes,\nAnd pray that He will continue to guide me\nas He had done the previous day.\nThere used to be a time\nwhen I used to love the aroma\nof the stick when it burned,\nlighting up my day with the secret enchantments,",
|
||
"keywords": [
|
||
"poetry", "writing"
|
||
],
|
||
"articleBody": "(See this picture on Flickr)\nDeference vs. Indifference There used to be a time\nwhen things used to be simple.\nI’d wake up, rub my eyes, sit up straight, close my eyes,\nAnd pray that He will continue to guide me\nas He had done the previous day.\nThere used to be a time\nwhen I used to love the aroma\nof the stick when it burned,\nlighting up my day with the secret enchantments,\nas if the secrecy itself was the source of my happiness.\nThere used to be a time\nwhen coming home after a bad day,\nI’d sit on my bed and join my hands and close my eyes\nand quietly shed a tear.\nThe statues didn’t move or speak or whisper,\nbut I felt assured that somehow those little stones\nwere the only ones who listened to me\nand answered back.\nBut now,\nI wake up and lie on my bed for hours,\nwatching the fan complete circles after circles after circles,\nas if I was stuck in the middle while everyone else around me\nkept going through life as if it was such an easy task.\nBut now,\nThe smell of the burning stick nauseates my senses,\nthe secret spells make me mad,\nthe constant enchantings feel as if someone lit a person on fire\nwhile they were sleeping.\nBut now,\nwhen I come back home after a bad day,\nto the empty apartment echoing with silence so loud\nI worry my neighbors will start complaining -\nEven crying for hours doesn’t help.\nSometimes I think,\nwhat use is consciousness\nif it doesn’t make you happy but slowly takes away\nwhatever little sanity you had left\nsecond by second.\nSometimes I worry,\nDid I make a mistake in choosing not to follow blindly?\nDoes asking questions that nobody has answers to\nmakes me more alive\nor merely leaves me more broken and naive and stupid?\nIs ignorance really bliss?\nI still go to churches and mosques and temples,\nthe difference being it was deference before,\nand now it’s curiosity about the people who go there\nand indifference to the thing they pray to.\nSometimes I wonder,\nThere really is no answer, is there?\nA poem I wrote when I had troubles accepting myself. Still do, to be honest.\n",
|
||
"wordCount" : "383",
|
||
"inLanguage": "en",
|
||
"image": "https://www.siddharthagolu.com/images/Love_for_mountains.jpeg","datePublished": "2019-03-15T22:27:30+05:30",
|
||
"dateModified": "2024-01-27T20:41:04+05:30",
|
||
"author":[{
|
||
"@type": "Person",
|
||
"name": "Siddhartha Golu"
|
||
}],
|
||
"mainEntityOfPage": {
|
||
"@type": "WebPage",
|
||
"@id": "https://www.siddharthagolu.com/posts/deference-vs-indifference/"
|
||
},
|
||
"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">
|
||
Deference vs. Indifference
|
||
</h1>
|
||
<div class="post-meta"><span title='2019-03-15 22:27:30 +0530 IST'>🗓 March 15, 2019</span> · 2 min · 🔖 <a href="/tags/poetry"> poetry</a> · <a href="/tags/writing"> writing</a>
|
||
|
||
</div>
|
||
</header>
|
||
<div class="post-content"><p><a href="https://www.flickr.com/photos/160696242@N07/46619008205/">(See this picture on Flickr)</a></p>
|
||
<hr>
|
||
<p><img loading="lazy" src="/images/the-solitude.webp#center" alt="Lake cover" title="Lake cover" />
|
||
</p>
|
||
<h2 id="deference-vs-indifference">Deference vs. Indifference<a hidden class="anchor" aria-hidden="true" href="#deference-vs-indifference">#</a></h2>
|
||
<p>There used to be a time<br>
|
||
when things used to be simple.<br>
|
||
I’d wake up, rub my eyes, sit up straight, close my eyes,<br>
|
||
And pray that He will continue to guide me<br>
|
||
as He had done the previous day.<br>
|
||
There used to be a time<br>
|
||
when I used to love the aroma<br>
|
||
of the stick when it burned,<br>
|
||
lighting up my day with the secret enchantments,<br>
|
||
as if the secrecy itself was the source of my happiness.</p>
|
||
<p>There used to be a time<br>
|
||
when coming home after a bad day,<br>
|
||
I’d sit on my bed and join my hands and close my eyes<br>
|
||
and quietly shed a tear.<br>
|
||
The statues didn’t move or speak or whisper,<br>
|
||
but I felt assured that somehow those little stones<br>
|
||
were the only ones who listened to me<br>
|
||
and answered back.</p>
|
||
<p>But now,<br>
|
||
I wake up and lie on my bed for hours,<br>
|
||
watching the fan complete circles after circles after circles,<br>
|
||
as if I was stuck in the middle while everyone else around me<br>
|
||
kept going through life as if it was such an easy task.<br>
|
||
But now,<br>
|
||
The smell of the burning stick nauseates my senses,<br>
|
||
the secret spells make me mad,<br>
|
||
the constant enchantings feel as if someone lit a person on fire<br>
|
||
while they were sleeping.<br>
|
||
But now,<br>
|
||
when I come back home after a bad day,<br>
|
||
to the empty apartment echoing with silence so loud<br>
|
||
I worry my neighbors will start complaining -<br>
|
||
Even crying for hours doesn’t help.</p>
|
||
<p>Sometimes I think,<br>
|
||
what use is consciousness<br>
|
||
if it doesn’t make you happy but slowly takes away<br>
|
||
whatever little sanity you had left<br>
|
||
second by second.<br>
|
||
Sometimes I worry,<br>
|
||
Did I make a mistake in choosing not to follow blindly?<br>
|
||
Does asking questions that nobody has answers to<br>
|
||
makes me more alive<br>
|
||
or merely leaves me more broken and naive and stupid?<br>
|
||
Is ignorance really bliss?</p>
|
||
<p>I still go to churches and mosques and temples,<br>
|
||
the difference being it was deference before,<br>
|
||
and now it’s curiosity about the people who go there<br>
|
||
and indifference to the thing they pray to.</p>
|
||
<p>Sometimes I wonder,<br>
|
||
There really is no answer, is there?</p>
|
||
<hr>
|
||
<p>A poem I wrote when I had troubles accepting myself. Still do, to be honest.</p>
|
||
|
||
|
||
</div>
|
||
<br>
|
||
<details>
|
||
<summary class="post-comment">View comments</summary><script data-isso="https://comments.siddharthagolu.com/" src="https://comments.siddharthagolu.com/js/embed.min.js"></script>
|
||
<section id = "isso-thread"></section>
|
||
|
||
</details>
|
||
|
||
|
||
<footer class="post-footer">
|
||
<ul class="post-tags">
|
||
<li><a href="https://www.siddharthagolu.com/tags/poetry/">Poetry</a></li>
|
||
<li><a href="https://www.siddharthagolu.com/tags/writing/">Writing</a></li>
|
||
</ul>
|
||
<nav class="paginav">
|
||
<a class="prev" href="https://www.siddharthagolu.com/posts/reading/range-a-review/">
|
||
<span class="title">« Prev</span>
|
||
<br>
|
||
<span>Range by David Epstein</span>
|
||
</a>
|
||
<a class="next" href="https://www.siddharthagolu.com/posts/reading/the-course-of-love/">
|
||
<span class="title">Next »</span>
|
||
<br>
|
||
<span>The Course of Love by Alain de Botton</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://adamtooze.substack.com/p/top-links-441-ai-tech-and-the-us" target="_blank" rel="noopener">Top Links 441 AI, tech & the US stock market, South Korean gas, Rafah's destruction and Nestlé coming for your pets. </a>
|
||
</h4>
|
||
<p class="summary">Great links, images and reading from Chartbook newsletter by Adam Tooze</p>
|
||
<small class="source">
|
||
via <a href="https://adamtooze.substack.com">Chartbook</a>
|
||
</small>
|
||
<small class="date">June 7, 2024</small>
|
||
</div>
|
||
|
||
<div class="article">
|
||
<h4 class="title">
|
||
<a href="https://blog.samaltman.com/gpt-4o" target="_blank" rel="noopener">GPT-4o</a>
|
||
</h4>
|
||
<p class="summary">
|
||
There are two things from our announcement today I wanted to highlight.First, a key part of our mission is to put very capable AI tools in the hands of people for free (or at a great price). I am very proud that we’ve made the best model in the worl…</p>
|
||
<small class="source">
|
||
via <a href="https://blog.samaltman.com">Sam Altman</a>
|
||
</small>
|
||
<small class="date">June 7, 2024</small>
|
||
</div>
|
||
|
||
<div class="article">
|
||
<h4 class="title">
|
||
<a href="https://vivekkaul.com/2024/06/03/the-bse-sensex-registers-its-214th-highest-single-day-gain-ever/?utm_source=rss&utm_medium=rss&utm_campaign=the-bse-sensex-registers-its-214th-highest-single-day-gain-ever" target="_blank" rel="noopener">The BSE Sensex registers its 214th highest single day gain ever</a>
|
||
</h4>
|
||
<p class="summary">The BSE Sensex–India’s most popular stock market index–closed the day today at an all-time-high of 76,468.78 points, a gain of 2,507.47 points from where it closed on Friday (May 31, 2024). It’s the highest gain single day gain that the Sensex has seen–of…</p>
|
||
<small class="source">
|
||
via <a href="https://vivekkaul.com">Vivek Kaul</a>
|
||
</small>
|
||
<small class="date">June 3, 2024</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>
|
||
|
||
|
||
</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>
|