{"id":19430362,"url":"https://github.com/demonicious/svelte-static-hash-router","last_synced_at":"2025-06-26T23:33:05.643Z","repository":{"id":143988448,"uuid":"255443613","full_name":"Demonicious/svelte-static-hash-router","owner":"Demonicious","description":" A Simple \u0026 Easy to use Static page router for Svelte.","archived":false,"fork":false,"pushed_at":"2020-04-13T21:18:47.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-07T20:13:51.596Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HTML","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/Demonicious.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}},"created_at":"2020-04-13T21:17:28.000Z","updated_at":"2020-04-13T21:18:49.000Z","dependencies_parsed_at":"2023-10-13T09:56:05.270Z","dependency_job_id":null,"html_url":"https://github.com/Demonicious/svelte-static-hash-router","commit_stats":null,"previous_names":["mudassarislam/svelte-static-hash-router","demonicious/svelte-static-hash-router"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Demonicious%2Fsvelte-static-hash-router","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Demonicious%2Fsvelte-static-hash-router/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Demonicious%2Fsvelte-static-hash-router/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Demonicious%2Fsvelte-static-hash-router/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Demonicious","download_url":"https://codeload.github.com/Demonicious/svelte-static-hash-router/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240612536,"owners_count":19829027,"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":[],"created_at":"2024-11-10T14:24:37.531Z","updated_at":"2025-02-25T05:43:15.030Z","avatar_url":"https://github.com/Demonicious.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"### Svelte Static Hash Router\nA Simple \u0026 Easy to use Static page router for Svelte.\n#### 1. Installation\nIt's available on NPM under the name 'svelte-static-hash-router'.\nYou can Install the package with the command below:\n\n`npm i -D svelte-static-hash-router`\n\n#### 2. Usage Example\n```js\n\u003cscript\u003e\n\timport Router from \"svelte-static-hash-router/Router.svelte\";\n\timport Link from \"svelte-static-hash-router/Link.svelte\";\n\n\timport Index from \"./Components/Index.svelte\";\n\timport About from \"./Components/About.svelte\";\n\timport ErrorComponent from \"./Components/ErrorComponent.svelte\";\n\u003c/script\u003e\n\n\u003cmain\u003e\n\t\u003cdiv class=\"nav\"\u003e\n\t\t\u003cul\u003e\n\t\t\t\u003cli\u003e\n\t\t\t\t\u003cLink to=\"/\"\u003eHome Page\u003c/Link\u003e\n\t\t\t\u003c/li\u003e\n\t\t\t\u003cli\u003e\n\t\t\t\t\u003cLink attributes={{ class=\"nav-link\", target=\"_blank\" }} to=\"/about\"\u003eAbout Me\u003c/Link\u003e\n\t\t\t\u003c/li\u003e\n\t\t\u003c/ul\u003e\n\t\u003c/div\u003e\n\t\n\t\u003cRouter \n\t\troutes={[\n\t\t\t{\n\t\t\t\tpath: '/',\n\t\t\t\tcomponent: Index,\n\t\t\t\tprops: {\n\t\t\t\t\tsome_property: \"property_value\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t{\n\t\t\t\tpath:  '/about',\n\t\t\t\tcomponent: About\n\t\t\t}\n\t\t]} \n\t\t\n\t\tnotfound={ErrorComponent}  \n\t/\u003e\n\u003c/main\u003e\n```\nThe \"Router\" component needs to have a \"routes\" prop that is an array of Routes.\n\nEach \"Route\" has a Path \u0026 and a Component. Optionally, You may pass \"props\" to the component which can be accessed with an \"export let property_name\" statement inside the Component.\n\nThe \"Link\" component needs to have a \"to\" prop that determines where the Link will go to.\nYou may specify any attributes for the Anchor tag by passing in a \"attributes\" prop as shown above.\n\n#### 3.  Notes\nCurrently this router can only be used for Static Routes. But I plan on making a Router for dynamic routes very soon.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdemonicious%2Fsvelte-static-hash-router","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdemonicious%2Fsvelte-static-hash-router","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdemonicious%2Fsvelte-static-hash-router/lists"}