{"id":14457430,"url":"https://github.com/surishortlink/suri","last_synced_at":"2025-08-28T14:31:04.840Z","repository":{"id":37023471,"uuid":"314372292","full_name":"surishortlink/suri","owner":"surishortlink","description":"Your own short links as an easily deployed static site","archived":false,"fork":false,"pushed_at":"2024-08-29T12:22:36.000Z","size":321,"stargazers_count":374,"open_issues_count":0,"forks_count":60,"subscribers_count":8,"default_branch":"development","last_synced_at":"2024-08-29T13:49:45.311Z","etag":null,"topics":["bitly","link-shortener","self-hosted","shorten-urls","shortlink","shortlinks","static-site","url-shortener"],"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/surishortlink.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}},"created_at":"2020-11-19T21:18:23.000Z","updated_at":"2024-08-29T12:22:38.000Z","dependencies_parsed_at":"2023-11-10T18:30:04.019Z","dependency_job_id":"9aaa48cc-f2bf-46ac-be0d-31b0f632071d","html_url":"https://github.com/surishortlink/suri","commit_stats":null,"previous_names":["surishortlink/suri"],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/surishortlink%2Fsuri","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/surishortlink%2Fsuri/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/surishortlink%2Fsuri/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/surishortlink%2Fsuri/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/surishortlink","download_url":"https://codeload.github.com/surishortlink/suri/tar.gz/refs/heads/development","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":217514358,"owners_count":16188854,"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","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":["bitly","link-shortener","self-hosted","shorten-urls","shortlink","shortlinks","static-site","url-shortener"],"created_at":"2024-09-01T17:01:00.030Z","updated_at":"2024-09-01T17:02:34.034Z","avatar_url":"https://github.com/surishortlink.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"\u003ch1 align=\"center\" width=\"100%\"\u003e\n  \u003cimg src=\"logo.png\" width=\"200\" alt=\"Suri\" /\u003e\n\u003c/h1\u003e\n\n\u003ch3 align=\"center\" width=\"100%\"\u003e\n  \u003ci\u003eYour own short links as an easily deployed static site\u003c/i\u003e\n\u003c/h3\u003e\n\n\u003ch3 align=\"center\" width=\"100%\"\u003e\n  \u003ca href=\"https://www.npmjs.com/package/@surishortlink/suri\"\u003e\n    \u003cimg src=\"https://img.shields.io/npm/v/@surishortlink/suri\" alt=\"npm\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/surishortlink/suri/actions\"\u003e\n    \u003cimg src=\"https://github.com/surishortlink/suri/actions/workflows/ci.yml/badge.svg\" alt=\"GitHub Actions\"\u003e\n  \u003c/a\u003e\n\u003c/h3\u003e\n\nNo server-side hosting, serverless cloud functions, or database necessary. Suri\nstatic sites can be deployed to Vercel, Netlify, and more (usually for free) in\na few minutes.\n\nSuri doesn't care about \"technically superior\" `3xx` server redirects. Suri just\nwants you to finally use that domain you spend \\$59/year on and take back your\nshort links from the Bitlys and TinyURLs of the web.\n\n## Try It Out\n\nhttps://surishort.link/gh ⇒ https://github.com/surishortlink/suri\n\nhttps://surishort.link is an example site that showcases Suri in action. You can\ncheck out\n[the repository for the site](https://github.com/surishortlink/surishort.link)\nand\n[the file that manages the links](https://github.com/surishortlink/surishort.link/blob/main/src/links.json)\nto see how it works.\n\n## Quick Start\n\nSuri has template repositories that make it super easy to get started. Choose\nthe platform you're deploying to and follow the step by step instructions:\n\n- [Deploy to DigitalOcean](https://github.com/surishortlink/suri-deploy-digitalocean)\n- [Deploy to GitHub Pages](https://github.com/surishortlink/suri-deploy-github)\n- [Deploy to Netlify](https://github.com/surishortlink/suri-deploy-netlify)\n- [Deploy to Render](https://github.com/surishortlink/suri-deploy-render)\n- [Deploy to Vercel](https://github.com/surishortlink/suri-deploy-vercel)\n\nNot deploying to one of those platforms? No worries. Here are a few generic\noptions that cover most other scenarios, whether that's a different cloud\nprovider or hosting it yourself:\n\n- [Deploy with Docker](https://github.com/surishortlink/suri-deploy-docker)\n- [Deploy with Node.js](https://github.com/surishortlink/suri-deploy-nodejs)\n\n## How It Works\n\n### Manage Links\n\nAt the heart of Suri is the `links.json` file, located in the `src` directory,\nwhere you manage your links. All of the template repositories include this file\nseeded with a few examples:\n\n```json\n{\n  \"/\": \"https://www.youtube.com/watch?v=CsHiG-43Fzg\",\n  \"1\": \"https://fee.org/articles/the-use-of-knowledge-in-society/\",\n  \"gh\": \"https://github.com/surishortlink/suri\"\n}\n```\n\nIt couldn't be simpler: the key is the \"short link\" path that gets redirected,\nand the value is the target URL. Keys can be as short or as long as you want,\nusing whatever mixture of characters you want. `/` is a special entry for\nredirecting the root path.\n\n### Build Static Site\n\nSuri ships with a `suri` executable file that generates the static site from the\n`links.json` file. The static site is output to a directory named `build`.\n\nAll of the template repositories are configured with a `build` script that\ninvokes this executable, making the command you run simple:\n\n```bash\nnpm run build\n```\n\nWhen you make a change to the `links.json` file, simply re-run this command to\nre-generate the static site, which can then be re-deployed. Many of the\nplatforms that Suri has template repositories for are configured to do this\nautomatically.\n\n### Config\n\nConfiguration is handled through the `suri.config.json` file in the root\ndirectory. There is only one option at this point:\n\n| Option | Description                                                        | Type    | Default |\n| ------ | ------------------------------------------------------------------ | ------- | ------- |\n| `js`   | Whether to redirect with JavaScript instead of a `\u003cmeta\u003e` refresh. | Boolean | `false` |\n\n### Public Directory\n\nFinally, any files in the `public` directory will be copied over to the `build`\ndirectory without modification when the static site is built. This can be useful\nfor files like `favicon.ico` or `robots.txt` (that said, Suri provides sensible\ndefaults for both).\n\n## Upgrading v0 to v1\n\nIf you previously forked/cloned this repository when it was on version 0.1\nthrough 0.5.1, you'll notice a few differences now with version 1.\n\nVersion 1 solves three main issues with version 0:\n\n1. **Difficult to update.** Since you forked/cloned this repository in v0, you\n   had to manually merge in upstream changes if you wanted the latest version.\n   This often led to merge conflicts and wasn't an easy, intuitive process most\n   of the time. v1 fixes this by turning Suri into a proper npm package that you\n   can update just like any other dependency.\n2. **Lots of unnecessary files.** v0 included deployment and config files for\n   every platform you could deploy to (Vercel, Netlify, etc.). Even if you\n   deployed to Vercel, you still had `render.yaml` for Render and `app.json` for\n   Heroku (among others) in your repository. v1 fixes this by having separate\n   template repositories for each platform, which only include the necessary\n   files for that platform.\n3. **[Eleventy](https://www.11ty.dev/) was overkill.** v0 was built on it for\n   static site generation. While a great option for most static sites, it was\n   overkill for the tiny HTML page that Suri generates. Eleventy came with 34 of\n   its own dependencies, which ultimately resulted in 241 total dependencies\n   being installed. v1 fixes this by removing Eleventy in favor of a\n   purpose-built static site generator that doesn't require a single dependency.\n\nSo, how do you upgrade? If you only ever edited your `links.json` file,\nupgrading is simple:\n\n1. Create a new repository based on the template repository for your platform\n   (see links above).\n2. Copy over your `links.json` file.\n3. If you changed any of the files in your `public` directory, copy those over.\n4. If you set the environment variable `SURI_JS` to `1`, change `js` to `true`\n   in `suri.config.json`.\n\nIf you edited any of the Eleventy files – such as the `links.njk` template – you\nprobably just want to stick to v0 and continue using Eleventy.\n\nThere are a few other noteworthy changes in v1 beyond that:\n\n- The static site is now output to a directory named `build` instead of `_site`.\n- Configuration is now done through the `suri.config.json` file instead of\n  environment variables.\n- Node.js \u003e= v18 is now required, up from v14, which has reached end-of-life.\n- Removed `npm run clean` to delete the build directory. `npm run build` does\n  this automatically before each new build. Otherwise, you can manually add it\n  back if you found it useful.\n- Removed `npm run dev` to build, watch, and serve the static site during\n  development. It's overkill for the tiny HTML page that Suri generates.\n- Removed `npm run lint` to lint with Prettier. You can manually add it back if\n  you found it useful.\n- Removed `npm run release` to release a new version of Suri. You can manually\n  add it back if you want to tag release versions of your repository.\n- Removed Heroku as a deploy platform because they no longer offer a free tier.\n  You can still deploy there quite easily if you're willing to pay.\n- This repository moved from my personal `jstayton` user on GitHub to a new\n  `surishortlink` organization for all Suri-related repositories.\n\n## Development\n\n### Prerequisites\n\nThe only prerequisite is a compatible version of Node.js (see `engines.node` in\n[`package.json`](package.json)).\n\n### Dependencies\n\nInstall dependencies with npm:\n\n```bash\nnpm install\n```\n\n### Tests\n\nThe built-in Node.js [test runner](https://nodejs.org/docs/latest/api/test.html)\nand [assertions module](https://nodejs.org/docs/latest/api/assert.html) is used\nfor testing.\n\nTo run the tests:\n\n```bash\nnpm test\n```\n\nDuring development, it's recommended to run the tests automatically on file\nchange:\n\n```bash\nnpm test -- --watch\n```\n\n### Docs\n\n[JSDoc](https://jsdoc.app/) is used to document the code.\n\nTo generate the docs as HTML to the (git-ignored) `docs` directory:\n\n```bash\nnpm run docs\n```\n\n### Code Style \u0026 Linting\n\n[Prettier](https://prettier.io/) is setup to enforce a consistent code style.\nIt's highly recommended to\n[add an integration to your editor](https://prettier.io/docs/en/editors.html)\nthat automatically formats on save.\n\n[ESLint](https://eslint.org/) is setup with the\n[\"recommended\" rules](https://eslint.org/docs/latest/rules/) to enforce a level\nof code quality. It's also highly recommended to\n[add an integration to your editor](https://eslint.org/docs/latest/use/integrations#editors)\nthat automatically formats on save.\n\nTo run via the command line:\n\n```bash\nnpm run lint\n```\n\n## Releasing\n\nWhen the `development` branch is ready for release,\n[Release It!](https://github.com/release-it/release-it) is used to orchestrate\nthe release process:\n\n```bash\nnpm run release\n```\n\nOnce the release process is complete, merge the `development` branch into the\n`main` branch, which should always reflect the latest release.\n\n![piratepx](https://app.piratepx.com/ship?p=e91ddd1b-31ad-4c36-b03e-be4a1e9a7678\u0026i=suri)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsurishortlink%2Fsuri","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsurishortlink%2Fsuri","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsurishortlink%2Fsuri/lists"}