{"id":16416806,"url":"https://github.com/angeal185/ghost-minify-output","last_synced_at":"2025-09-11T00:41:46.097Z","repository":{"id":108636770,"uuid":"94286163","full_name":"angeal185/ghost-minify-output","owner":"angeal185","description":"ghost middleware to minify compiled handlebars output","archived":false,"fork":false,"pushed_at":"2017-06-14T05:22:29.000Z","size":17,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-13T05:44:41.652Z","etag":null,"topics":["ghost","ghost-blog","ghost-cms","minification","minify","nodejs"],"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/angeal185.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":"2017-06-14T03:45:39.000Z","updated_at":"2024-10-28T20:21:23.000Z","dependencies_parsed_at":"2023-04-19T04:16:01.499Z","dependency_job_id":null,"html_url":"https://github.com/angeal185/ghost-minify-output","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/angeal185/ghost-minify-output","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angeal185%2Fghost-minify-output","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angeal185%2Fghost-minify-output/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angeal185%2Fghost-minify-output/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angeal185%2Fghost-minify-output/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/angeal185","download_url":"https://codeload.github.com/angeal185/ghost-minify-output/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angeal185%2Fghost-minify-output/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274556117,"owners_count":25307506,"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-09-10T02:00:12.551Z","response_time":83,"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":["ghost","ghost-blog","ghost-cms","minification","minify","nodejs"],"created_at":"2024-10-11T07:10:10.059Z","updated_at":"2025-09-11T00:41:46.052Z","avatar_url":"https://github.com/angeal185.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ghost-minify-output\nghost middleware to minify compiled handlebars output and to disable beautify\n\n\n## Instructions\n\n### minification setup\n\n- Open a console in ghost root dir [`/ghost`] and type:\n````\nnpm install --save html-minifier\n````\n\n- Add the file `settings.json` to your root dir.\n- Add the file `minify.js` to `ghost/core/server/middleware/`\n- Open the file `index.js` located at`ghost/core/server/middleware/`\n- Add thefollowing 2 lines of code to the list of required modules:\n(refer to the `example/index.js` file included in this repo if you dont understand)\n````\nsettings = require('../../../settings.json'),\nminifyOutput = require('./minify'),\n````\nFind the following lines in of code in the same file:\n````\nadminApp.set('view engine', 'hbs');\nadminApp.engine('hbs', adminHbs.express3({}));\n````\n- Below the above mentioned lines add the following 4 lines of code \n\n````\nif (settings.minifyOutput === true) {\n\t//minify html output\n\tblogApp.use(minifyOutput);\n}\n````\n\nYou can now enable/disable minification in the `/ghost/settings.json` file.\n- `true` = on\n- `false` = off\n\n### beautify setup\n\n(refer to the `example/theme-handler.js` file included in this repo if you dont understand)\n- Open the file `theme-handler.js` located at`ghost/core/server/middleware/`\n- Find the following lines of code:\n````\nactivateTheme: function activateTheme(blogApp, activeTheme) {\n        var hbsOptions,\n````\n- Below the above mentioned lines add the following 2 lines of code \n\n````\nsettings = require('../../../settings.json'),\nbeautify = settings.beautify,\n````\n- Find the following lines of code:\n````\nhbsOptions = {\n            partialsDir: [config.paths.helperTemplates],\n            onCompile: function onCompile(exhbs, source) {\n                return exhbs.handlebars.compile(source, {preventIndent: true});\n            }\n        };\n````\n- Replace the above mentioned lines with the following lines of code \n````\nhbsOptions = {\n            partialsDir: [config.paths.helperTemplates],\n            onCompile: function onCompile(exhbs, source) {\n                return exhbs.handlebars.compile(source, {preventIndent: true});\n            },\n\t\t\tbeautify\n\n        };\n````\nYou can now enable/disable beautify in the `/ghost/settings.json` file.\n- `true` = on\n- `false` = off\n\nDone.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fangeal185%2Fghost-minify-output","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fangeal185%2Fghost-minify-output","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fangeal185%2Fghost-minify-output/lists"}