{"id":19124408,"url":"https://github.com/compilorama/triven","last_synced_at":"2025-09-03T15:41:56.954Z","repository":{"id":48100858,"uuid":"376136783","full_name":"compilorama/triven","owner":"compilorama","description":"A multi-language markdown-based blog generator.","archived":false,"fork":false,"pushed_at":"2025-04-12T21:34:23.000Z","size":1176,"stargazers_count":9,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-21T05:42:49.194Z","etag":null,"topics":["blog","markdown","multilingual","rss"],"latest_commit_sha":null,"homepage":"","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/compilorama.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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,"zenodo":null}},"created_at":"2021-06-11T20:34:19.000Z","updated_at":"2025-04-12T21:34:26.000Z","dependencies_parsed_at":"2024-06-29T18:39:39.618Z","dependency_job_id":"6b6d563a-5c01-4286-8df0-0617adbfdbf6","html_url":"https://github.com/compilorama/triven","commit_stats":{"total_commits":131,"total_committers":2,"mean_commits":65.5,"dds":0.01526717557251911,"last_synced_commit":"2a7fbae5e0e2ab6ef1bf48ac7a8091f72a8a5833"},"previous_names":["compilorama/triven"],"tags_count":39,"template":false,"template_full_name":null,"purl":"pkg:github/compilorama/triven","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/compilorama%2Ftriven","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/compilorama%2Ftriven/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/compilorama%2Ftriven/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/compilorama%2Ftriven/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/compilorama","download_url":"https://codeload.github.com/compilorama/triven/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/compilorama%2Ftriven/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272994613,"owners_count":25027897,"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","status":"online","status_checked_at":"2025-08-31T02:00:09.071Z","response_time":79,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["blog","markdown","multilingual","rss"],"created_at":"2024-11-09T05:29:01.428Z","updated_at":"2025-09-03T15:41:56.933Z","avatar_url":"https://github.com/compilorama.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Triven\n\u003e A multi-language markdown-based blog generator.\n\n[![CircleCI](https://circleci.com/gh/compilorama/triven/tree/master.svg?style=svg)](https://circleci.com/gh/compilorama/triven/tree/master)\n[![Coverage Status](https://coveralls.io/repos/github/compilorama/triven/badge.svg?branch=master)](https://coveralls.io/github/compilorama/triven?branch=master)\n\n## Installation\n\n```\nnpm install -D @compilorama/triven\n```\n\n## Usage\n\nTo get started with Triven, you need to run the following command at the root directory of your project:\n\n```\nnpx triven build\n```\n\nAfter running this command, a directory called `triven` and a demo post will be created.\n\n### Setup\n\nYou don't need to setup anything to see Triven in action. By default, Triven will look for markdown files in the project directory (and sub-directories) and will generate a blog - ready to be published - inside a directory called *triven*.\n\nHowever, you can override the default configuration values used to build your blog creating a file called `triven.config.js` in the root directory of your project containing the following options:\n\n``` javascript\n// triven.config.js\n\nmodule.exports = {\n  title: 'Your Blog Title',\n  // [Required] Used as browser window title on homepage.\n  // Default: Triven.\n  url: 'https://rafaelcamargo.com/blog',\n  // [Required ]Production URL where the blog will be deployed to.\n  // Used to build absolute URLs on RSS Feeds.\n  sourceDirectory: './posts',\n  // Directory where triven will look for markdown files.\n  // Default: Root directory of your project ('./').\n  outputDirectory: './dist',\n  // Directory where the final files will be saved.\n  // Default: './triven'.\n  lang: 'pt-BR',\n  // Used as default language for articles and homepage.\n  // Default: en-US.\n  homepagePostIntroType: 'description',\n  // Content to be used as post introduction on homepage.\n  // Options:\n  // 1. Post Excerpt: 'excerpt'\n  // 2. Post Description: 'description'\n  // Default: 'excerpt'.\n  // Note: Excerpts are automatically generated using\n  // the first 340 characters of the post body.\n  articleVars: {\n    // You can optionally set variables in your articles\n    // to be replaced with custom values in build time:\n    someCustomHtml: '\u003cdiv class=\"my-custom-element\"\u003eHello!\u003c/div\u003e',\n    // If a variable depends on the page language,\n    // you can set a function as value to handle any custom logic:\n    customButtonText: lang =\u003e lang == 'pt-BR' ? 'Enviar' : 'Send'\n  },\n  templates: {\n    article: './some/path/to/article/template.html',\n    // You can optionally set an HTML file as template for articles\n    homepage: './some/path/to/homepage/template.html',\n    // You can optionally set an HTML file as template for homepage\n    vars: {\n      // You can optionally set variables in your templates\n      // to be replaced with custom values in build time:\n      someVar: 'someValue',\n      // If a variable depends on the page language,\n      // you can set a function as value to handle any custom logic:\n      greet: lang =\u003e lang == 'pt-BR' ? 'Olá' : 'Hello!'\n    }\n  },\n  // You can optionally set custom translations for labels used by Triven:\n  translations: {\n    'en-US': {\n      availableRSSFeeds: 'RSS Feed options',      // Default: 'Available RSS Feeds'\n      availableLanguages: 'Language options',     // Default: 'Available languages'\n      currentLanguage: 'Selected language',       // Default: 'Current language'\n      multiLanguage: 'All languages',             // Default: 'Multi-language'\n      newer: 'Previous page',                     // Default: 'Newer'\n      older: 'Next page',                         // Default: 'Older'\n      readMore: 'Keep reading',                   // Default: 'Read more'\n      rssFeed: 'Feed',                            // Default: 'RSS Feed'\n      rssFeeds: 'Feeds',                          // Default: 'RSS Feeds'\n      seeAllPosts: 'All publications'             // Default: 'See all posts'\n    },\n    // You can add specific-language dictionaries if you have a multi-language blog:\n    'pt-BR': {\n      // Portuguese translations\n    }\n  },\n  formatters: {\n    // You can optionally set a custom date formatter.\n    // Formatter will receive the date string and the language set on the\n    // respective post markdown file.\n    // By default, date format will be month/day/year for US English posts and\n    // day/month/year for any other language.\n    date: (isoDateString, lang) =\u003e {\n      const [year, month, day] = isoDateString.split('-');\n      const date = new Date(parseInt(year), parseInt(month)-1, parseInt(day), 0);\n      const options = { day: 'numeric', month: 'long', year: 'numeric' };\n      return Intl.DateTimeFormat(lang, options).format(date);\n    }\n  }\n}\n```\n\n### Markdown Articles\n\nYou can prefix your Markdown articles with a header containing some metadata:\n\n| Name | Description | Default Value |\n|------|-------------|---------------|\n| title | Title for your post | Untitled |\n| lang | Language which your article is written in | language set on `triven.config.js` or en-US |\n| date | Date expressed according to ISO 8601 (YYYY-MM-DD) | None |\n| description | A brief description of your post (used in HTML meta tags) | None |\n| keywords | Keywords for your post (used in HTML meta tags) | None |\n| image | Relative path to an image to be used on social media | None |\n| imageAlt | Description for the image to be used on social media | None |\n| unlisted | Set as `true` to keep the post out of homepages | None |\n| externalUrl | URL for a post published in an external website | None |\n| excerpt | An optional text representing the first paragraphs of your post | First 340 chars of your post |\n\n**Important:** Do not forget to separate your article from its metadata with three dashes.\n\n#### Markdown Example\n\n```\n// hello-world.md\n\ntitle: Hello World!\ndate: 2021-08-20\ndescription: Saying hello to the world.\nkeywords: hello, world\nimage: ./greeting.png\nimageAlt: A person waving hands\n\n---\n\nIt's very easy to get started with Triven.\n```\n\n### Custom Templates\n\nYou can define your own HTML to be used as template for homepage and article. Just make sure that your HTML contain at least the following markup:\n\n#### Homepage\n\n``` html\n\u003c!DOCTYPE html\u003e\n\u003chtml\u003e\n  \u003chead\u003e\u003c/head\u003e\n  \u003cbody\u003e\n    {{ triven:posts }}\n    {{ triven:settings }}\n  \u003c/body\u003e\n\u003c/html\u003e\n```\n\n- `triven:posts`: List of posts.\n- `triven:settings`: Language and RSS selectors (for multi-language blogs).\n\n#### Article\n\n``` html\n\u003c!DOCTYPE html\u003e\n\u003chtml\u003e\n  \u003chead\u003e\u003c/head\u003e\n  \u003cbody\u003e\n    {{ triven:article }}\n    {{ triven:footer }}\n  \u003c/body\u003e\n\u003c/html\u003e\n```\n\n- `triven:article`: Post content.\n- `triven:footer`: Container for the \"See all posts\" link.\n\nYou can optionally set variables in your templates to be replaced in build time. To do so, you need define them as key/value pairs in your `triven.config.js`, and reference them in your template HTML file as follow:\n\n``` javascript\n// triven.config.js\n\nconst date = new Date();\n\nmodule.exports = {\n  templates: {\n    vars: {\n      copywrite: `©${date.getFullYear()} Triven`\n    }\n  }\n}\n```\n\n``` html\n\u003c!DOCTYPE html\u003e\n\u003chtml\u003e\n  \u003chead\u003e\u003c/head\u003e\n  \u003cbody\u003e\n    {{ triven:posts }}\n    {{ triven:settings }}\n    \u003cfooter\u003e\n      {{ copywrite }}\n    \u003c/footer\u003e\n  \u003c/body\u003e\n\u003c/html\u003e\n```\n\n**Note:** Variables in templates are *space insensitive*. You can write them as `{{copywrite}}` or `{{ copywrite }}`.\n\n## Contributing\n\nIf you want to contribute to this project, follow [these instructions](CONTRIBUTING.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcompilorama%2Ftriven","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcompilorama%2Ftriven","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcompilorama%2Ftriven/lists"}