Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Bevy 2D Template
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Microhacks
Bevy 2D Template
Commits
5be8d550
Verified
Commit
5be8d550
authored
2 years ago
by
Louis
Browse files
Options
Downloads
Patches
Plain Diff
Set up flit post-processing for HTML
parent
2d81d034
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
game_core/Trunk.toml
+6
-1
6 additions, 1 deletion
game_core/Trunk.toml
game_core/flit.toml
+21
-0
21 additions, 0 deletions
game_core/flit.toml
with
27 additions
and
1 deletion
game_core/Trunk.toml
+
6
−
1
View file @
5be8d550
[build]
public_url
=
"./"
\ No newline at end of file
public_url
=
"/"
[[hooks]]
stage
=
"post_build"
command
=
"sh"
command_arguments
=
[
"-c"
,
"flit -i $TRUNK_STAGING_DIR/index.html -f $TRUNK_SOURCE_DIR/flit.toml --inline"
]
\ No newline at end of file
This diff is collapsed.
Click to expand it.
game_core/flit.toml
0 → 100644
+
21
−
0
View file @
5be8d550
["script[type='module']
"]
action
=
"wrap"
template
=
'''
<div id="root">
<button id="start_game">Start Game</button>
</div>
<script>
document.addEventListener('DOMContentLoaded', () => {
document.getElementById('start_game').addEventListener('click', function() {
let element = document.createElement('{{{TAG}}}');
let attr_string = `{{{ATTR}}}`
attr_string.split(' ').forEach(function(attr) {
let attr_array = attr.split('=');
element.setAttribute(attr_array[0], attr_array[1].slice(1, -1));
});
element.innerHTML = `{{{CONTENT}}}`;
document.body.appendChild(element);
});
});
</script>'''
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment