Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/joshtynjala/openfl-custom-index-html-sample
A sample OpenFL project that customizes the html5/template/index.html template file
https://github.com/joshtynjala/openfl-custom-index-html-sample
haxe openfl openfl-samples openfl-target-html5
Last synced: 22 days ago
JSON representation
A sample OpenFL project that customizes the html5/template/index.html template file
- Host: GitHub
- URL: https://github.com/joshtynjala/openfl-custom-index-html-sample
- Owner: joshtynjala
- Created: 2023-03-10T16:53:37.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-11-16T22:16:02.000Z (about 1 year ago)
- Last Synced: 2024-10-30T08:26:04.104Z (2 months ago)
- Topics: haxe, openfl, openfl-samples, openfl-target-html5
- Language: HTML
- Homepage:
- Size: 5.86 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
Awesome Lists containing this project
README
# OpenFL custom _index.html_ template
The [OpenFL](https://openfl.org) library for Haxe contains a number of template files that are used when building a project. You can find them in the [_assets/templates_](https://github.com/openfl/openfl/tree/develop/assets/templates) directory. Using the `` element in _project.xml_, it's possible to replace one or more of these template files with custom versions, on a per-project basis, and without forking OpenFL.
This sample project contains a directory named [_custom-templates_](https://github.com/joshtynjala/openfl-custom-index-html-sample/tree/main/custom-templates). It is configured in [_project.xml_](https://github.com/joshtynjala/openfl-custom-index-html-sample/tree/main/project.xml) like this:
```xml
```
Inside [_custom-templates_](https://github.com/joshtynjala/openfl-custom-index-html-sample/tree/main/custom-templates), there's a file at [_html5/template/index.html_](https://github.com/joshtynjala/openfl-custom-index-html-sample/tree/main/custom-templates/html5/template/index.html). The relative path to this file matches the file named [_html5/template/index.html_](https://github.com/openfl/openfl/tree/develop/assets/templates/html5/template/index.html) inside OpenFL's [_assets/templates_](https://github.com/openfl/openfl/tree/develop/assets/templates) directory.
To confirm that the custom [_html5/template/index.html_](https://github.com/joshtynjala/openfl-custom-index-html-sample/tree/main/custom-templates/html5/template/index.html) is being used by the project, simply compile and run, and you'll see a different HTML page than usual.
```sh
openfl test html5
```Sample created by [Josh Tynjala](https://github.com/sponsors/joshtynjala), the author of [Feathers UI](https://feathersui.com/) and core contributor to [OpenFL](https://openfl.org/).