{"id":21598103,"url":"https://github.com/matfish2/craft-blogify","last_synced_at":"2026-01-04T16:05:26.827Z","repository":{"id":43199275,"uuid":"429560241","full_name":"matfish2/craft-blogify","owner":"matfish2","description":"Plug-and-play blog for Craft CMS","archived":false,"fork":false,"pushed_at":"2025-01-18T19:45:59.000Z","size":5558,"stargazers_count":5,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-24T17:45:53.957Z","etag":null,"topics":["blogging","craft-plugin","craftcms","twig"],"latest_commit_sha":null,"homepage":"https://plugins.craftcms.com/blogify?craft4","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/matfish2.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","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":"2021-11-18T19:50:05.000Z","updated_at":"2025-01-16T19:07:25.000Z","dependencies_parsed_at":"2025-01-24T17:44:12.782Z","dependency_job_id":"f75c834c-4729-497a-abfc-d34b738952a7","html_url":"https://github.com/matfish2/craft-blogify","commit_stats":{"total_commits":48,"total_committers":2,"mean_commits":24.0,"dds":0.02083333333333337,"last_synced_commit":"edf2640af2cdce6702c54b424b9c503886554d4a"},"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matfish2%2Fcraft-blogify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matfish2%2Fcraft-blogify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matfish2%2Fcraft-blogify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matfish2%2Fcraft-blogify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/matfish2","download_url":"https://codeload.github.com/matfish2/craft-blogify/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244210655,"owners_count":20416500,"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":["blogging","craft-plugin","craftcms","twig"],"created_at":"2024-11-24T18:11:18.354Z","updated_at":"2026-01-04T16:05:26.757Z","avatar_url":"https://github.com/matfish2.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Blogify\n\nBlogify offers a single-click solution to the task of building a blog with CraftCMS.\n\nOnce installed the plugin creates the data structure and templates, and allows for seeding of dummy posts, so you can\nstart customizing your blog right away. Blogify comes with a bunch of Twig enhancements that make the code in your\ntemplates declarative and simple.\n\n#### Click [here](https://www.craftcmsplugins.com/blog/index) for a full demo of the result with zero configuration.\n\n## Installation\n\n1. Include the package:\n\n```\ncomposer require matfish/craft-blogify\n```\n\n2. Install the plugin:\n\n```\nphp craft plugin/install blogify\n```\n\n3. (Optional but recommended for development) Seed some posts:\n\n```\nphp craft blogify/seed\n```\n\nThe default is 10 posts. You can pass a `--count` option to seed as many as you like.\n\nThat's all! Now go to `{yoursite.dev}/blog/index` and see the blog in action.\n\n## Spec\n\nBlogify adds the following data structures to Craft:\n\n1. A \"Blog Listing\" (or index) Single.\n2. A \"Blog\" Channel\n3. An \"Author Page\" Single (All author posts)\n4. A \"Blog Categories\" category group and a corresponding category template to display all posts related to a given\n   category.\n5. A \"Blog Tags\" tag group\n6. A \"Tag Page\" single (All posts with a given tag)\n7. A \"Blog Assets\" assets volume.\n8. A \"Blog Thumbnail\" transform.\n\nEach Post in the Blog channel has the following fields:\n\n1. Title\n2. Image\n3. Excerpt\n4. Content (a Redactor field)\n5. Categories\n6. Tags\n\n## Twig Enhancements\n\nthe initial theme demonstrates usage of all the enhancements below.\n\n### Global variables\n\nBlogify exposes a global `blogify` variable with the following properties:\n\n* `categories` All blog categories\n* `usedCategories` All blog categories that have at least one post associated with them\n* `tags` All blog tags\n\n### Global methods\n\n* `blogifyRecentPosts` gets recent posts. E.g `blogifyRecentPosts().limit(4).all()`\n* `blogifySearch` searches the blog (title and content fields). E.g `blogifySearch('foo')`\n* `blogifyPopularPosts` get most popular posts (see [below](#record-post-views)). \n\nIn addition, entities contain contextual methods, as follows:\n\n#### Entry (Post)\n\n* `categories` get post categories\n* `relatedPosts` get other posts with one of the given post's categories\n* `tags` get post tags\n* `next` get next post\n* `prev` get previous post\n* `image` get post image\n* `thumbnail` get post thumbnail (defined under Settings-\u003eAssets-\u003eImage Transforms-\u003eBlog Thumbnail)\n* `excerpt` get post excerpt\n* `content` get post content (supports Matrix field rendering. See below)\n\n#### Category\n\n* `posts` get posts related to the given category\n\n#### Tag\n\n* `posts` get posts that have the given tag\n\n#### User (Author)\n\n* `posts` get author posts\n\nNote: Unless the method is getting a single entity (e.g `entry.image`), Blogify will return a query object, which can be\nused to further augment the query, e.g `author.posts.limit(3).all()`.\n\n## Using Matrix field for the post content\n\nBy default the provided Post Content field is a Redactor field. If you wish to use the powerful Matrix field instead,\nwe've got your back:\n\n* Go to Settings-\u003eFields-\u003ePost Content\n* Change field type to Matrix and build your blocks.\n* Add a `_matrix` folder under `blogify/post`\n* Add a template for each block type, named after the handle.\n\nEach partial will expose a `block` variable containing all the fields. E.g if your block handle is `postHeading` and it\nhas a `heading` field, create a `blogify/post/_matrix/postHeading.twig` file:\n\n```html\n    \u003ch2\u003e{{block.heading}}\u003c/h2\u003e  \n```\n\n* Render the post content:\n\n```html\n\n\u003cdiv class=\"post-content\"\u003e\n    {{ entry.content | raw }}\n\u003c/div\u003e\n```\n\nNote that you can change the templates folder path via the plugin's config. Create a `config/blogify.php` file:\n\n```php\nreturn [\n     // matrix templates path relative to the templates folder\n    'matrixTemplatesPath'=\u003e'my/matrix/path'\n];\n```\n\n## Record post views\n\nBlogify allows you track the popularity of your posts, so you can sort by popularity\nand display number of views. This option is disabled by default. You can enable it with a single command:\n\n```\nphp craft blogify/views/record\n```\n\nThis will add a read-only Post Views field to your posts (right after the title). Now, every time someone views the post\nBlogify will automatically increment the number of views, while excluding drafts and previews.\n\n### Excluding IPs \nSince you probably don't want to record your own views you can exclude certain IPs from triggering the event by adding the following\nto `config/blogify.php`:\n\n```php\nreturn [\n   'postViewsExcludeIps'=\u003e[\n       '192.168.10.1'\n  ]\n];\n```\n\nNow you can sort by popularity (in descending order of course) in your templates:\n```\nblogifyPopularPosts().limit(5).all()\n```\nTo exclude posts with no views from the query pass `true` to the method call:\n```\nblogifyPopularPosts(true).limit(5).all()\n```\nFinally, to display the number of views in your template simply call:\n```\n{{entry.views}}\n```\n\n### Multiple sites\nWhen installed Blogify will register all Category Groups and Sections to all existing sites,\nwith the same URL (relative to site root URL) and same templates.\n\nIf you need to vary template content between sites you can use:\n1. [Static translations](https://craftcms.com/docs/4.x/sites.html#static-message-translations)\n2. [If statements](https://craftcms.com/docs/4.x/sites.html#language)\n3. [Polymorphism](https://craftcms.com/docs/4.x/sites.html#language)\n\nIn case you still need to duplicate an entire template, you can duplicate it to your site folder, *while keeping the same folder structure* ** (e.g `templates/de/blogify/listing/_entry.twig`)\nThis will prompt Craft to load this template as an override, when accessing the site with a handle of `de`.\nSee: https://craftcms.com/docs/4.x/sites.html#step-4-update-your-templates\n\n** Note that you can also duplicate it to a path that doesn't retain the same folder structure, in which case you'll need to define a new template path for the relevant Section/Category Group in Craft's back-end.\n\n## Modification\n\nBlogify is designed as a solid starting point for a blog. You can freely extend and modify the data structures and\ntemplates, while keeping the following in mind:\n\n* Don't change the handles on any of the entities.\n* Don't delete any data structures.\n* Uninstalling the plugin will remove all data including the `blogify` templates folder.\n\n## License\n\nYou can try Blogify in a development environment for as long as you like. Once your site goes live, you are required to\npurchase a license for the plugin. License is purchasable through\nthe [Craft Plugin Store](https://plugins.craftcms.com/blogify).\n\nFor more information, see\nCraft's [Commercial Plugin Licensing](https://craftcms.com/docs/3.x/plugins.html#commercial-plugin-licensing).\n\n## Requirements\n\nThis plugin requires Craft CMS 3.7.0 or later.\n\n## Issues and Discussions Guidelines\n\n*Please only open a new issue for bug reports.*\nFor feature requests and questions open a new [Discussion](https://github.com/matfish2/craft-blogify/discussions) instead.\nWhen discussing a feature request please precede [FR] to the title.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatfish2%2Fcraft-blogify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatfish2%2Fcraft-blogify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatfish2%2Fcraft-blogify/lists"}