{"id":17967293,"url":"https://github.com/haatos/goshipit","last_synced_at":"2025-04-04T08:02:35.283Z","repository":{"id":260067145,"uuid":"878760698","full_name":"haatos/goshipit","owner":"haatos","description":"goship.it - Go + Templ + HTMX component library","archived":false,"fork":false,"pushed_at":"2025-03-27T13:41:58.000Z","size":3620,"stargazers_count":222,"open_issues_count":0,"forks_count":15,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-03-27T14:45:11.603Z","etag":null,"topics":["golang","htmx","templates"],"latest_commit_sha":null,"homepage":"https://goship.it","language":"templ","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/haatos.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":"2024-10-26T03:30:40.000Z","updated_at":"2025-03-27T13:42:02.000Z","dependencies_parsed_at":"2025-02-16T14:10:42.989Z","dependency_job_id":"2fecac9f-1ae3-4dbf-8a54-32ea8891db34","html_url":"https://github.com/haatos/goshipit","commit_stats":null,"previous_names":["haatos/goshipit"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haatos%2Fgoshipit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haatos%2Fgoshipit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haatos%2Fgoshipit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haatos%2Fgoshipit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/haatos","download_url":"https://codeload.github.com/haatos/goshipit/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247136419,"owners_count":20889648,"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":["golang","htmx","templates"],"created_at":"2024-10-29T14:05:16.766Z","updated_at":"2025-04-04T08:02:35.266Z","avatar_url":"https://github.com/haatos.png","language":"templ","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GoShip.it\n\nGolang + Templ + HTMX (+ TailwindCSS + DaisyUI) component library to enhance developing an application using the GOTH stack.\n\nThe library contains DaisyUI components translated into Templ components that can be easily customized using both TailwindCSS and DaisyUI.\n\nUpdated to support DaisyUI 5. If you're looking for DaisyUI 4 compatible components, take a look [here](https://old.goship.it)\n\n## Getting started\n\nInstall node dependencies:\n`npm i -D`\n\nBuild TailwindCSS:\n`make tw`\n\nGenerate component code/json, generate templates and run the server:\n`make dev`\n\n## Code/data generation\n\n`cmd/generate/main.go` is used to generate JSON, markdown and Go code from source code. JSON is used to store and load component and example component source code to be displayed in HTML. The generator also generates a markdown file that contains up-to-date types for components (from `internal/model/components.go`), and .go file containing a mapping of example names to _templ_ components.\n\n## Contributing\n\nComponents are placed in individual .templ files in `internal/views/components/`. The name of the file is used as the name of the component (converted from snake_case to Capitalized Component Name). The .templ file starts with a category name as a comment, e.g. `// data_display`.\n\nFor example\n\n`internal/views/components/accordion.templ`\n\n```go\n// data_display\npackage components\n\ntype AccordionRowProps struct {\n\tLabel string\n\tType  string\n\tName  string\n}\n\ntempl AccordionRow(props AccordionRowProps) {\n\t\u003cdiv class=\"collapse collapse-arrow bg-base-200 join-item\"\u003e\n\t\t\u003cinput type=\"checkbox\" name=\"templ-accordion\"/\u003e\n\t\t\u003cdiv class=\"collapse-title text-xl font-medium\"\u003e{ label }\u003c/div\u003e\n\t\t\u003cdiv class=\"collapse-content bg-base-300\"\u003e\n\t\t\t{ children... }\n\t\t\u003c/div\u003e\n\t\u003c/div\u003e\n}\n```\n\nEach component also has an examples file with a corresponding name in `internal/views/examples/`. The file can contain multiple examples, each starting with a comment `// example` with any lines below this line belonging to the example up to the next `// example` line or EOF. E.g.:\n\n`internal/views/examples/textarea.templ`\n\n```go\npackage examples\n\nimport \"github.com/haatos/goshipit/internal/views/components\"\n\n// example\ntempl BasicTextarea() {\n\t\u003cdiv class=\"pt-4\"\u003e\n\t\t@components.Textarea(\n\t\t\tcomponents.TextareaProps{\n\t\t\t\tLabel: \"Description\",\n\t\t\t\tName:  \"description\",\n\t\t\t},\n\t\t)\n\t\u003c/div\u003e\n}\n\n// example\ntempl BasicTextareaWithError() {\n\t\u003cdiv class=\"pt-4\"\u003e\n\t\t@components.Textarea(\n\t\t\tcomponents.TextareaProps{\n\t\t\t\tLabel: \"Description\",\n\t\t\t\tName:  \"description\",\n\t\t\t\tErr:   \"Description cannot be empty\",\n\t\t\t},\n\t\t)\n\t\u003c/div\u003e\n}\n```\n\nSome examples have corresponding handler functions to provide dummy data for the component to display its usage. E.g. `internal/handler/components.go` contains the handler for lazy-loading example:\n\n```go\n// LazyLoadExample\nfunc GetLazyLoadExample(c echo.Context) error {\n\ttime.Sleep(2 * time.Second)\n\n\treturn render(c, http.StatusOK, examples.LazyLoadResult())\n}\n\n// LazyLoadExample\n```\n\nThe handler must be enclosed with the name of the example component as comment on both sides of the handler's function(s).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhaatos%2Fgoshipit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhaatos%2Fgoshipit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhaatos%2Fgoshipit/lists"}