mirror of
https://github.com/Xevion/v2.xevion.dev.git
synced 2025-12-06 01:16:49 -06:00
Fix inline javascript comments breaking via compression layout
Also added a note into the README about this issue for developers
This commit is contained in:
@@ -16,11 +16,18 @@ A jekyll-based static blog for my personal usage. Styling originally by [Delan A
|
||||
bundle install
|
||||
bundle exec jekyll serve --config _config.yml,_config_dev.yml
|
||||
bundle exec jekyll build
|
||||
```
|
||||
```
|
||||
|
||||
## Development Notes
|
||||
|
||||
This site uses a special HTML compression layout. This can cause production-only issues as the compression is not used in development. Know the [restrictions][compression-layout-restrictions] of this layout. The primary issue to remember is below.
|
||||
|
||||
- Inline javascript (`<script>`) tags with single-line comments (`// Single-line comment`) can break, essentially cause all of the javascript to lay upon one line.
|
||||
|
||||
[user-url]: https://github.com/Xevion/
|
||||
[repo-url]: https://github.com/Xevion/xevion.dev
|
||||
[azabani-repo-url]: https://github.com/delan/www.azabani.com
|
||||
[compression-layout-restrictions]: https://jch.penibelst.de/#restrictions
|
||||
[website-url]: https://xevion.dev
|
||||
[banner-url]: ./assets/img/index-cover.png
|
||||
[license-url]: https://github.com/Xevion/xevion.dev/blob/master/LICENSE
|
||||
|
||||
@@ -53,18 +53,17 @@ layout: compress
|
||||
{% endif %}
|
||||
</head>
|
||||
<body class="{% if page.wide or layout.wide %}wide{% endif %}">
|
||||
|
||||
{{ content }}
|
||||
</body>
|
||||
<script type="text/javascript">
|
||||
// Is all of this too much effort to make the animation play in just the right way?
|
||||
/** Is all of this too much effort to make the animation play in just the right way? **/
|
||||
window.onbeforeunload = function(){
|
||||
// Remember the origin so it can be checked for page reloadss
|
||||
/** Remember the origin so it can be checked for page reloads **/
|
||||
sessionStorage.setItem("origin", window.location.href);
|
||||
}
|
||||
|
||||
window.onload = function() {
|
||||
// Display the glitch effect on new page loads or reloads.
|
||||
/** Display the glitch effect on new page loads or reloads. **/
|
||||
let glitch_seen = sessionStorage.getItem('glitch')
|
||||
if (glitch_seen !== 'true' || window.location.href === sessionStorage.getItem("origin")) {
|
||||
sessionStorage.setItem('glitch', 'true')
|
||||
|
||||
Reference in New Issue
Block a user