{"id":21252947,"url":"https://github.com/kevinhellos/igloo","last_synced_at":"2025-03-15T05:41:45.667Z","repository":{"id":188208548,"uuid":"678297523","full_name":"kevinhellos/Igloo","owner":"kevinhellos","description":"Single Page Application (SPA) router in vanilla JS for static site","archived":false,"fork":false,"pushed_at":"2023-11-11T17:39:23.000Z","size":19,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-21T21:09:12.575Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://igloo-spa.netlify.app/","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/kevinhellos.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":"2023-08-14T08:17:50.000Z","updated_at":"2024-03-20T10:48:11.000Z","dependencies_parsed_at":"2024-06-03T21:11:52.989Z","dependency_job_id":"5a3f9685-6b32-449b-9353-09185ed62e5c","html_url":"https://github.com/kevinhellos/Igloo","commit_stats":null,"previous_names":["kevin-lem0n/igloo","iskevinlemon/igloo","kevinhellos/igloo"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevinhellos%2FIgloo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevinhellos%2FIgloo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevinhellos%2FIgloo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevinhellos%2FIgloo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kevinhellos","download_url":"https://codeload.github.com/kevinhellos/Igloo/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243690128,"owners_count":20331727,"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-21T03:49:21.935Z","updated_at":"2025-03-15T05:41:45.649Z","avatar_url":"https://github.com/kevinhellos.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Igloo\nSingle Page Application (SPA) router for static site. [View demo](https://igloo-spa.netlify.app/).\n\n# Install via CDN\n```html\n\u003cscript src=\"https://cdn.jsdelivr.net/gh/kevin-lem0n/Igloo/src/igloo.1.1.2.js\"\u003e\u003c/script\u003e\n```\n\n# Pretty URL\nOnly available in igloo.2.js and above version\n\nWhen \u003ccode\u003eprettyUrl\u003c/code\u003e is set to true, the url will be: \u003cbr/\u003e\n\u003ccode\u003elocalhost:3000/#/page1\u003c/code\u003e instead of \u003ccode\u003elocalhost:3000/#/page1\u003c/code\u003e. \u003cbr/\u003e\nWhen prettyUrl is enabled, navigation between pages will cause a \u003cb\u003efull page refresh\u003c/b\u003e.\n\n\n```html\n\u003cscript src=\"https://cdn.jsdelivr.net/gh/kevin-lem0n/Igloo/src/igloo.2.js\"\u003e\u003c/script\u003e\n\u003cscript\u003e\n// Igloo router configuration\n$Igloo({\n    root: \"#root\" \n    folder: \"views\",\n    default_path: \"index\",\n    scope: [\"index\", \"page1\", \"page2\", \"page3\"],\n    error: \"error\"\n    prettyUrl: true;\n})\n\u003c/script\u003e\n```\n\n# Manual setup template\n1. In the root of your project directory, create an \u003ccode\u003eindex.html\u003c/code\u003e\u003cbr\u003e\n2. In the root of your project directory, in \u003ccode\u003eindex.html\u003c/code\u003e, inside the head tag, \u003cbr\u003e\nadd the script to include \u003ccode\u003eigloo.1.1.js\u003c/code\u003e\n```html\n\u003cscript src=\"igloo.1.1.js\"\u003e\u003c/script\u003e\n```\n3. In the root of your project directory, create a \u003ccode\u003eviews\u003c/code\u003e folder\u003cbr\u003e\n4. Create these files inside the \u003ccode\u003eviews\u003c/code\u003e folder:\n- index.html \u003cbr\u003e\n- page1.html \u003cbr\u003e\n- page2.html \u003cbr\u003e\n- page3.html \u003cbr\u003e\n- error.html \u003cbr\u003e\n5. Copy the contents of each file form this repo \u003ccode\u003eviews\u003c/code\u003e folder and paste them to your own code correspondingly.\n6. In the root of your project directory, in \u003ccode\u003eindex.html\u003c/code\u003e, inside the body tag, paste these codes:\n```html\n\u003cbr\u003e\n\u003ca route=\"#index\"\u003eHomepage\u003c/a\u003e\n\u003ca route=\"#page1\"\u003ePage 1\u003c/a\u003e\n\u003ca route=\"#page2\"\u003ePage 2\u003c/a\u003e\n\u003ca route=\"#page3\"\u003ePage 3\u003c/a\u003e\n    \n\u003cdiv id=\"root\"\u003e\u003c/div\u003e\n\n\u003cscript\u003e\n// Igloo router configuration\n$Igloo({\n    root: \"#root\" // this is the id of the div to inject the content to\n    folder: \"views\",\n    default_path: \"index\",\n    scope: [\"index\", \"page1\", \"page2\", \"page3\"],\n    error: \"error\"\n    prettyUrl: true;\n})\n\u003c/script\u003e\n\n\u003cstyle\u003e\n#root{\n    margin-top: 20px;\n}\na{\n    padding: 10px;\n    margin-right: 5px;\n    border: 1px solid darkgrey;\n    text-decoration: none;\n    color: black;\n}\n\u003c/style\u003e\n```\n7. You are done with the sample template.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkevinhellos%2Figloo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkevinhellos%2Figloo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkevinhellos%2Figloo/lists"}