{"id":17402982,"url":"https://github.com/thlorenz/dog","last_synced_at":"2025-10-30T22:11:23.902Z","repository":{"id":4455757,"uuid":"5594363","full_name":"thlorenz/dog","owner":"thlorenz","description":"Developer blOGgin Engine, markdown based, made to be simple and fast, yet feature rich.","archived":false,"fork":false,"pushed_at":"2017-04-29T19:59:02.000Z","size":1251,"stargazers_count":11,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-30T05:08:33.325Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://thlorenz.com/blog/dog-tutorial","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/thlorenz.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":"2012-08-29T01:28:12.000Z","updated_at":"2019-07-11T14:49:44.000Z","dependencies_parsed_at":"2022-09-20T23:30:46.546Z","dependency_job_id":null,"html_url":"https://github.com/thlorenz/dog","commit_stats":null,"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thlorenz%2Fdog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thlorenz%2Fdog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thlorenz%2Fdog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thlorenz%2Fdog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thlorenz","download_url":"https://codeload.github.com/thlorenz/dog/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251644842,"owners_count":21620634,"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-10-16T18:43:45.575Z","updated_at":"2025-10-08T05:09:38.070Z","avatar_url":"https://github.com/thlorenz.png","language":"JavaScript","readme":"**Table of Contents**  *generated with [DocToc](http://doctoc.herokuapp.com/)*\n\n\n# dog [![Build Status](https://secure.travis-ci.org/thlorenz/dog.png)](http://travis-ci.org/thlorenz/dog) \n\n## D *eveloper bl* OGging Engine\n\n  - markdown based\n  - code snippet support\n  - [embedded scriptie-talkie](http://thlorenz.github.io/scriptie-talkie-embed/) support\n  - syntax highlighting\n  - posts stored on file system \n  - provides html and default styles\n  - publishes via simple command line\n\n![cat](https://github.com/thlorenz/dog/raw/master/assets/cat.png)\n\n- [Installing Dog](#installing-dog)\n- [Dog Command Line](#dog-command-line)\n  - [scaffold](#scaffold)\n  - [preview](#preview)\n  - [publish](#publish)\n  - [unpublish](#unpublish)\n  - [summary](#summary)\n  - [help](#help)\n  - [includeStyles](#includestyles)\n  - [action aliases](#action-aliases)\n- [Inlining code samples](#inlining-code-samples)\n  - [Syntax highlighted inlines](#syntax-highlighted-inlines)\n  - [Scriptie-Talkie inlines](#scriptie-talkie-inlines)\n- [Dog Metatags](#dog-metatags)\n  - [Including Post Title](#including-post-title)\n  - [Including Post Creation Date](#including-post-creation-date)\n  - [Including Post Update Date](#including-post-update-date)\n  - [Including Post Tags](#including-post-tags)\n  - [Including external Code Snippets](#including-external-code-snippets)\n- [Dog Provider](#dog-provider)\n  - [provideFrom](#providefrom)\n  - [concatentateStyles](#concatentatestyles)\n  - [provideAll](#provideall)\n  - [provideUpdatedSince](#provideupdatedsince)\n  - [copyImages](#copyimages)\n  - [getAllPosts](#getallposts)\n  - [getAllTags](#getalltags)\n  - [getPostMetadata](#getpostmetadata)\n  - [getPostHtml](#getposthtml)\n  - [blog directories](#blog-directories)\n  - [getStylesFiles](#getstylesfiles)\n  - [printSummary](#printsummary)\n- [Styling](#styling)\n- [Examples](#examples)\n  - [Blog Only](#blog-only)\n  - [Blog Site](#blog-site)\n  - [Tutorial](#tutorial)\n\n## Installing Dog\n\nIn order to install dog globally to use its command line tool to manage your blog do:\n\n`npm install -g dog` \n\nIn order to use dog's providing capabilities in order to serve your blog, install it locally to the project, i.e.,: \n\n`npm install dog`\n\n## Dog Command Line\n\ndog allows you to manage your blog via simple a simple command line interface.\n\nThe commands follow a general pattern: `dog \u003caction\u003e \u003cpost\u003e [options]`\n\nThe `\u003cpost\u003e` here is the directory that contains the 'post.md' on which the action is to be performed.\n\nIn only a few cases (i.e., when the action affects the entire blog) `\u003cpost\u003e` is omitted.\n\nAll of the actions assume that you created a blog directory and are currently in it unless you specify the `--root`\noptions (see below).\n\nLets run through the different actions one by one.\n\n### scaffold\n\n`dog scaffold`\n\nCreates a blog skeleton including a sample post.\n\nThis is probably the first thing you want to do in order to start your blog.\n\n### preview\n\n`dog preview post`\n\nOpens the rendered post in the browser. \n\n### publish\n\n`dog publish post [options]`\n\nPublishes the post according to the given options.\n\nOptions:\n\n- `--title`: The title to be applied to the post.\n- `--tags`: The tags that will be added to the post\n- `--root`: The root directory of your blog. Defaults to `./`, so you don't need it if you are executing this action\n  from the blog root.\n\nThis will add or update `post.json` inside the post directory as well as add it and its tags to `blog.json`.\n\ndog will print out a record of the changes made.\n\nIf you publish an existing post again, only the updated date and any given options will be changed. Everything else will\nstay as before.\n\n**Example:** `dog publish getting-started --title \"Getting started with dog\" --tags \"cli nodejs javascript\"\n\n### unpublish\n\n`dog unpublish post`\n\nThis will remove the given post from the `blog.json` and delete the `post.json` from the post directory. Anything else\nin the post's directory will be left untouched.\n\n### summary\n\n`dog summary`\n\nPrints out a summary of your blog, including all metadata of each published post and important directories, e.g.,\n`assets` and `images`.\n\n### help\n\n`dog help`\n\nPrints out dog's help message.\n\n### includeStyles\n\n`dog includeStyles --styles \"style1 style2 ...\"`\n\nConfigures the blog provider to include the given styles from the `assets/styles` directory.\n\nMost likely you will not need to change the default.\n\n### action aliases\n\ndog understands unambiguous short forms of action names in a similar way that nodejs's npm does.\n\nTherefore `dog pub post` gets expanded to `dog publish post` while `dog s` is not sufficient since it could mean `dog\nsummary` or `dog scaffold`.\n\nAs a less useful option: `dog --action publish --post post --title \"My Post\"` \n\nis equivalent to: `dog publish post --title \"My Post\"`.\n\n## Inlining code samples\n\n### Syntax highlighted inlines\n\nDog supports syntax highlighted inlined code samples the same way that [github flavored\nmarkdown](https://help.github.com/articles/github-flavored-markdown) does.\n\n**Example:**\nSource (omit leading `-`)\n\n```text\n-```js\nvar a = 3;\n-```\n```\n\nResult:\n\n```js\nvar a = 3;\n```\n\n### Scriptie-Talkie inlines\n\nIf you prefer to show interactive [scriptie-talkie code samples](http://thlorenz.github.io/scriptie-talkie-embed/), please specify `'jsst'` (think **js**\n**s**criptie **t**alkie) as the language, i.e. (again omit leading `-`)\n\n```text\n-```jsst\nvar a = 3;\n-```\n```\n\n## Dog Metatags\n\nAside from the usual markdown directives dog supports a few more tags enclosed by `{{ }}` in order to include metadata\nor external snippets.\n\nStudying the 'getting-started' post included as a result of `dog scaffold` and comparing it to the rendered html - `dog\npreview getting-started` should give you a good idea on how this works.\n\n### Including Post Title\n\n`{{ meta: title }}`\n\nWill be replaced with the title found inside `post.json`.\n\n### Including Post Creation Date\n\n`{{ meta: created }}`\n\nWill be replaced with the created date found inside `post.json`.\n\nAdditionally a `.created` css selector is applied to it to allow proper styling.\n\n### Including Post Update Date\n\n`{{ meta: updated }}`\n\nWill be replaced with the updated date found inside `post.json`.\n\nAdditionally a `.updated` css selector is applied to it to allow proper styling.\n\n### Including Post Tags\n\n`{{ meta: tags }}`\n\nWill be replaced with the tags found inside `post.json`.\n\nAdditionally a `.tags` css selector is applied to it to allow proper styling.\n\n### Including external Code Snippets\n\n`{{ snippet: name }}`\n\nWill be replaced with the content of the file `name` found inside the `snippets` directory inside the posts directory.\n\n`{{ scriptie: name }}`\n\nWill be replaced with the content of the file `name` found inside the `snippets` directory and rendered via an [embedded\nscriptie-talkie](http://thlorenz.github.io/scriptie-talkie-embed/).\n\n**Example:**\n\nAssume we have a post named mypost. Inside `./mypost` we created a `snippets` folder into which we copied `myscript.js`.\n\nWe can now include that in `./mypost/post.md` via `{{ snippet: myscript.js }}` or as a scriptie-talkie via `{{ scriptie:\nmyscript.js }}.\n\nRemember to require and init scriptie-talkie:\n\n```js\nvar domready = require('domready');\nvar embed = require('scriptie-talkie-embed');\n\ndomready(embed);\n```\n\n## Dog Provider\n\nThe dog provider assists you in serving your blog from a website.\n\nIt offers a number of functions to that purpose. Althoug all of them are explained here, you most likely will only need\nthe first four.\n\nAll mentioned callbacks have this signature: `function (err, result) { ... }`.\n\nThe below explanations assume that you required dog in your module via `var dog = require('dog');`.\n\n### provideFrom\n\n`dog.provider.provideFrom(fullPathToBlog)`\n\nCall this before using any of the other provider functions to tell the provider in which directory your blog lives\n(i.e., where the `blog.json` file is found).\n\n### concatentateStyles\n\n`dog.provider.concatenateStyles(callback)`\n\nConcatenates all styles from `assets/styles` is is configured to include (see [includeStyles](#includestyles)) and calls\nback with the resulting css.\n\n### provideAll\n\n`dog.provider.provideAll(callback)`\n\nGathers metadata of all posts that were published to your blog and attaches rendered html. Calls back with the result.\n\n**Example Result:**\n\n```\n[ \n  { name: 'my-first-post',\n     metadata: \n      { created: Sun Sep 16 2012 11:54:37 GMT-0400 (EDT),\n        updated: Sun Sep 16 2012 16:42:37 GMT-0400 (EDT),\n        tags: ['tag1', tag2'],\n        name: 'my-first-post',\n        title: 'Getting started' },\n     html: { ... } \n  },\n  { name: 'my-second-post',\n     metadata: \n      { created: Sun Sep 17 2012 11:54:37 GMT-0400 (EDT),\n        updated: Sun Sep 17 2012 16:42:37 GMT-0400 (EDT),\n        tags: ['tag2', tag3'],\n        name: 'my-second-post',\n        title: 'Getting started again' },\n     html: { ... } \n  }\n]\n```\n\n### provideUpdatedSince\n\n`dog.provider.provideUpdatedSince (when, callback)`\n\nSame as [provideAll](#provideall) except only posts updated since `when`, which is a `Date` object, are included.\n\n### copyImages\n\n`dog.copyImages(fullPath, callback)`\n\nCopies all images found inside your blog (i.e., in `assets/images`) to the `fullPath` given.\n\nCalls back with an error if it failed or null if successfull.\n\n### getAllPosts\n\n`dog.provider.getAllPosts(callback)`\n\nCalls back with a string array containing names of all posts that were published to your blog.\n\n### getAllTags\n\n`dog.provider.getAllTags`\n\nCalls back with a string array containing all tags found in any of the posts that were published to your blog.\n\n### getPostMetadata\n\n`dog.provider.getPostMetadata(postName, callback)`\n\nCalls back with metadata of the given post.\n\n**Example Result:**\n\n```\n{ created: Sun Sep 16 2012 11:54:37 GMT-0400 (EDT),\n  updated: Sun Sep 16 2012 16:42:37 GMT-0400 (EDT),\n  tags: [ 'dog', 'tutorial', 'nodejs' ],\n  name: 'dog-tutorial',\n  title: 'Getting started with dog' }\n```\n\n### getPostHtml\n\n`dog.provider.getPostHtml(postName, callback)`\n\nCalls back with the rendered html of the given post.\n\n### blog directories\n\nVarious functions return full paths to important directories inside your blog. \n\nThese are:\n\n`dog.provider.getAssetsDir()`\n\n`dog.provider.getImagesDir()`\n\n`dog.provider.getStylesDir()`\n\n### getStylesFiles\n\n`dog.provider.getStylesFiles(callback)`\n\nCalls back with a list of full paths of all styles included in your blog.\n\n### printSummary\n\n`dog.provider.printSummary`\n\nPrints out a summary of your blog, including importand directories and published posts.\n\n## Styling\n\nAside from including styles targeting `.blog-post` inside your sites styles file, you can also edit the styles included\nwith your blog inside `assets/styles`.\n\nYou also can include additional styles by dropping them into that folder and including them in your blog via\n[includeStyles](#includestyles).\n\nThe `code.css` style is a [SyntaxHighlighter](http://alexgorbatchev.com/SyntaxHighlighter) theme and can be replaced\nwith any of the themes found [here](http://alexgorbatchev.com/SyntaxHighlighter/manual/themes/).\n\nThis will change the looks of your syntax highlighted code.\n\nYou may have to edit `code-fixes.css` as well in that case, since the styles in there are closely related.\n\n## Examples\n\n### Blog Only\n\nLook at and play with [blog-only](https://github.com/thlorenz/dog/tree/master/examples/blog-only) to understand\nbetter how to manage your blog and/or preview posts.\n\n### Blog Site\n\nLook at [blog-site](https://github.com/thlorenz/dog/tree/master/examples/blog-site) in order to get an idea on how to\nuse dog to provide your blog from a website.\n\n### Tutorial\n\nYou can follow along with the [getting started tutorial](http://thlorenz.com/blog/dog-tutorial) to get a better\nidea about how to use dog.\n\n\n[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/thlorenz/dog/trend.png)](https://bitdeli.com/free \"Bitdeli Badge\")\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthlorenz%2Fdog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthlorenz%2Fdog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthlorenz%2Fdog/lists"}