{"id":13398734,"url":"https://github.com/dbelyaeff/cogear-plugin-blog","last_synced_at":"2025-03-18T09:15:06.456Z","repository":{"id":57202808,"uuid":"146035394","full_name":"dbelyaeff/cogear-plugin-blog","owner":"dbelyaeff","description":"Blog plugin for Cogear.JS","archived":false,"fork":false,"pushed_at":"2019-08-12T15:28:08.000Z","size":30,"stargazers_count":1,"open_issues_count":3,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-04-05T03:06:32.501Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/dbelyaeff.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}},"created_at":"2018-08-24T20:10:33.000Z","updated_at":"2020-06-04T07:17:27.000Z","dependencies_parsed_at":"2022-09-15T13:23:17.244Z","dependency_job_id":null,"html_url":"https://github.com/dbelyaeff/cogear-plugin-blog","commit_stats":null,"previous_names":["codemotion/cogear-plugin-blog"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbelyaeff%2Fcogear-plugin-blog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbelyaeff%2Fcogear-plugin-blog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbelyaeff%2Fcogear-plugin-blog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbelyaeff%2Fcogear-plugin-blog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dbelyaeff","download_url":"https://codeload.github.com/dbelyaeff/cogear-plugin-blog/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244189826,"owners_count":20412991,"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-07-30T19:00:31.208Z","updated_at":"2025-03-18T09:15:06.435Z","avatar_url":"https://github.com/dbelyaeff.png","language":"JavaScript","funding_links":[],"categories":["Blogging"],"sub_categories":[],"readme":"# **Blog** plugin for Cogear.JS\n\n[Features](#features) | [Installation](#installation) | [Usage](#usage) | [Post](#post) | [Layouts](#layouts) | [Pagination](#pagination)\n\nExample: [https://cogearjs.org/blog](https://cogearjs.org/blog)\n\n![Cogear.JS blog plugin in action](https://i.imgur.com/zhLts4el.jpg)\n\n# Features\n* Data stored in flat files (as pages)\n* Pagination\n* Tags\n\n# Installation\n\nGo to the site folder and install plugin with command:\n```bash\nyarn add cogear-plugin-blog\n# or \nnpm install cogear-plugin-blog\n```\n\nPlugin will loads up automatically.\n\n# Usage\n\nBy default it creates virtual `blog` page (uri `/blog`) and passed all the posts in `./src/pages/blog` (can be customized) folder while rendering layout of `blog` page (also named the same).\n\nLayout `blog` must be created in `./src/layouts` or using theme layouts. \n\nVariables passed to this layout:\n* `posts` – list of posts\u003cbr\u003eTypical **Cogear.JS** [pages objects](https://cogearjs.org/docs/pages)) with one exception – they have `teaser` field.\n* `paginator` - pagination data ([Read More](#pagination))\n* `tags` - all posts tags (for creating navs)\n\n# Post\nLet's take a look of typical post page.\n\nPay attention to `tags` which are passed to `blog` instance and to splitter `===`, which bring `teaser` (before it) and full (without it) views.\n\n## Listing `./src/pages/blog/2018/08/welcome.md`\n```Markdown\n---\ntitle: Welcome to Cogear.JS blog!\ntags: \n - news\n---\n\nWe are happy to introduce **Cogear.JS** – modern static websites generator. \nIt's written in [Node.JS](https://nodejs.org) and powered by the latest [Webpack](https://wepback.js.org).\n\nRead [the docs](/docs) to understand how the system works.\n\n[Cogear.JS](https://cogearjs.org/images/cogearjs.jpg)]\n\nAs you can see it's even suitable for blogging! Every blog post can have comments via modern services like [Disqus](https://disqus.com). Posts can also be tagged.\n\nAll blog pages are built automatically and rebuilt when proper content pages are changed, added or deleted.\n\n===\n\n\u003e Posts can even have teaser which is splitted from main content by 3 and more `=`,`:`,`_`,`--` symbol (new line only).\n\nTo create a blog on your site, please install [`cogear-plugin-blog`](https://github.com/codemotion/cogear-plugin-blog) npm package and follow the instructions in `README.md` file.\n\nWe really appreciate your attention, so it will be great if you write a comment.\n```\n# Layouts\n\nAll the layouts can be found at `./layouts` folder of this repository.\n\nCopy them to `./src/layouts` or to a theme `layouts` folder, style it and use.\n\n# Generated pages\n\nPlugin generates the following pages:\n* `blog` – index blog page\n* `blog/[page-num]` – pagination for index page\n* `blog/tag/[tag]` – tag index page\n* `blog/tag/[tag]/[page-num]` – pagination for tag index page\n\n# Pagination\n\nPagination object passed to layout has the following properties:\n* `count` - total blog posts count\n* `total` - total pages number\n* `current` - current page\n* `next` - next page link\n* `prev` - prev page link\n\n# Behavior\n\nWhen post is changed, add or deleted all connected blog pages will be regenereated automatically and browser window will be refreshed.\n\n# Config\n\nIf you wanna configure plugin, add `blog` section to `./config.yaml`:\n\n```yaml\nblog:\n regex:\n  posts: ^blog\\/(?!tag).+ # Pages are feeded to blog page, tags pages and paginator\n  split: '\\\u003cp\\\u003e[:=_-]{3,}\\\u003c\\/p\\\u003e' # Regex to split teaser and full view, for PARSED content in html\t\t\n```\n\nYou may change `blog.regex.posts` expression to serve `posts` from another folder.\n\nTo change `split` symbol which divides post into `teaser` and full view, set up new `blog.regex.split` expression.\n\n### How to make post author name and avatar?\nWith ease. Use `pages` config param to pass all posts sitting on `blog` uri needed params:\n```yaml\npages:\n  ^blog:\n    layout: blog\n    js:\n      - js/blog.js\n    author: \n      name: Dmitry Beliaev\n      github: https://github.com/codemotion\n```\n\nAs you see custom webpack [entry point](https://cogearjs.org/docs/pages) `js/blog.js` was also added to customize scripts and styles.\n\n# TODO\nIt's a bit nightmare to test async operations manually, because of error handling.\nBut I've do my best 🔥\n\n* Automated testing…\n\n# Docs\nHow to create your own plugin?\n\nRead the docs: [https://cogearjs.org/docs/plugins](https://cogearjs.org/docs/plugins).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdbelyaeff%2Fcogear-plugin-blog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdbelyaeff%2Fcogear-plugin-blog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdbelyaeff%2Fcogear-plugin-blog/lists"}