diff --git a/content/bookmarks/a-primer-on-dopamine.md b/content/bookmarks/a-primer-on-dopamine.md index 95843cb3..10e39179 100644 --- a/content/bookmarks/a-primer-on-dopamine.md +++ b/content/bookmarks/a-primer-on-dopamine.md @@ -14,20 +14,20 @@ references: of habit-forming products and that inevitably lead me to the (in)famous neurotransmitter dopamine. 3/ Before we dive into what dopamine does, let''s first make one thing clear: dopamine…' - games-problems: - url: https://invertedpassion.com/games-are-problems-people-pay-to-solve/ - name: Games are problems people pay to solve - rel: +agree +accurate - skimmable: - url: https://invertedpassion.com/why-you-will-skim-this-article/ - name: Why you will skim this article - rel: +agree +accurate dopamine-and-value-of-work: url: https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4696912/ name: Mesolimbic Dopamine Signals the Value of Work + games-problems: + url: https://invertedpassion.com/games-are-problems-people-pay-to-solve/ + rel: +agree +accurate + name: Games are problems people pay to solve + skimmable: + url: https://invertedpassion.com/why-you-will-skim-this-article/ + rel: +agree +accurate + name: Why you will skim this article tags: -- curious - biology +- curious --- I really enjoyed reading about dopamine, desire and pleasure here! It’s worth a read, even if it slightly veers into the “how to abuse this knowledge for personal gain with your new product” space. @@ -151,7 +151,7 @@ I’m not sure I agree that this is _all_ that stories are, but to the extent th --- > Plus, [why everything looks the same now](https://invertedpassion.com/why-you-will-skim-this-article/). -> +> > Hint: that’s because before beating expectations, you have to meet them. I don’t agree with the base premise here, I think this is inverted. You can set yourself apart from expectations & reset them; if you end up looking like others _then_ you have to meet all the expectations folks have of everyone else, but if you can find a niche and be different enough that people roll back their higher-level expectations, then you can carve out some particularly interesting reward. diff --git a/content/bookmarks/cultivating-new-ideas.md b/content/bookmarks/cultivating-new-ideas.md index 143e8652..0b49b1be 100644 --- a/content/bookmarks/cultivating-new-ideas.md +++ b/content/bookmarks/cultivating-new-ideas.md @@ -12,8 +12,8 @@ references: ideas. author: Henrik Karlsson, Johanna Wiberg tags: -- self-help - creativity +- self-help --- @@ -32,4 +32,3 @@ This has also put me to thinking about raising kids; how to ensure there’s alw --- > The songs he’s looking for are the ones that he’s ashamed of liking. - diff --git a/content/bookmarks/neologisms.md b/content/bookmarks/neologisms.md index 05bb5258..e149e8be 100644 --- a/content/bookmarks/neologisms.md +++ b/content/bookmarks/neologisms.md @@ -69,4 +69,3 @@ I love the origins of this phrase; a Ren and Stimpy cartoon where Ren (?) has to I love this concept! It feels like we’re missing it a lot on the web (see [the web’s missing communication faculty](/posts/webs-missing-communication-faculty/)), I fully intend to seek out and recognise people who can be my _epistemic peers_. (Though I think declaring who they are might be a security risk?) - diff --git a/content/bookmarks/the-looking-glass-the-year-of-everyday-risks.md b/content/bookmarks/the-looking-glass-the-year-of-everyday-risks.md index 5eb5f47a..b98f9bb1 100644 --- a/content/bookmarks/the-looking-glass-the-year-of-everyday-risks.md +++ b/content/bookmarks/the-looking-glass-the-year-of-everyday-risks.md @@ -38,4 +38,3 @@ I plan on taking some every day risks this year & always. --- > Aliveness is risk, not comfort. - diff --git a/content/bookmarks/the-tyrany-of-obviousness.md b/content/bookmarks/the-tyrany-of-obviousness.md index ac0c0566..5b91cbb1 100644 --- a/content/bookmarks/the-tyrany-of-obviousness.md +++ b/content/bookmarks/the-tyrany-of-obviousness.md @@ -11,9 +11,9 @@ references: summary: We are stuck in a hell of frictionlessness. author: P.E. Moskowitz tags: +- Miriscient - curious - grief -- Miriscient --- @@ -30,4 +30,3 @@ I think I've certainly trained myself for a frictionless existence, and have (up > there are many forces preventing us from feeling abstractly and confusingly and deeply, and from producing things that help others feel so. I keep finding myself coming back to this thought in particular. I _want_ to feel abstractly and deeply — it feels much more like "living". - diff --git a/tools/import/omnivore/main.go b/tools/import/omnivore/main.go index f09a3e36..bf550a03 100644 --- a/tools/import/omnivore/main.go +++ b/tools/import/omnivore/main.go @@ -56,27 +56,34 @@ var hashtags = regexp.MustCompile(`#\w+`) func outputArticle(article Article, outputDir string) error { slug := kebab(article.Title) - hugoPost, err := os.Create(path.Join(outputDir, fmt.Sprintf("%s.md", slug))) + articlePath := path.Join(outputDir, fmt.Sprintf("%s.md", slug)) + + fm, _ := loadFrontmatter(articlePath) + + hugoPost, err := os.Create(articlePath) if err != nil { return err } - fm := FrontMatter{ - Title: article.Title, - Date: article.BookmarkDate.Format(time.RFC3339), - BookmarkOf: article.OriginalURL, - References: map[string]Ref{ - "bookmark": { - URL: article.OriginalURL, - Type: "entry", - Name: article.OriginalTitle, - Summary: article.OriginalSummary, - Author: article.OriginalAuthor, - }, - }, - Tags: article.Tags, + if fm.Date == "" { + fm.Date = article.BookmarkDate.Format(time.RFC3339) } + fm.Title = article.Title + fm.BookmarkOf = article.OriginalURL + fm.Tags = removeDupes(append(fm.Tags, article.Tags...)) + + if fm.References == nil { + fm.References = make(map[string]Ref) + } + ref := fm.References["bookmark"] + ref.URL = article.OriginalURL + ref.Type = "entry" + ref.Name = article.OriginalTitle + ref.Summary = article.OriginalSummary + ref.Author = article.OriginalAuthor + fm.References["bookmark"] = ref + if !article.PublishDate.IsZero() { fm.PublishDate = article.PublishDate.Format(time.RFC3339) } @@ -96,14 +103,14 @@ func outputArticle(article Article, outputDir string) error { for i, highlight := range article.Highlights { quote := "> " + strings.ReplaceAll(trimQuote(highlight.Quote), "\n", "\n> ") - fmt.Fprint(hugoPost, "\n"+quote+"\n\n") + fmt.Fprint(hugoPost, "\n"+quote+"\n") if highlight.Comment != "" { - fmt.Fprint(hugoPost, linkHashtags(highlight.Comment, fm.Tags)+"\n\n") + fmt.Fprint(hugoPost, "\n"+linkHashtags(highlight.Comment, fm.Tags)+"\n") } if i < len(article.Highlights)-1 { - fmt.Fprint(hugoPost, "---\n") + fmt.Fprint(hugoPost, "\n---\n") } } @@ -112,11 +119,32 @@ func outputArticle(article Article, outputDir string) error { var allBold = regexp.MustCompile(`\*\*([^*]+)\*\*(\W)?`) +func removeDupes(tags []string) []string { + slices.Sort(tags) + return slices.Compact(tags) +} + func trimQuote(quote string) string { noTrail := strings.TrimRight(quote, "\n ") return allBold.ReplaceAllString(noTrail, "$1$2") } +func loadFrontmatter(path string) (FrontMatter, error) { + f, err := os.Open(path) + if err != nil { + return FrontMatter{}, err + } + defer f.Close() + + decoder := yaml.NewDecoder(f) + var fm FrontMatter + if err := decoder.Decode(&fm); err != nil { + return FrontMatter{}, err + } + + return fm, nil +} + func linkHashtags(text string, tags []string) string { return hashtags.ReplaceAllStringFunc(text, func(hashtag string) string { tags = append(tags, hashtag[1:]) @@ -167,7 +195,8 @@ type FrontMatter struct { type Ref struct { URL string `yaml:"url"` - Type string `yaml:"type"` + Rel string `yaml:"rel,omitempty"` + Type string `yaml:"type,omitempty"` Name string `yaml:"name"` Summary string `yaml:"summary,omitempty"` Author string `yaml:"author,omitempty"` @@ -295,7 +324,6 @@ func parseResponse(body []byte) ([]Article, string, error) { } if len(annotation) == 0 { - fmt.Fprintf(os.Stderr, "No annotation for %s\n", articleURL) continue }