Skip to content

Instantly share code, notes, and snippets.

@quantumgardener
quantumgardener / __unpublish.txt
Created September 26, 2025 00:26
Set all notes in folder to be unpublished using Quartz. Requires Obsidian Templater. Create as __unpublish.md. See https://quantumgardener.info/notes/protecting-what's-published for more information.
<%*
// Cycle through all notes in the named folder and explicitly
// disable publishing
const folder = await tp.system.prompt("Root folder to unpublish (case sensitive)")
let filesUnpublished = 0
let totalFiles = 0
new Notice("Beginning unpublish")
@quantumgardener
quantumgardener / __publish.txt
Last active September 26, 2025 00:27
Set all notes in folder to be published using Quartz. Requires Obsidian Templater. Create as __publish.md. See https://quantumgardener.info/notes/protecting-what's-published for more information.
<%*
// Cycle through all notes in the named folder and explicitly
// enable publishing
const folder = await tp.system.prompt("Root folder to publish (case sensitive)")
let filesPublished = 0
let totalFiles = 0
new Notice("Beginning publish")
@quantumgardener
quantumgardener / unpublish.txt
Last active September 26, 2025 00:21
Set note to be unpublished using Quartz. Requires Obsidian Templater. Create as unpublish.md. See https://quantumgardener.info/notes/protecting-what's-published for more information.
<%*
// Sets the publish flag so that the note can be IS NOT published on the site
// true = publish
// false or empty = filter out
//
// Needs an explicit action to set. Only in the case of [[blog_]] is it set
// automatically
(async function() {
var date = moment().local();
@quantumgardener
quantumgardener / publish.txt
Last active September 26, 2025 00:18
Set note to be published using Quartz. Requires Obsidian Templater. Create as publish.md. See https://quantumgardener.info/notes/protecting-what's-published for more information.
<%*
// Sets the publish flag so that the note can be published on the site
// true = publish
// false or empty = filter out
//
// Needs an explicit action to set. Only in the case of [[blog_]] is it set
// automatically
(async function() {
var date = moment().local();
@quantumgardener
quantumgardener / conform_source.js
Last active December 30, 2024 23:25
Template to conform the properties and filename of a source based on information in existing properties
<%*
(async function() {
var date = moment().local();
const file = tp.file.find_tfile(tp.file.path(true));
await app.fileManager.processFrontMatter(file, async (frontmatter) => {
let allSurnames = '';
let title = '';
@quantumgardener
quantumgardener / person.js
Last active August 27, 2024 05:57
Obsidian dataview: List items to discuss with a person, items waiting for and meetings held.
```dataviewjs
let pg = dv.current();
dv.paragraph("---")
dv.header(2, "Items to discuss with " + pg.file.name)
dv.taskList(dv.pages().file.tasks
.where(t => !t.completed && t.text.includes('#agenda') && t.text.includes(pg.file.name)));
dv.paragraph("---")
@quantumgardener
quantumgardener / organisation.js
Created August 27, 2024 05:55
Obsidian Dataview: List open and closed projects for an organisation, list meetings held, list current/past employees
```dataviewjs
let pg = dv.current();
dv.header(2, "Projects")
dv.paragraph("")
const activeprojects = dv.pages("#project and #state/active")
.where(p => dv.array(p.entity).includes(pg.file.link))
if(activeprojects.length > 0) {
@quantumgardener
quantumgardener / monthly-note.js
Created August 27, 2024 03:46
Obsidian Dataview - Display meetings held, projects started/ended, weekly reviews for the month
```dataviewjs
let pg = dv.current();
const meetings = dv.pages("#meeting-note")
.where(p => p.file.name != "meeting")
.where(p => dv.func.dateformat(p.datetime,"yyyy-MM") == pg.file.name);
if(meetings.length > 0) {
dv.header(2,"Meetings Held")