From a3353bca2bead8bc0ed2d2315a4587892ac1c3d5 Mon Sep 17 00:00:00 2001
From: Anmol Pandita <39385082+anmolpandita1@users.noreply.github.com>
Date: Sat, 25 Jun 2022 03:09:37 +0530
Subject: [PATCH] fix: clean
---
CODE_OF_CONDUCT.md | 93 ----
LICENSE.txt | 21 -
Makefile | 20 -
README.md | 17 -
assets/indices/.gitkeep | 0
assets/js/darkmode.js | 29 -
assets/js/graph.js | 270 ----------
assets/js/popover.js | 58 --
assets/js/router.js | 26 -
assets/js/search.js | 261 ---------
assets/styles/base.scss | 595 ---------------------
assets/styles/custom.scss | 24 -
assets/styles/darkmode.scss | 44 --
assets/styles/syntax.scss | 99 ----
config.toml | 33 --
content/Commandline.md | 0
content/_index.md | 11 -
content/notes/vim.md | 10 -
content/private/private-note.md | 5 -
content/templates/post.md | 4 -
data/config.yaml | 19 -
data/graphConfig.yaml | 37 --
layouts/404.html | 16 -
layouts/_default/_markup/render-image.html | 8 -
layouts/_default/_markup/render-link.html | 16 -
layouts/_default/baseof.html | 10 -
layouts/_default/section.html | 24 -
layouts/_default/single.html | 32 --
layouts/_default/taxonomy.html | 33 --
layouts/_default/term.html | 24 -
layouts/index.html | 25 -
layouts/partials/backlinks.html | 30 --
layouts/partials/contact.html | 14 -
layouts/partials/darkmode.html | 15 -
layouts/partials/footer.html | 16 -
layouts/partials/footerIndex.html | 24 -
layouts/partials/graph.html | 18 -
layouts/partials/head.html | 125 -----
layouts/partials/katex.html | 5 -
layouts/partials/page-list.html | 21 -
layouts/partials/recent.html | 12 -
layouts/partials/search.html | 10 -
layouts/partials/textprocessing.html | 60 ---
layouts/partials/toc.html | 8 -
static/icon.png | Bin 17368 -> 0 bytes
45 files changed, 2222 deletions(-)
delete mode 100644 CODE_OF_CONDUCT.md
delete mode 100644 LICENSE.txt
delete mode 100644 Makefile
delete mode 100644 README.md
delete mode 100644 assets/indices/.gitkeep
delete mode 100644 assets/js/darkmode.js
delete mode 100644 assets/js/graph.js
delete mode 100644 assets/js/popover.js
delete mode 100644 assets/js/router.js
delete mode 100644 assets/js/search.js
delete mode 100644 assets/styles/base.scss
delete mode 100644 assets/styles/custom.scss
delete mode 100644 assets/styles/darkmode.scss
delete mode 100644 assets/styles/syntax.scss
delete mode 100644 config.toml
delete mode 100644 content/Commandline.md
delete mode 100644 content/_index.md
delete mode 100644 content/notes/vim.md
delete mode 100644 content/private/private-note.md
delete mode 100644 content/templates/post.md
delete mode 100644 data/config.yaml
delete mode 100644 data/graphConfig.yaml
delete mode 100644 layouts/404.html
delete mode 100644 layouts/_default/_markup/render-image.html
delete mode 100644 layouts/_default/_markup/render-link.html
delete mode 100644 layouts/_default/baseof.html
delete mode 100644 layouts/_default/section.html
delete mode 100644 layouts/_default/single.html
delete mode 100644 layouts/_default/taxonomy.html
delete mode 100644 layouts/_default/term.html
delete mode 100644 layouts/index.html
delete mode 100644 layouts/partials/backlinks.html
delete mode 100644 layouts/partials/contact.html
delete mode 100644 layouts/partials/darkmode.html
delete mode 100644 layouts/partials/footer.html
delete mode 100644 layouts/partials/footerIndex.html
delete mode 100644 layouts/partials/graph.html
delete mode 100644 layouts/partials/head.html
delete mode 100644 layouts/partials/katex.html
delete mode 100644 layouts/partials/page-list.html
delete mode 100644 layouts/partials/recent.html
delete mode 100644 layouts/partials/search.html
delete mode 100644 layouts/partials/textprocessing.html
delete mode 100644 layouts/partials/toc.html
delete mode 100644 static/icon.png
diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md
deleted file mode 100644
index c624fd59e..000000000
--- a/CODE_OF_CONDUCT.md
+++ /dev/null
@@ -1,93 +0,0 @@
-# Citizen Code of Conduct
-
-## 1. Purpose
-
-A primary goal of the Quartz community is to be inclusive to the largest number of contributors, with the most varied and diverse backgrounds possible. As such, we are committed to providing a friendly, safe and welcoming environment for all, regardless of gender, sexual orientation, ability, ethnicity, socioeconomic status, and religion (or lack thereof).
-
-This code of conduct outlines our expectations for all those who participate in our community, as well as the consequences for unacceptable behavior.
-
-We invite all those who participate in the Quartz community to help us create safe and positive experiences for everyone.
-
-## 2. Open [Source/Culture/Tech] Citizenship
-
-A supplemental goal of this Code of Conduct is to increase open [source/culture/tech] citizenship by encouraging participants to recognize and strengthen the relationships between our actions and their effects on our community.
-
-Communities mirror the societies in which they exist and positive action is essential to counteract the many forms of inequality and abuses of power that exist in society.
-
-If you see someone who is making an extra effort to ensure our community is welcoming, friendly, and encourages all participants to contribute to the fullest extent, we want to know.
-
-## 3. Expected Behavior
-
-The following behaviors are expected and requested of all community members:
-
- * Participate in an authentic and active way. In doing so, you contribute to the health and longevity of this community.
- * Exercise consideration and respect in your speech and actions.
- * Attempt collaboration before conflict.
- * Refrain from demeaning, discriminatory, or harassing behavior and speech.
- * Be mindful of your surroundings and of your fellow participants. Alert community leaders if you notice a dangerous situation, someone in distress, or violations of this Code of Conduct, even if they seem inconsequential.
- * Remember that community event venues may be shared with members of the public; please be respectful to all patrons of these locations.
-
-## 4. Unacceptable Behavior
-
-The following behaviors are considered harassment and are unacceptable within our community:
-
- * Violence, threats of violence or violent language directed against another person.
- * Sexist, racist, homophobic, transphobic, ableist or otherwise discriminatory jokes and language.
- * Posting or displaying sexually explicit or violent material.
- * Posting or threatening to post other people's personally identifying information ("doxing").
- * Personal insults, particularly those related to gender, sexual orientation, race, religion, or disability.
- * Inappropriate photography or recording.
- * Inappropriate physical contact. You should have someone's consent before touching them.
- * Unwelcome sexual attention. This includes, sexualized comments or jokes; inappropriate touching, groping, and unwelcomed sexual advances.
- * Deliberate intimidation, stalking or following (online or in person).
- * Advocating for, or encouraging, any of the above behavior.
- * Sustained disruption of community events, including talks and presentations.
-
-## 5. Weapons Policy
-
-No weapons will be allowed at Quartz community events, community spaces, or in other spaces covered by the scope of this Code of Conduct. Weapons include but are not limited to guns, explosives (including fireworks), and large knives such as those used for hunting or display, as well as any other item used for the purpose of causing injury or harm to others. Anyone seen in possession of one of these items will be asked to leave immediately, and will only be allowed to return without the weapon. Community members are further expected to comply with all state and local laws on this matter.
-
-## 6. Consequences of Unacceptable Behavior
-
-Unacceptable behavior from any community member, including sponsors and those with decision-making authority, will not be tolerated.
-
-Anyone asked to stop unacceptable behavior is expected to comply immediately.
-
-If a community member engages in unacceptable behavior, the community organizers may take any action they deem appropriate, up to and including a temporary ban or permanent expulsion from the community without warning (and without refund in the case of a paid event).
-
-## 7. Reporting Guidelines
-
-If you are subject to or witness unacceptable behavior, or have any other concerns, please notify a community organizer as soon as possible. j.zhao2k19@gmail.com.
-
-
-
-Additionally, community organizers are available to help community members engage with local law enforcement or to otherwise help those experiencing unacceptable behavior feel safe. In the context of in-person events, organizers will also provide escorts as desired by the person experiencing distress.
-
-## 8. Addressing Grievances
-
-If you feel you have been falsely or unfairly accused of violating this Code of Conduct, you should notify @jackyzha0 with a concise description of your grievance. Your grievance will be handled in accordance with our existing governing policies.
-
-
-## 9. Scope
-
-We expect all community participants (contributors, paid or otherwise; sponsors; and other guests) to abide by this Code of Conduct in all community venues--online and in-person--as well as in all one-on-one communications pertaining to community business.
-
-This code of conduct and its related procedures also applies to unacceptable behavior occurring outside the scope of community activities when such behavior has the potential to adversely affect the safety and well-being of community members.
-
-## 10. Contact info
-
-j.zhao2k19@gmail.com
-
-## 11. License and attribution
-
-The Citizen Code of Conduct is distributed by [Stumptown Syndicate](http://stumptownsyndicate.org) under a [Creative Commons Attribution-ShareAlike license](http://creativecommons.org/licenses/by-sa/3.0/).
-
-Portions of text derived from the [Django Code of Conduct](https://www.djangoproject.com/conduct/) and the [Geek Feminism Anti-Harassment Policy](http://geekfeminism.wikia.com/wiki/Conference_anti-harassment/Policy).
-
-_Revision 2.3. Posted 6 March 2017._
-
-_Revision 2.2. Posted 4 February 2016._
-
-_Revision 2.1. Posted 23 June 2014._
-
-_Revision 2.0, adopted by the [Stumptown Syndicate](http://stumptownsyndicate.org) board on 10 January 2013. Posted 17 March 2013._
diff --git a/LICENSE.txt b/LICENSE.txt
deleted file mode 100644
index 147e2ca14..000000000
--- a/LICENSE.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-MIT License
-
-Copyright (c) 2021 jackyzha0
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
diff --git a/Makefile b/Makefile
deleted file mode 100644
index 0d29bdacf..000000000
--- a/Makefile
+++ /dev/null
@@ -1,20 +0,0 @@
-.DEFAULT_GOAL := serve
-
-help: ## Show all Makefile targets
- @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
-
-update: ## Update Quartz to the latest version on Github
- go install github.com/jackyzha0/hugo-obsidian@latest
- @git remote show upstream || (echo "remote 'upstream' not present, setting 'upstream'" && git remote add upstream https://github.com/jackyzha0/quartz.git)
- git fetch upstream
- git log --oneline --decorate --graph ..upstream/hugo
- git checkout -p upstream/hugo -- layouts .github Makefile assets/js assets/styles/base.scss assets/styles/darkmode.scss config.toml data
-
-update-force: ## Forcefully pull all changes and don't ask to patch
- go install github.com/jackyzha0/hugo-obsidian@latest
- @git remote show upstream || (echo "remote 'upstream' not present, setting 'upstream'" && git remote add upstream https://github.com/jackyzha0/quartz.git)
- git fetch upstream
- git checkout upstream/hugo -- layouts .github Makefile assets/js assets/styles/base.scss assets/styles/darkmode.scss config.toml data
-
-serve: ## Serve Quartz locally
- hugo-obsidian -input=content -output=assets/indices -index -root=. && hugo server --enableGitInfo
diff --git a/README.md b/README.md
deleted file mode 100644
index 125514a3f..000000000
--- a/README.md
+++ /dev/null
@@ -1,17 +0,0 @@
-# Quartz
-
-Host your second brain and [digital garden](https://jzhao.xyz/posts/digital-gardening) for free. Quartz features
-
-1. Extremely fast full-text search by pressing `Ctrl` + `k`
-2. Customizable and hackable design based on Hugo
-3. Automatically generated backlinks, link previews, and local graph
-4. Built-in CJK + Latex Support
-5. Support for both Markdown Links and Wikilinks
-
-> “[One] who works with the door open gets all kinds of interruptions, but [they] also occasionally gets clues as to what the world is and what might be important.” — Richard Hamming
-
-🔗 Get Started: https://quartz.jzhao.xyz/
-
-*Quartz Example Screenshot*
-
-[Join the Discord Community](https://discord.gg/cRFFHYye7t)
diff --git a/assets/indices/.gitkeep b/assets/indices/.gitkeep
deleted file mode 100644
index e69de29bb..000000000
diff --git a/assets/js/darkmode.js b/assets/js/darkmode.js
deleted file mode 100644
index d95a281ac..000000000
--- a/assets/js/darkmode.js
+++ /dev/null
@@ -1,29 +0,0 @@
-const userPref = window.matchMedia('(prefers-color-scheme: light)').matches ? 'light' : 'dark'
-const currentTheme = localStorage.getItem('theme') ?? userPref
-
-if (currentTheme) {
- document.documentElement.setAttribute('saved-theme', currentTheme);
-}
-
-const switchTheme = (e) => {
- if (e.target.checked) {
- document.documentElement.setAttribute('saved-theme', 'dark')
- localStorage.setItem('theme', 'dark')
- }
- else {
- document.documentElement.setAttribute('saved-theme', 'light')
- localStorage.setItem('theme', 'light')
- }
-}
-
-window.addEventListener('DOMContentLoaded', () => {
- // Darkmode toggle
- const toggleSwitch = document.querySelector('#darkmode-toggle')
-
- // listen for toggle
- toggleSwitch.addEventListener('change', switchTheme, false)
-
- if (currentTheme === 'dark') {
- toggleSwitch.checked = true
- }
-})
diff --git a/assets/js/graph.js b/assets/js/graph.js
deleted file mode 100644
index 174d4946d..000000000
--- a/assets/js/graph.js
+++ /dev/null
@@ -1,270 +0,0 @@
-async function drawGraph(baseUrl, isHome, pathColors, graphConfig) {
-
- let {
- depth,
- enableDrag,
- enableLegend,
- enableZoom,
- opacityScale,
- scale,
- repelForce,
- fontSize} = graphConfig;
-
- const container = document.getElementById("graph-container")
- const { index, links, content } = await fetchData
-
- // Use .pathname to remove hashes / searchParams / text fragments
- const cleanUrl = window.location.origin + window.location.pathname
-
- const curPage = cleanUrl.replace(/\/$/g, "").replace(baseUrl, "")
-
- const parseIdsFromLinks = (links) => [
- ...new Set(links.flatMap((link) => [link.source, link.target])),
- ]
-
- // Links is mutated by d3. We want to use links later on, so we make a copy and pass that one to d3
- // Note: shallow cloning does not work because it copies over references from the original array
- const copyLinks = JSON.parse(JSON.stringify(links))
-
- const neighbours = new Set()
- const wl = [curPage || "/", "__SENTINEL"]
- if (depth >= 0) {
- while (depth >= 0 && wl.length > 0) {
- // compute neighbours
- const cur = wl.shift()
- if (cur === "__SENTINEL") {
- depth--
- wl.push("__SENTINEL")
- } else {
- neighbours.add(cur)
- const outgoing = index.links[cur] || []
- const incoming = index.backlinks[cur] || []
- wl.push(...outgoing.map((l) => l.target), ...incoming.map((l) => l.source))
- }
- }
- } else {
- parseIdsFromLinks(copyLinks).forEach((id) => neighbours.add(id))
- }
-
- const data = {
- nodes: [...neighbours].map((id) => ({ id })),
- links: copyLinks.filter((l) => neighbours.has(l.source) && neighbours.has(l.target)),
- }
-
- const color = (d) => {
- if (d.id === curPage || (d.id === "/" && curPage === "")) {
- return "var(--g-node-active)"
- }
-
- for (const pathColor of pathColors) {
- const path = Object.keys(pathColor)[0]
- const colour = pathColor[path]
- if (d.id.startsWith(path)) {
- return colour
- }
- }
-
- return "var(--g-node)"
- }
-
- const drag = (simulation) => {
- function dragstarted(event, d) {
- if (!event.active) simulation.alphaTarget(1).restart()
- d.fx = d.x
- d.fy = d.y
- }
-
- function dragged(event, d) {
- d.fx = event.x
- d.fy = event.y
- }
-
- function dragended(event, d) {
- if (!event.active) simulation.alphaTarget(0)
- d.fx = null
- d.fy = null
- }
-
- const noop = () => {}
- return d3
- .drag()
- .on("start", enableDrag ? dragstarted : noop)
- .on("drag", enableDrag ? dragged : noop)
- .on("end", enableDrag ? dragended : noop)
- }
-
- const height = Math.max(container.offsetHeight, isHome ? 500 : 250)
- const width = container.offsetWidth
-
- const simulation = d3
- .forceSimulation(data.nodes)
- .force("charge", d3.forceManyBody().strength(-100 * repelForce))
- .force(
- "link",
- d3
- .forceLink(data.links)
- .id((d) => d.id)
- .distance(40),
- )
- .force("center", d3.forceCenter())
-
- const svg = d3
- .select("#graph-container")
- .append("svg")
- .attr("width", width)
- .attr("height", height)
- .attr('viewBox', [-width / 2 * 1 / scale, -height / 2 * 1 / scale, width * 1 / scale, height * 1 / scale])
-
- if (enableLegend) {
- const legend = [{ Current: "var(--g-node-active)" }, { Note: "var(--g-node)" }, ...pathColors]
- legend.forEach((legendEntry, i) => {
- const key = Object.keys(legendEntry)[0]
- const colour = legendEntry[key]
- svg
- .append("circle")
- .attr("cx", -width / 2 + 20)
- .attr("cy", height / 2 - 30 * (i + 1))
- .attr("r", 6)
- .style("fill", colour)
- svg
- .append("text")
- .attr("x", -width / 2 + 40)
- .attr("y", height / 2 - 30 * (i + 1))
- .text(key)
- .style("font-size", "15px")
- .attr("alignment-baseline", "middle")
- })
- }
-
- // draw links between nodes
- const link = svg
- .append("g")
- .selectAll("line")
- .data(data.links)
- .join("line")
- .attr("class", "link")
- .attr("stroke", "var(--g-link)")
- .attr("stroke-width", 2)
- .attr("data-source", (d) => d.source.id)
- .attr("data-target", (d) => d.target.id)
-
- // svg groups
- const graphNode = svg.append("g").selectAll("g").data(data.nodes).enter().append("g")
-
- // calculate radius
- const nodeRadius = (d) => {
- const numOut = index.links[d.id]?.length || 0
- const numIn = index.backlinks[d.id]?.length || 0
- return 3 + (numOut + numIn) / 4
- }
-
- // draw individual nodes
- const node = graphNode
- .append("circle")
- .attr("class", "node")
- .attr("id", (d) => d.id)
- .attr("r", nodeRadius)
- .attr("fill", color)
- .style("cursor", "pointer")
- .on("click", (_, d) => {
- // SPA navigation
- window.Million.navigate(new URL(`${baseUrl}${decodeURI(d.id).replace(/\s+/g, "-")}/`), ".singlePage")
- })
- .on("mouseover", function (_, d) {
- d3.selectAll(".node").transition().duration(100).attr("fill", "var(--g-node-inactive)")
-
- const neighbours = parseIdsFromLinks([
- ...(index.links[d.id] || []),
- ...(index.backlinks[d.id] || []),
- ])
- const neighbourNodes = d3.selectAll(".node").filter((d) => neighbours.includes(d.id))
- const currentId = d.id
- window.Million.prefetch(new URL(`${baseUrl}${decodeURI(d.id).replace(/\s+/g, "-")}/`))
- const linkNodes = d3
- .selectAll(".link")
- .filter((d) => d.source.id === currentId || d.target.id === currentId)
-
- // highlight neighbour nodes
- neighbourNodes.transition().duration(200).attr("fill", color)
-
- // highlight links
- linkNodes.transition().duration(200).attr("stroke", "var(--g-link-active)")
-
- const bigFont = fontSize*1.5
-
- // show text for self
- d3.select(this.parentNode)
- .raise()
- .select("text")
- .transition()
- .duration(200)
- .attr('opacityOld', d3.select(this.parentNode).select('text').style("opacity"))
- .style('opacity', 1)
- .style('font-size', bigFont+'em')
- .attr('dy', d => nodeRadius(d) + 20 + 'px') // radius is in px
- })
- .on("mouseleave", function (_, d) {
- d3.selectAll(".node").transition().duration(200).attr("fill", color)
-
- const currentId = d.id
- const linkNodes = d3
- .selectAll(".link")
- .filter((d) => d.source.id === currentId || d.target.id === currentId)
-
- linkNodes.transition().duration(200).attr("stroke", "var(--g-link)")
-
- d3.select(this.parentNode)
- .select("text")
- .transition()
- .duration(200)
- .style('opacity', d3.select(this.parentNode).select('text').attr("opacityOld"))
- .style('font-size', fontSize+'em')
- .attr('dy', d => nodeRadius(d) + 8 + 'px') // radius is in px
- })
- .call(drag(simulation))
-
- // draw labels
- const labels = graphNode
- .append("text")
- .attr("dx", 0)
- .attr("dy", (d) => nodeRadius(d) + 8 + "px")
- .attr("text-anchor", "middle")
- .text((d) => content[d.id]?.title || d.id.replace("-", " "))
- .style('opacity', (opacityScale - 1) / 3.75)
- .style("pointer-events", "none")
- .style('font-size', fontSize+'em')
- .raise()
- .call(drag(simulation))
-
- // set panning
-
- if (enableZoom) {
- svg.call(
- d3
- .zoom()
- .extent([
- [0, 0],
- [width, height],
- ])
- .scaleExtent([0.25, 4])
- .on("zoom", ({ transform }) => {
- link.attr("transform", transform)
- node.attr("transform", transform)
- const scale = transform.k * opacityScale;
- const scaledOpacity = Math.max((scale - 1) / 3.75, 0)
- labels.attr("transform", transform).style("opacity", scaledOpacity)
- }),
- )
- }
-
- // progress the simulation
- simulation.on("tick", () => {
- link
- .attr("x1", (d) => d.source.x)
- .attr("y1", (d) => d.source.y)
- .attr("x2", (d) => d.target.x)
- .attr("y2", (d) => d.target.y)
- node.attr("cx", (d) => d.x).attr("cy", (d) => d.y)
- labels.attr("x", (d) => d.x).attr("y", (d) => d.y)
- })
-}
diff --git a/assets/js/popover.js b/assets/js/popover.js
deleted file mode 100644
index 494cd84e1..000000000
--- a/assets/js/popover.js
+++ /dev/null
@@ -1,58 +0,0 @@
-function htmlToElement(html) {
- const template = document.createElement("template")
- html = html.trim()
- template.innerHTML = html
- return template.content.firstChild
-}
-
-function initPopover(baseURL, useContextualBacklinks, renderLatex) {
- const basePath = baseURL.replace(window.location.origin, "")
- fetchData.then(({ content }) => {
- const links = [...document.getElementsByClassName("internal-link")]
- links
- .filter(li => li.dataset.src || (li.dataset.idx && useContextualBacklinks))
- .forEach(li => {
- var el
- if (li.dataset.ctx) {
- const linkDest = content[li.dataset.src]
- const popoverElement = `