{"id":24540012,"url":"https://github.com/spurtcms/blocks","last_synced_at":"2025-03-16T04:43:04.622Z","repository":{"id":249382064,"uuid":"831299933","full_name":"spurtcms/blocks","owner":"spurtcms","description":null,"archived":false,"fork":false,"pushed_at":"2025-02-21T11:58:29.000Z","size":49,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-02-21T12:33:51.348Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/spurtcms.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-07-20T06:55:54.000Z","updated_at":"2025-02-21T11:57:01.000Z","dependencies_parsed_at":"2024-09-09T16:19:37.152Z","dependency_job_id":"6d92c9d9-6ae0-4b27-8c2b-bfc9b22c48c7","html_url":"https://github.com/spurtcms/blocks","commit_stats":null,"previous_names":["spurtcms/blocks"],"tags_count":53,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spurtcms%2Fblocks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spurtcms%2Fblocks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spurtcms%2Fblocks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spurtcms%2Fblocks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/spurtcms","download_url":"https://codeload.github.com/spurtcms/blocks/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243826778,"owners_count":20354220,"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":"2025-01-22T17:17:53.351Z","updated_at":"2025-03-16T04:43:04.612Z","avatar_url":"https://github.com/spurtcms.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Blocks [![GoDoc](https://godoc.org/github.com/spurtcms/blocks?status.svg)](https://pkg.go.dev/github.com/spurtcms/blocks)\nspurtCMS includes a flexible and modular blocks system to allow users to build dynamic, reusable sections for their websites. Blocks can be customized, reused, and combined to create powerful page layouts.\n\n\n## Features\n\n- Blocks are self-contained components that can be reused across pages.\n- Users can easily rearrange blocks within a page using drag-and-drop interfaces.\n- Reusable Blocks: Create blocks once and use them across multiple pages or posts\n- Simplifies layout customization without needing technical skills.\n\n\n\n\n# Installation\n\n``` bash\ngo get github.com/spurtcms/blocks \n```\n\n\n# Usage Example\n\n``` bash\nimport (\n\t\"github.com/spurtcms/auth\"\n\t\"github.com/spurtcms/blocks\"\n)\n\nfunc main() {\n\n\tAuth := auth.AuthSetup(auth.Config{\n\t\tUserId:     1,\n\t\tExpiryTime: 2,\n\t\tSecretKey:  \"SecretKey@123\",\n\t\tDB: \u0026gorm.DB{},\n\t\tRoleId: 1,\n\t})\n\n\ttoken, _ := Auth.CreateToken()\n\n\tAuth.VerifyToken(token, SecretKey)\n\n\tpermission, _ := Auth.IsGranted(\"Forms Builder\", auth.CRUD, 1)\n\n\tBlocks := BlockSetup(Config{\n\t\tDB:               db,\n\t\tAuthEnable:       true,\n\t\tPermissionEnable: true,\n\t\tAuth:             Auth,\n\t})\n\n\n\tif permisison {\n\n\t\t//list Blocks\n\t\tblocklist, blockcount, err := Blocks.BlockList(10, 0, Filter{}, 1)\n\t\tif err != nil {\n\t\t\tfmt.Println(err)\n\t\t}\n\n\t\t//create Blocks\n        BlockCreate := BlockCreation{\n\t\t\tTitle:        \"TestBlock\",\n\t\t\tBlockContent: `\u003cp\u003eHello world\u003c/p\u003e`,\n\t\t\tCoverImage:   \"/blocks/IMG-1726551883.jpeg\",\n\t\t\tTenantId:     1,\n\t\t\tPrime:        1,\n\t\t\tCreatedBy:    2,\n\t\t\tIsActive:     1,\n\t\t}\n\n\t\tcreateblock, err := Blocks.CreateBlock(BlockCreate)\n\n\t\tif err != nil {\n\t\t\tlog.Println(\"collection list\", err)\n\t\t}\n\n\t\tMstrTag := MasterTagCreate{\n\n\t\t\tTagTitle:  \"Hello\",\n\t\t\tTenantId:  1,\n\t\t\tCreatedBy: 2,\n\t\t}\n\n\t\tcreatetags, err := Blocks.CreateMasterTag(MstrTag)\n\n\t\tif err != nil {\n\t\t\tfmt.Println(\"block err\", err)\n\t\t}\n\n\t\tTagCreate := CreateTag{\n\t\t\tBlockId:   createblock.Id,\n\t\t\tTagId:     createtags.Id,\n\t\t\tTagName:   createtags.TagTitle,\n\t\t\tTenantId:  1,\n\t\t\tCreatedBy: 2,\n\t\t}\n\n\t\terr2 := Blocks.CreateTag(TagCreate)\n\n\t\tif err2 != nil {\n\t\t\tfmt.Println(\"block err\", err)\n\t\t}\n\n\t\t//update Blocks\n        BlockUpdate := BlockCreation{\n\t\t\tTitle:      \"Halo\",\n\t\t\tModifiedBy: 2,\n\t\t\tTenantId:   1,\n\t\t}\n\n\t\terr := Blocks.UpdateBlock(23, BlockUpdate)\n\n\t\tif err != nil {\n\t\t\tlog.Println(\"collection list\", err)\n\t\t}\n\n\t\t// delete Blocks\n\t\terr := Blocks.RemoveBlock(23, 1)\n\t\tif err != nil {\n\t\t\tfmt.Println(err)\n\t\t}\n\t}\n}\n\n```\n# Getting help\nIf you encounter a problem with the package,please refer [Please refer [(https://dev.spurtcms.com/documentation)] or you can create a new Issue in this repo[https://github.com/spurtcms/blocks/issues]. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspurtcms%2Fblocks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspurtcms%2Fblocks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspurtcms%2Fblocks/lists"}