diff --git a/content/bookmarks/-playing-chess-in-postscript.md b/content/bookmarks/-playing-chess-in-postscript.md index f29fffc7..28300bf5 100644 --- a/content/bookmarks/-playing-chess-in-postscript.md +++ b/content/bookmarks/-playing-chess-in-postscript.md @@ -17,6 +17,8 @@ tags: - tech - why-not --- +A curious person implements a chess program in an unlikely place: on your printer. + I’m always slightly blown away by people who build something because they want to explore and “why not”, rather than for any particular utility. This project is no exception! It’s been a while since I files this link away for future me to read, and I now conveniently have a printer to be able to try it on, so I’ll definitely be reading the follow up post and trying it out if I can! diff --git a/content/bookmarks/moneylike.md b/content/bookmarks/moneylike.md index d2444e43..f5e53a8f 100644 --- a/content/bookmarks/moneylike.md +++ b/content/bookmarks/moneylike.md @@ -18,6 +18,8 @@ tags: - economics - politics --- +Cory Doctorow describes why money feels so _necessary_, and why cryptocurrencies don’t. + A very interesting read indeed! I’ve not looked into the origins of money before, but Cory’s explanation of the ideas behind _Debt: The First 5,000 Years_ is extremely thought provoking. It certainly explains why money can feel so… oppressive. ### Highlights diff --git a/content/bookmarks/the-web-s-grain.md b/content/bookmarks/the-web-s-grain.md index 1b1461f5..4746636a 100644 --- a/content/bookmarks/the-web-s-grain.md +++ b/content/bookmarks/the-web-s-grain.md @@ -14,7 +14,7 @@ references: summary: A wonderful presentation on the limitations of the web, and how to adapt to them and foster our joy in the web as a medium. I love it! --- - +A wonderful presentation on the limitations of the web, and how to adapt to them and foster our joy in the web as a medium. I love it! ### Highlights diff --git a/tools/import/omnivore/main.go b/tools/import/omnivore/main.go index e8d97712..505e8721 100644 --- a/tools/import/omnivore/main.go +++ b/tools/import/omnivore/main.go @@ -96,7 +96,7 @@ func outputArticle(article Article, outputDir string) error { articlePath = dirArticlePath } - fm, _ := loadFrontmatter(articlePath) + fm, body, _ := loadFrontmatter(articlePath) hugoPost, err := os.Create(articlePath) if err != nil { @@ -107,8 +107,13 @@ func outputArticle(article Article, outputDir string) error { fm.Date = article.BookmarkDate.Format(time.RFC3339) } - summary, body := shared.ExtractSummary(article.OriginalSummary, strings.TrimSpace(article.Annotation)) + if body == "" { + body = strings.TrimSpace(article.Annotation) + } + if fm.Summary == "" { + var summary string + summary, body = shared.ExtractSummary(article.OriginalSummary, body) fm.Summary = summary } @@ -175,20 +180,21 @@ func trimQuote(quote string) string { return allBold.ReplaceAllString(noTrail, "$1$2") } -func loadFrontmatter(path string) (FrontMatter, error) { +func loadFrontmatter(path string) (FrontMatter, string, error) { f, err := os.Open(path) if err != nil { - return FrontMatter{}, err + return FrontMatter{}, "", err } defer f.Close() decoder := yaml.NewDecoder(f) var fm FrontMatter if err := decoder.Decode(&fm); err != nil { - return FrontMatter{}, err + return FrontMatter{}, "", err } - return fm, nil + rest, err := io.ReadAll(f) + return fm, string(rest), err } func linkHashtags(text string, tags []string) string {