-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
142 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import path from 'node:path' | ||
import { fileURLToPath } from 'node:url' | ||
|
||
const __filename = fileURLToPath(import.meta.url) | ||
export const __dirname = path.dirname(__filename) | ||
|
||
export const BLOGPOST_DIR = path.join(__dirname, '../src/blog') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import fs from 'node:fs/promises' | ||
import path from 'node:path' | ||
import { fileURLToPath } from 'node:url' | ||
import { parseArgs } from 'node:util' | ||
import { BLOGPOST_DIR } from './BLOGPOST_DIR.js' | ||
|
||
const __filename = fileURLToPath(import.meta.url) | ||
export const __dirname = path.dirname(__filename) | ||
|
||
const args = parseArgs({ | ||
options: { | ||
title: { | ||
type: 'string', | ||
short: 't' | ||
} | ||
} | ||
}) | ||
|
||
const title = args.values.title | ||
if (!title) { | ||
console.error('Please provide a title for the blog post.') | ||
process.exit(1) | ||
} | ||
|
||
const slug = title.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/(^-|-$)+/g, '') | ||
const currentYear = new Date().getFullYear() | ||
const blogPostDir = path.join(BLOGPOST_DIR, `${currentYear.toString()}/${slug}`) | ||
const readmePath = path.join(blogPostDir, 'README.draft.md') | ||
const imgDir = path.join(blogPostDir, 'img') | ||
|
||
await fs.mkdir(blogPostDir, { recursive: true }) | ||
await fs.mkdir(imgDir, { recursive: true }) | ||
|
||
const frontmatter = `--- | ||
layout: article | ||
title: "${title}" | ||
serif: false | ||
publishDate: "${new Date().toISOString()}" | ||
handlebars: false | ||
--- | ||
Content goes here. | ||
` | ||
|
||
await fs.writeFile(readmePath, frontmatter, 'utf8') | ||
|
||
console.log(`Blog post created at ${readmePath}`) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import fs from 'node:fs/promises' | ||
import path from 'node:path' | ||
import { parseArgs } from 'node:util' | ||
import { BLOGPOST_DIR } from './BLOGPOST_DIR.js' | ||
|
||
const args = parseArgs({ | ||
allowPositionals: true | ||
}) | ||
|
||
const slug = args.positionals[0] | ||
if (!slug) { | ||
console.error('Please provide the slug of the blog post.') | ||
process.exit(1) | ||
} | ||
|
||
const currentYear = new Date().getFullYear() | ||
const readmeDraftPath = path.join(BLOGPOST_DIR, `${currentYear.toString()}/${slug}/README.draft.md`) | ||
const readmePath = path.join(BLOGPOST_DIR, `${currentYear.toString()}/${slug}/README.md`) | ||
|
||
try { | ||
let content = await fs.readFile(readmeDraftPath, 'utf8') | ||
const newPublishDate = new Date().toISOString() | ||
content = content.replace(/publishDate: ".*"/, `publishDate: "${newPublishDate}"`) | ||
|
||
await fs.writeFile(readmeDraftPath, content, 'utf8') | ||
await fs.rename(readmeDraftPath, readmePath) | ||
|
||
console.log(`Draft published and renamed to ${readmePath}`) | ||
} catch (error) { | ||
console.error('Error processing the draft:', error) | ||
process.exit(1) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
--- | ||
layout: article | ||
title: "Discord and 2024" | ||
serif: false | ||
publishDate: "2024-12-25T22:35:01.304Z" | ||
handlebars: true | ||
--- | ||
|
||
It looks like 2024 is about to end and I there haven't been any udpates to Gumcast! Lets remedey that. | ||
|
||
## Join Our Discord | ||
|
||
Gumcast now has a Discord: | ||
|
||
- [#gumcast Discord Chat]({{ vars.discordUrl }}) | ||
|
||
Feel free to join up to ask any questions or report issues with Gumcast, and check out the family of other [HifiWifi](https://hifiwi.fi) products. | ||
|
||
## An Uneventful Year | ||
|
||
Basically nothing happened this year! Gumcast continues to operate as normally, and Gumroad hasn't added any podcasting or RSS features to the core service, so we'll keep the lights on for another year as operational costs remain low. | ||
|
||
## Heard of 🥖 Breadcrum? | ||
|
||
Check out [breadcrum.net](https://breadcrum.net), a bookmarking service that lets you send video and audio from around the web directly to your favorite podcast app. | ||
|
||
![Breadcrum Screenshot](./img/breadcrum.png) | ||
|
||
If you love Gumcast, you’ll enjoy Breadcrum—it makes consuming web content as seamless as enjoying your Gumroad content. Give it a try! | ||
|
||
## Happy 2025 | ||
|
||
Wishing everyone a happy 2025! We hope Gumcast continues to bring you more value from your Gumroad content in the coming year. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/** | ||
* @template T | ||
* @typedef {import('top-bun').PageFunction<T>} PageFunction | ||
*/ | ||
|
||
export const vars = { | ||
title: '2024 Blog Posts', | ||
layout: 'blog-auto-index' | ||
} | ||
|
||
/** | ||
* @type {PageFunction<{ | ||
* title: string | ||
* publishDate: string | ||
* }>} | ||
*/ | ||
export default async function blogIndex2023 () { | ||
return '' | ||
} |