{"id":31746763,"url":"https://github.com/irkode/highlightjs-hugo","last_synced_at":"2026-05-02T12:02:38.797Z","repository":{"id":315647412,"uuid":"1059620134","full_name":"irkode/highlightjs-hugo","owner":"irkode","description":"HighlightJS-Hugo - Syntax highlighting for Hugo templates","archived":false,"fork":false,"pushed_at":"2025-09-28T11:35:58.000Z","size":40,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-28T13:25:35.873Z","etag":null,"topics":[],"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/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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-18T17:36:53.000Z","updated_at":"2025-09-28T11:36:01.000Z","dependencies_parsed_at":"2025-09-19T22:12:18.197Z","dependency_job_id":null,"html_url":"https://github.com/irkode/highlightjs-hugo","commit_stats":null,"previous_names":["irkode/highlightjs-hugo"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/irkode/highlightjs-hugo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/irkode%2Fhighlightjs-hugo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/irkode%2Fhighlightjs-hugo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/irkode%2Fhighlightjs-hugo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/irkode%2Fhighlightjs-hugo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/irkode","download_url":"https://codeload.github.com/irkode/highlightjs-hugo/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/irkode%2Fhighlightjs-hugo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279001540,"owners_count":26083102,"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-10-09T02:00:07.460Z","response_time":59,"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-10-09T13:18:31.279Z","updated_at":"2026-05-02T12:02:38.775Z","avatar_url":"https://github.com/irkode.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Advanced syntax highlighting for HuGo templates\n\nDid you ever wonder why hugo templates seem to be randomly highlighted in [Discourse][]. The answer\nis dead simple: _Discourse_ uses [Highlight.js][] for syntax highlighting which does not support Go\nand Hugo templates.\n\nIt could look so nice\n\n![preview](highlightjs-hugo.png)\n\nTo improve that we implemented\n\n- _Highlight.js_ grammars\n- _Discourse_ theme components.\n\nBoth supporting the full set of Hugo's template keywords, built-in functions and aliases.\n\nRead more details in our [Documentation][] or directly pick them from our [Releases][] page.\n\n## Provided plugins\n\nCurrently we provide the following components\n\n* Highlight.js\n\n  Two grammars for [Hugo][]'s _Text_ and _HTML_ templates with auto detection[^2] and full keyword support.\n\n  Additionally we provide a ready to use _browser build_ with only our grammars[^2].\n\n* Discourse\n\n  Two theme components utilizing the above _Text_ and _HTML_ grammars.\n\n## Download\n\nReady to use modules are available as artifacts on our [Releases][] Page.\n\n## Usage and documentation\n\nFollow the instructions included in each artifact's `README.md`. To read before downloading, check\nout our [Documentation][]\n\n## Build\n\nFor standard use cases see _Download_ above.\n\n### Custom Highlight.js build\n\nTo build your own customized _Highlight.js_ installation grab the _highlightjs-hugo_ artifact and\nplace it in the extra folder of your _Highlight.js_ clone. Build that just as any other\n_Highlight.js_ grammar or a customized build.\n\nWith a customized build, we add the _Hugo_ keyword tables to the _Highlight.js_ core so these will\nget packed only once. The result is an unpacked saving of 10KB for the final engine.\n\n### Build our sources\n\nWe build our stuff using custom scripts; a combination of powershell, node and _Hugo_. These scripts\nwork fine for us. May work for you but no guarantee. Listed Version numbers are the on we use, might\nwork with others.\n\nWe are on Windows 11 Professional. Could be working for unix like systems, but that is untested.\nHave a look at our CI workflow script for the bare commands on a GitHub Ubuntu runner.\n\n- Components that have to be there\n  - Hugo - 0.160.1+\n  - Go 1.26.1+\n  - Node 22.14.0 (highlight.js requirement)\n\n- Components automatically provided by the build scripts\n  - _Highlight.js_ 11.11.1\n  - hugoDocs (as a hugo module)\n\n- Build all\n\n  ```powershell\n  git clone https://github.com/irkode/highlightjs-hugo/ highlightjs-hugo\n  set-location highlightjs-hugo\n  .\\build.ps1 -Verbose\n  ```\n\n- grab the results from `release` folder\n\nThe Powershell script provides a `Get-Help`.\n\nBe aware that that is in no way a general purpose build script. It just provides shorthands for our\nlocal development process. For special _Highlight.js_ build configurations you will need to directly\nuse the standard _Node_ and _npm_ scripts.\n\n## Contributing and Issues\n\nNever say never, but currently it's our working playground, nothing where one could do stable\ncontributions right now.\n\nUse the [Issue tracker][] for reporting bugs, asking question or raise ideas.\n\n## Hugo as a generator\n\nHugo is a powerful templating engine, and we utilize it to generate and assemble our grammars and\ndiscourse plugins.\n\n- fetch function and aliases from hugoDocs\n- generate keyword tables for the plugins\n- generate the hugo-lib module (grammar and keyword Javascript module)\n- generate Javascript code and supplementary files\n- create READMEs\n- generate tests\n- create source structure for our release assets\n- generate Discourse plugins based on the build results\n\n- and ofc for the standard use case - the documentation pages\n\nTake it as a nifty showcase to use Hugo as a generic templating and publishing engine -- beyond web\nsites.\n\nIf you want to dig in, you can find that here\n[](https://github.com/irkode/highlightjs-hugo/tree/main/build/hugen)\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][] : The main repository with additional grammars and plugins. Have a look\n- [Documentation][] : All about Highlight 4 Hugo\n- [Highlight.js][] : The Internet's favorite JavaScript syntax highlighter supporting Node.js and\n  the web\n- [Hugo][] : The world’s fastest framework for building websites\n- [Go HTML template](https://pkg.go.dev/html/template) : Go's html template package\n- [Go TEXT template](https://pkg.go.dev/text/template) : Go's text template package\n\n[highlightjs-hugo]: https://github.com/irkode/highlightjs-hugo/\n[Documentation]: https://irkode.github.io/highlightjs-hugo/\n[Issue tracker]: https://github.com/irkode/highlightjs-hugo/issues\n[Highlight.js]: https://highlightjs.org/\n[Hugo]: https://gohugo.io/\n[Discourse]: https://discourse.gohugo.io/\n[Releases]: https://github.com/irkode/highlightjs-hugo/releases/latest\n\n[^1]: and _XML_ cause that's needed for _Hugo-Html_\n[^2]: Check out details here:  [A word on auto detection](https://irkode.github.io/highlightjs-hugo/highlightjs/hugo-html#a-word-on-auto-detection)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Firkode%2Fhighlightjs-hugo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Firkode%2Fhighlightjs-hugo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Firkode%2Fhighlightjs-hugo/lists"}