{"id":21897860,"url":"https://github.com/benjifs/micropub","last_synced_at":"2025-10-15T05:15:41.975Z","repository":{"id":45219602,"uuid":"411143510","full_name":"benjifs/micropub","owner":"benjifs","description":"Serverless Micropub and media endpoints to publish to static site","archived":false,"fork":false,"pushed_at":"2025-08-18T19:23:03.000Z","size":1113,"stargazers_count":42,"open_issues_count":0,"forks_count":6,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-09-20T22:34:37.302Z","etag":null,"topics":["indieweb","lambda","micropub","netlify","serverless"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/benjifs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-09-28T05:02:57.000Z","updated_at":"2025-09-07T14:20:16.000Z","dependencies_parsed_at":"2024-01-14T07:48:11.475Z","dependency_job_id":"d1f71a92-cc27-4446-9833-927201749730","html_url":"https://github.com/benjifs/micropub","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/benjifs/micropub","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benjifs%2Fmicropub","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benjifs%2Fmicropub/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benjifs%2Fmicropub/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benjifs%2Fmicropub/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/benjifs","download_url":"https://codeload.github.com/benjifs/micropub/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benjifs%2Fmicropub/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279052686,"owners_count":26093984,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-15T02:00:07.814Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["indieweb","lambda","micropub","netlify","serverless"],"created_at":"2024-11-28T14:20:07.023Z","updated_at":"2025-10-15T05:15:41.970Z","avatar_url":"https://github.com/benjifs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# micropub\n\nThis project allows you to create a serverless [Micropub](https://indieweb.org/Micropub)\nand [media endpoint](https://www.w3.org/TR/micropub/#media-endpoint) which can add\nfiles to your static sites' repository. After setup, you can use any [Micropub Client](https://indieweb.org/Micropub/Clients)\nto add posts to your site. Tested with [Eleventy](https://www.11ty.dev/) and [Hugo](https://gohugo.io/).\n\nTo run this, checkout the [serverless-micropub](https://github.com/benjifs/serverless-micropub)\nrepository which provides a basic working example to get micropub setup using [Netlify functions](https://docs.netlify.com/build/functions/overview/).\n\n## Install\n\n`npm install @benjifs/micropub`\n\n## Usage\n\n```js\nimport MicropubEndpoint from '@benjifs/micropub'\nimport GitHubStore from '@benjifs/github-store'\n\nconst {\n\tME, TOKEN_ENDPOINT,\n\tGITHUB_TOKEN, GITHUB_USER, GITHUB_REPO,\n} = process.env\n\nexport const micropub = new MicropubEndpoint({\n\tstore: new GitHubStore({\n\t\ttoken: GITHUB_TOKEN,\n\t\tuser: GITHUB_USER,\n\t\trepo: GITHUB_REPO,\n\t}),\n\tme: ME,\n\ttokenEndpoint: TOKEN_ENDPOINT,\n})\n\nexport default async (req) =\u003e micropub.micropubHandler(req)\n```\n\n## Configuration\n\nThe following options can be added when initializing this project:\n\n### `me` (Required)\nURL for your site with trailing slash\n\n```js\nme: 'https://example.com/'\n```\n\n### `tokenEndpoint` (Required)\n[Token endpoint](https://indieauth.spec.indieweb.org/#token-endpoint) to verify the access token submitted.\n\n```js\ntokenEndpoint: 'https://auth.example.com/token'\n```\n\n### `contentDir`\nThe main directory where your posts will be added to.\n\n```js\ncontentDir: 'src' // Default value\n```\n\n### `mediaDir`\nThe directory where your media endpoint will add files to.\n\n```js\nmediaDir: 'uploads' // Default value\n```\n\n### `translateProps`\n[11ty](https://11ty.dev) uses different naming for properties (eg. name -\u003e title,\ncategory -\u003e tags). Settings this value to `true` (default) makes sure that these\nproperties are translated between what 11ty and the expected valid microformats.\n\n```js\ntranslateProps: true // Default value\n```\n\n### `formatSlug`\nYou can configure if you want your posts of a specific type to go into a different\ndirectory. For example, you can configure all posts regardless of type to go into\nthe same directory or all posts of type `note` and `reply` to go into a `notes`\ndirectory.\n\n```js\nformatSlug: (type, slug) =\u003e `${type}/${slug}` // Default value\n```\n\n### `formatFilename`\nUse if you do not use markdown as your file types.\n\n```js\nformatFilename: (dir, slug) =\u003e `${dir}/${slug}.md` // Default value\n```\n\n### `mediaFilename`\nFile name for uploaded files. Can be useful if you want the filenames to share\na common prefix, or to use a date format other than milliseconds.\n\n```js\nmediaFilename: (mediaDir, filename) =\u003e `${mediaDir}/${timestamp}_${filename}` // Default value\n```\n\n### `config.media-endpoint`\nURL for your media endpoint. If not configured, Micropub clients will not know the\nendpoint exists.\n\nSee [3.6.1 Discovery](https://micropub.spec.indieweb.org/#discovery).\n\n```js\nconfig: {\n\t...\n\t'media-endpoint': 'https://micropub.example.com/media',\n\t...\n}\n```\n\n### `config.syndicate-to`\nSyndicate target options.\n\nSee [3.7.3 Syndication Targets](https://micropub.spec.indieweb.org/#syndication-targets).\n\n```js\nconfig: {\n\t...\n\t'syndicate-to': [\n\t\t{ uid: 'https://fed.brid.gy/', name: 'w/ Bridgy Fed', checked: true },\n\t],\n\t...\n}\n```\n\n### `config.post-types`\nDefine supported post types for a micropub client to show.\n\nSee [discussion about proposed extension](https://indieweb.org/Micropub-extensions#Query_for_Supported_Vocabulary).\n\n```js\nconfig: {\n\t...\n\t'post-types': [ // Default values\n\t\t\t{ type: 'note', name: 'Note' },\n\t\t\t{ type: 'photo', name: 'Photo' },\n\t\t\t{ type: 'reply', name: 'Reply' },\n\t\t\t{ type: 'bookmark', name: 'Bookmark' },\n\t\t\t{ type: 'like', name: 'Like' },\n\t\t\t{ type: 'article', name: 'Article' },\n\t\t\t{ type: 'rsvp', name: 'RSVP' },\n\t\t\t{ type: 'repost', name: 'Repost' },\n\t\t\t{ type: 'watch', name: 'Watch' },\n\t\t\t{ type: 'read', name: 'Read' },\n\t\t\t{ type: 'listen', name: 'Listen' },\n\t\t\t{ type: 'game', name: 'Game' },\n\t\t],\n\t...\n}\n```\n\n## Post Types\n\nThe current supported post types are:\n* [article](https://indieweb.org/article)\n* [bookmark](https://indieweb.org/bookmark)\n* [like](https://indieweb.org/like)\n* [listen](https://indieweb.org/listen)\n* [note](https://indieweb.org/note)\n* [photo](https://indieweb.org/photo)\n* [play](https://indieweb.org/play)\n* [read](https://indieweb.org/read)\n* [repost](https://indieweb.org/repost)\n* [rsvp](https://indieweb.org/rsvp)\n* [watch](https://indieweb.org/watch)\n* [reply](https://indieweb.org/reply)\n\n\u003e **Note:** If a post does not fit under a specific type, it will default to be\nof type `note`.\n\n## Scopes\n* create - allows the client to create posts on behalf of the user\n* update - allows the client to edit existing posts\n* delete - allows the client to delete posts\n* undelete - allows the client to undelete posts\n* media - allows the client to upload files to the media endpoint\n\n## Troubleshooting\n* `ME` should have a trailing slash\n\n## References\n* [Micropub spec](https://www.w3.org/TR/micropub)\n* [Micropub media endpoint](https://www.w3.org/TR/micropub/#media-endpoint)\n* [Handling a micropub request](https://indieweb.org/Micropub#Handling_a_micropub_request)\n* [Micropub extensions](https://indieweb.org/Micropub-extensions)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenjifs%2Fmicropub","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbenjifs%2Fmicropub","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenjifs%2Fmicropub/lists"}