{"id":23222969,"url":"https://github.com/dckt/bloggy","last_synced_at":"2025-04-05T16:29:35.597Z","repository":{"id":249526285,"uuid":"831707806","full_name":"DCKT/bloggy","owner":"DCKT","description":"Mini blog builder written in Rust","archived":false,"fork":false,"pushed_at":"2024-07-30T13:28:09.000Z","size":36,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-11T13:27:06.281Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","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/DCKT.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-21T11:48:21.000Z","updated_at":"2024-07-30T13:28:13.000Z","dependencies_parsed_at":"2024-07-26T15:04:38.708Z","dependency_job_id":null,"html_url":"https://github.com/DCKT/bloggy","commit_stats":null,"previous_names":["dckt/rust-blog-builder"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DCKT%2Fbloggy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DCKT%2Fbloggy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DCKT%2Fbloggy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DCKT%2Fbloggy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DCKT","download_url":"https://codeload.github.com/DCKT/bloggy/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247365010,"owners_count":20927244,"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-12-18T23:15:34.114Z","updated_at":"2025-04-05T16:29:35.565Z","avatar_url":"https://github.com/DCKT.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bloggy\n\nA minimalistic blog builder.\n\nBuild a file based structure blog in less than a second.\n\n## Structure\n\n```\n./\n  public/\n    styles.css\n  templates/\n    index.html\n    article.html\n  blog/\n    article-title/\n      index.md\n      article-assets.png\n```\n\n2 HTML files templates are **required** :\n\n\u003cdetails\u003e\n  \u003csummary\u003eindex.html\u003c/summary\u003e\n\n```html\n\u003c!DOCTYPE html\u003e\n\u003chtml lang=\"en\"\u003e\n  \u003chead\u003e\n    \u003cmeta charset=\"UTF-8\" /\u003e\n    \u003cmeta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" /\u003e\n    \u003ctitle\u003eHello world\u003c/title\u003e\n    \u003clink rel=\"stylesheet\" href=\"/public/style.css\" /\u003e\n  \u003c/head\u003e\n  \u003cbody\u003e\n    \u003cnav class=\"nav\"\u003e\n      \u003ca href=\"/\" class=\"nav-title\"\u003e~/blog\u003c/a\u003e\n    \u003c/nav\u003e\n\n    \u003cmain class=\"articles-list\"\u003e\n      \u003cdiv class=\"article\"\u003e\n        \u003ca href=\"/blog/new-article\" class=\"article-link\"\u003e\n          \u003ch2 class=\"article-title\"\u003enew fancy article !\u003c/h2\u003e\n          \u003cp class=\"article-description\"\u003e\n            Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque\n            elementum a quam a varius.\n          \u003c/p\u003e\n        \u003c/a\u003e\n      \u003c/div\u003e\n\n      \u003cdiv class=\"article\"\u003e\n        \u003ca href=\"/blog/random-article\" class=\"article-link\"\u003e\n          \u003ch2 class=\"article-title\"\u003eRandom article\u003c/h2\u003e\n          \u003cp class=\"article-description\"\u003e\n            Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque\n            elementum a quam a varius.\n          \u003c/p\u003e\n        \u003c/a\u003e\n      \u003c/div\u003e\n    \u003c/main\u003e\n  \u003c/body\u003e\n\u003c/html\u003e\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003earticle.html\u003c/summary\u003e\n\n```html\n\u003c!DOCTYPE html\u003e\n\u003chtml lang=\"en\"\u003e\n  \u003chead\u003e\n    \u003cmeta charset=\"UTF-8\" /\u003e\n    \u003cmeta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" /\u003e\n    \u003ctitle\u003e{{article.title}}\u003c/title\u003e\n    \u003clink rel=\"stylesheet\" href=\"/public/style.css\" /\u003e\n    \u003cmeta name=\"description\" content=\"{{article.description}}\" /\u003e\n  \u003c/head\u003e\n  \u003cbody\u003e\n    {{nav}}\n    \u003cmain class=\"article-detail\"\u003e\n      \u003ch1 class=\"article-title\"\u003e{{article.title}}\u003c/h1\u003e\n      \u003carticle\u003e{{article.content}}\u003c/article\u003e\n    \u003c/main\u003e\n    \u003cscript type=\"module\"\u003e\n      import { codeToHtml } from \"https://esm.sh/shiki@1.0.0\";\n      const codeBlocks = [...document.querySelectorAll(\"code\")];\n\n      codeBlocks.forEach(async (codeBlock) =\u003e {\n        codeBlock.innerHTML = await codeToHtml(codeBlock.innerText, {\n          lang: codeBlock.className.replace(\"language-\", \"\"),\n          theme: \"github-dark\",\n        });\n      });\n    \u003c/script\u003e\n  \u003c/body\u003e\n\u003c/html\u003e\n```\n\n\u003c/details\u003e\n\nA CSS `styles.css` is required in the `public` folder\n\u003cdetails\u003e\n  \u003csummary\u003estyles.css\u003c/summary\u003e\n\n```css\n/*\n  1. Use a more-intuitive box-sizing model.\n*/\n*,\n*::before,\n*::after {\n  box-sizing: border-box;\n}\n/*\n  2. Remove default margin\n*/\n* {\n  margin: 0;\n}\n/*\n  Typographic tweaks!\n  3. Add accessible line-height\n  4. Improve text rendering\n*/\nbody {\n  line-height: 1.5;\n  -webkit-font-smoothing: antialiased;\n}\n/*\n  5. Improve media defaults\n*/\nimg,\npicture,\nvideo,\ncanvas,\nsvg {\n  display: block;\n  max-width: 100%;\n}\n/*\n  6. Remove built-in form typography styles\n*/\ninput,\nbutton,\ntextarea,\nselect {\n  font: inherit;\n}\n/*\n  7. Avoid text overflows\n*/\np,\nh1,\nh2,\nh3,\nh4,\nh5,\nh6 {\n  overflow-wrap: break-word;\n}\n\n@import url(\"https://fonts.googleapis.com/css2?family=Nunito+Sans:ital,opsz,wght@0,6..12,200..1000;1,6..12,200..1000\u0026display=swap\");\n@import url(\"https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,100..800;1,100..800\u0026display=swap\");\n\n/* https://catppuccin.com/palette */\n:root {\n  /* Mocha theme */\n  --rosewater: #f5e0dc;\n  --flamingo: #f2cdcd;\n  --pink: #f5c2e7;\n  --mauve: #cba6f7;\n  --red: #f38ba8;\n  --maroon: #eba0ac;\n  --peach: #fab387;\n  --yellow: #f9e2af;\n  --green: #a6e3a1;\n  --teal: #94e2d5;\n  --sky: #89dceb;\n  --sapphire: #74c7ec;\n  --blue: #89b4fa;\n  --lavender: #b4befe;\n  --text: #cdd6f4;\n  --subtext-1: #bac2de;\n  --subtext-0: #a6adc8;\n  --overlay-2: #9399b2;\n  --overlay-1: #7f849c;\n  --overlay-0: #6c7086;\n  --surface-2: #585b70;\n  --surface-1: #45475a;\n  --surface-0: #313244;\n  --base: #1e1e2e;\n  --mantle: #181825;\n  --crust: #11111b;\n\n  --container: 650px;\n}\n\nbody {\n  background-color: var(--base);\n  padding: 1rem;\n  font-family: \"Nunito Sans\", sans-serif;\n  font-optical-sizing: auto;\n  text-decoration: none;\n}\n.nav {\n  max-width: var(--container);\n  margin: 0 auto 3rem auto;\n\n  .nav-title {\n    font-size: 2.25rem;\n    font-weight: bold;\n    color: var(--rosewater);\n    font-family: \"JetBrains Mono\";\n    text-decoration: none;\n  }\n}\n\n.articles-list {\n  max-width: var(--container);\n  margin: auto;\n  display: flex;\n  flex-direction: column;\n  gap: 24px;\n\n  .article-link {\n    font-size: 1.25rem;\n    color: var(--peach);\n    font-weight: 700;\n    text-decoration: none;\n    padding: 0.25rem 0.5rem;\n    display: block;\n    border-radius: 0.5rem;\n\n    \u0026:hover {\n      background: #f5e0dc1c;\n    }\n  }\n\n  .article-description {\n    font-size: 1.125rem;\n    font-weight: 400;\n    color: var(--rosewater);\n  }\n}\n\n.article-detail {\n  max-width: var(--container);\n  margin: auto;\n}\n\n.article-detail .article-title {\n  font-size: 2.2rem;\n  color: var(--peach);\n  font-weight: 800;\n}\n\n.article-detail article {\n  color: var(--rosewater);\n\n  h2,\n  h3,\n  h4,\n  h5,\n  h6 {\n    color: var(--yellow);\n    margin-bottom: 0.25rem;\n  }\n\n  h2 {\n    font-size: 2rem;\n  }\n  h3 {\n    font-size: 1.75rem;\n  }\n  h4 {\n    font-size: 1.525rem;\n  }\n  h5 {\n    font-size: 1.3125rem;\n  }\n  h5 {\n    font-size: 1.25rem;\n  }\n  h6 {\n    font-size: 1.125rem;\n  }\n\n  strong {\n    font-weight: 600;\n    color: var(--yellow);\n  }\n  em {\n    font-style: italic;\n  }\n\n  p {\n    font-size: 1.125rem;\n    margin-bottom: 1rem;\n  }\n\n  code pre {\n    border-radius: 0.25rem;\n    padding: 0.5rem 0.75rem;\n    margin-bottom: 1rem;\n    font-size: 0.875rem;\n  }\n\n  img {\n    border-radius: 0.5rem;\n    max-width: 100%;\n    margin: auto;\n    display: block;\n  }\n}\n```\n\n\u003c/details\u003e\n\nNow run the script : \n```sh\n./bloggy build\n```\n\nYou should see a `dist` folder with your blog built !\n\n\n## Templates\n\nAvailable variables :\n\n```rust\nstruct Article {\n  title: String,\n  description: String,\n  content: String,\n  path: String,\n  tags: Vec\u003cString\u003e,\n}\n```\n\nFor your blog post, you can use frontmatter :\n\n```md\n---\ntitle: Random article\ndescription: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque elementum a quam a varius.\ntags:\n  - Rust\n---\n\nMy blog post\n```\n\n## How it works\n\nThe `build` commands will read every folders in the `blog` folders, copies each assets and transforms the `index.md` in an `index.html` file with his content in the current working directory under `dist/blog`.\nThe `public` folder is copied as his in `dist/public`.\n\nUnder the hood it uses the template engine [minijinja](https://docs.rs/minijinja/latest/minijinja/).\n\nNote: the `build` command clean the `dist` folder.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdckt%2Fbloggy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdckt%2Fbloggy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdckt%2Fbloggy/lists"}