{"id":29893603,"url":"https://github.com/irkode/highlightjs-hugo-html","last_synced_at":"2025-08-01T03:46:58.449Z","repository":{"id":303448546,"uuid":"1006446082","full_name":"irkode/highlightjs-hugo-html","owner":"irkode","description":"Hugo HTML Template Language Grammar for Highlight.js","archived":false,"fork":false,"pushed_at":"2025-07-07T17:19:32.000Z","size":28,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-07T18:09:53.689Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/irkode.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-22T09:38:29.000Z","updated_at":"2025-07-07T17:19:35.000Z","dependencies_parsed_at":"2025-07-07T18:20:53.547Z","dependency_job_id":null,"html_url":"https://github.com/irkode/highlightjs-hugo-html","commit_stats":null,"previous_names":["irkode/highlightjs-hugo-html"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/irkode/highlightjs-hugo-html","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/irkode%2Fhighlightjs-hugo-html","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/irkode%2Fhighlightjs-hugo-html/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/irkode%2Fhighlightjs-hugo-html/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/irkode%2Fhighlightjs-hugo-html/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/irkode","download_url":"https://codeload.github.com/irkode/highlightjs-hugo-html/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/irkode%2Fhighlightjs-hugo-html/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268166376,"owners_count":24206428,"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-01T02:00:08.611Z","response_time":67,"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":[],"created_at":"2025-08-01T03:46:50.052Z","updated_at":"2025-08-01T03:46:58.408Z","avatar_url":"https://github.com/irkode.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hugo HTML Template Language Grammar for Highlight.js\n\n[![license](https://badgen.net/badge/license/MIT/blue)](LICENSE)\n\nA language grammar to highlight [Hugo](https://gohugo.io)'s templating language with Highlight.js.\n\n- [CSS class reference](css-class-reference.md)\n\n## A word on auto detection\n\n_Handlebars_ and _Go templates_ (used by _Hugo_) have similar template tags. Without setting any relevance the Hugo\nmodules will in most cases loose. To overcome this situation we use the following relevance settings trying to beat\nHandlebars and still make it win for its own templates.\n\n- for Go template comments we use relevance = 10.\n\n   comments start with start with `{{/*` or `{{- /*` and end with `*/}}` or `*/ - }}`\n\n- the opening tag `{{-` is very special to Go templates, so we use relevance = 10\n\n- for functions in the _hugo_ namespace we use Relevance = 10 (e.g. hugo.IsDevelopment)\n\n- We mark the following _Handlebars_ opening template tags as invalid for the hugo modules: `{{#`, `{{\u003e`, `{{!--`, `{{!`\n\nKnown limitation:\n\nWe are unsure what happens if you include both `hugo-html` and `hugo.text`. Maybe the HTML variant will win if there's\nenough HTML around. Maybe not, maybe dependent on import order...\n\nIn most cases you want the `hugo-html` module only. If not, specify the language for each code block in that case.\n\n## Usage\n\nInclude the highlight.js library in your webpage or Node app, then load this module.\n\n### Static website or simple usage\n\nLoad the module after loading Highlight.js. Take the minified version from `dist` directory.\n\n```html\n\u003cscript type=\"text/javascript\" src=\"/path/to/highlight.min.js\"\u003e\u003c/script\u003e\n\u003cscript type=\"text/javascript\" src=\"/path/to/hugo-html.min.js\"\u003e\u003c/script\u003e\n\u003cscript type=\"text/javascript\"\u003e\n   hljs.highlightAll();\n\u003c/script\u003e\n```\n\n\u003c!-- TODO: publish to a CDN later\n\n### Using directly from the UNPKG CDN\n\n```html\n\u003cscript\n   type=\"text/javascript\"\n   src=\"https://unpkg.com/highlightjs-hugo-html@0.1.0/dist/hugo-html.min.js\"\n\u003e\u003c/script\u003e\n```\n\n-  More info: \u003chttps://unpkg.com\u003e\n--\u003e\n\n### With Node or another build system\n\nIf you're using Node / Webpack / Rollup / Browserify, etc, simply require the language module, then register it with\nHighlight.js.\n\n```javascript\nvar hljs = require(\"highlight.js\");\nvar hljsHugo = require(\"hugo-html\");\n\nhljs.registerLanguage(\"hugo-html\", hljsHugo);\nhljs.highlightAll();\n```\n\n## License\n\nThis package is released under the MIT License. See [LICENSE](LICENSE) file for details.\n\n### Author \u0026 Maintainer\n\n- Irkode \u003cirkode@rikode.de\u003e\n\n## Links\n\n- HighlightJS Hugo modules:\n\n   - [HighlightJS - Hugo HTML](https://github.com/irkode/highlightjs-hugo-html)\n   - [HighlightJS - Hugo TEXT](https://github.com/irkode/highlightjs-hugo-text)\n\n- [Highlight.js](https://highlightjs.org/) - [[view on GitHub]](https://github.com/highlightjs/highlight.js)\n\n- [Hugo](https://gohugo.io/) - [[view on GitHub]](https://github.com/gohugoio/hugo)\n\n- Go templating language\n   - https://pkg.go.dev/html/template\n   - https://pkg.go.dev/text/template\n\n---\n\nThis module is generated from a private repo, which as of now is a quite evil hack...\n\n- scans the hugoDocs for functions and built_ins\n- builds the javascript highlighter from a template\n- generates the supplemental files needed by highlight.js\n- populates the testcases depending on the variant\n- runs build and tests\n- pushes the updated stuff to the module repositories\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Firkode%2Fhighlightjs-hugo-html","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Firkode%2Fhighlightjs-hugo-html","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Firkode%2Fhighlightjs-hugo-html/lists"}