{"id":20858653,"url":"https://github.com/thesephist/dessi","last_synced_at":"2025-05-12T08:31:29.155Z","repository":{"id":57211981,"uuid":"132515876","full_name":"thesephist/dessi","owner":"thesephist","description":"A quick, simple server-side-includes expander","archived":false,"fork":false,"pushed_at":"2018-06-05T22:55:40.000Z","size":12,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-15T03:51:49.805Z","etag":null,"topics":["apache","command-line-tool","nginx","server-side-rendering"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thesephist.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-05-07T20:59:31.000Z","updated_at":"2021-09-18T10:49:17.000Z","dependencies_parsed_at":"2022-09-05T23:30:47.153Z","dependency_job_id":null,"html_url":"https://github.com/thesephist/dessi","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thesephist%2Fdessi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thesephist%2Fdessi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thesephist%2Fdessi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thesephist%2Fdessi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thesephist","download_url":"https://codeload.github.com/thesephist/dessi/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225130753,"owners_count":17425506,"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":["apache","command-line-tool","nginx","server-side-rendering"],"created_at":"2024-11-18T04:46:49.039Z","updated_at":"2024-11-18T04:46:49.567Z","avatar_url":"https://github.com/thesephist.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Dessi\n\nA quick, simple server-side-includes expander.\n\n## What's server-side includes?\n\nServer-side-includes (SSI) is one of the directives that most popular web servers like `httpd` (Apache) and `nginx` implement, that allow for \"dynamic\" construction of HTML without having a dynamic application running. You can decompose an HTML page into separate page parts, and \"include\" them using an HTML comment-like \"include directive\" in the HTML.\n\nAn SSI in action looks like this;\n\n```html\n\u003chtml\u003e\n  \u003chead\u003e\n    \u003ctitle\u003eMain page\u003c/title\u003e\n    \u003c!--#include virtual=\"/parts/head_part.html\" --\u003e\n  \u003c/head\u003e\n  \u003cbody\u003e\n    \u003c!--#include virtual=\"/parts/page_header_part.html\" --\u003e\n    \u003cmain\u003e...\u003c/main\u003e\n    \u003c!--#include virtual=\"/parts/page_footer_part.html\" --\u003e\n  \u003c/body\u003e\n\u003c/html\u003e\n```\n\nThe web server will attempt to parse the HTML for the include directives, and dynamically fill them in when the page is served.\n\nDessi will take an entire site (or parts of it, if told to), expand out the include directives as if they were being served by a web server, but save those files instead to disk, so you have a fully static version of the SSI site.\n\n### Why an expander?\n\nI recently had to migrate an SSI-enabled static site out of a controlled environment with SSI into a completely static host. Rather than build a specific script to do the \"expansion\" into a completely static site, I wrote __Dessi__ to make the process generalizable to my other static sites.\n\n## Install and use\n\nInstall with npm. Dessi is designed to be installed globally as an NPM package:\n\n```sh\n# with the npm package manager\nnpm install --global dessi\n\n# ... or with the yarn package manager\nyarn global add dessi\n```\n\nAnd that's it! Invoke Dessi by going to a directory that contains the files you'd like to expand, and run:\n\n```sh\ndessi --source=\u003csource directory\u003e --target=\u003ctarget directory\u003e\n```\n\nIf you've used `npx`, you can also just run Dessi as a package with `npx dessi \u003c...options\u003e` without installing anything.\n\nYou'll find more instructions in the __Manual__ section below.\n\n## Manual\n\nDessi takes three command line arguments:\n\n- **--source**: the source directory. Usually, I'll `cd` to this directory and just pass `--source=.`. This directory is also assumed to be the root of the website `/`, unless a `--root` option is specified.\n\n- **--target**: the target or destination directory for the expansion. All files and folders in the source directory will be copied into this directory with the exception mentioned below (*). This is usually my `dist/` or `build/` directory of the project, and `.gitignore`'d.\n\n- **--root** (optional): if the \"root\" directory of the static site (where index.html usually lives) is different than the `--source` directory, You can explicitly specify a different root directory to use in the expansion of files in the SSI directives. Otherwise, Dessi will default to the source directory specified.\n\nFor example:\n\n```sh\ndessi --root=. --target=./dist --source=.\n```\n\nNote that Dessi explicitly requires you to use the `=` sign to specify options. This is something I'd like to fix but haven't had the time to yet, as it works fine without this functionality.\n\n[__*__] Most of the time, I'd like to expand the contents of everything in a repository into a static folder _within_ that repository. Dessi handles this use case by ignoring the destination folder if that folder is nested within the source folder.\n\nFor example:\n\n```sh\n$ ls .\n\nmydir/ destdir/ other_files.html\n\n$ dessi --source=. --target=./destdir\n\n[...] # output abridged\n\n$ ls destdir\n\nmydir/ other_files.html # destdir/ is missing, since it was the target directory\n\n```\n\n## Future plans\n\nThese are things I'd like Dessi to be able to support, but haven't had time to add yet.\n\n1. Support for replacing / expanding files in-place without copying.\n2. Support for specifying options without the `=` signs.\n3. Generally better and more helpful error handling.\n\n# License\n\nDessi is licensed under the permissive MIT License. See `LICENSE` for more information.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthesephist%2Fdessi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthesephist%2Fdessi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthesephist%2Fdessi/lists"}