Skip to content

Commit

Permalink
i
Browse files Browse the repository at this point in the history
  • Loading branch information
i1li committed May 6, 2024
1 parent 6bc4acc commit f795078
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
11 changes: 6 additions & 5 deletions 404.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Loading...</title>
<script type="text/javascript">
// Custom SPA 404 solution combining https://github.com/i1li/i frameworkless SPA with
// "Single Page Apps for GitHub Pages", (found below and in gh.js), and
// https://stackoverflow.com/a/65533465 - which performs an XHR on index.html and
// makes the content the document. Using this, plus putting the stylesheets and scripts from
// index.html in 404.html(minus gh.js), gives a smoother initial loading experience.
// Custom SPA 404 solution combining frameworkless SPA (https://github.com/i1li/i) and
// "Single Page Apps for GitHub Pages", (found below and in gh.js), with
// https://stackoverflow.com/a/65533465 - (performs an XHR on index.html and
// makes the content the document.) Putting the stylesheets and scripts from
// index.html in 404.html(minus gh.js), gives a smoother initial loading experience,
// reducing or eliminating blank screen flash when visiting non-root URLs in new tab.
var doc = document.getElementById('htmlbody');
xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Easy to use YouTube embed that saves space, bandwidth, & privacy. With a bare am
Stripped version of Lightest Youtube Embed to toggle display of any iframe or other content. [Demo at /jesus-and-his-religion](https://y0.netlify.app/jesus-and-his-religion/)

### [yt-titles.js](https://github.com/i1li/i/blob/main/yt-titles.js)
Updates all `<y-t>` elements on the page, `<y-t v="Your Video ID">` becomes `<y-t v="Your Video ID" t="The Video's Title">` To use, open a terminal in the project directory, & enter:
Updates all `<y-t>` elements on the page, `<y-t v="YouTube Video ID">` becomes `<y-t v="YouTube ID" t="The Video's Title">` To use, open a terminal in the project directory, & enter:
```bash
npm i axios
node yt-titles.js
Expand Down
2 changes: 1 addition & 1 deletion js/gh.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// converts it back into the correct url and adds it to the
// browser's history using window.history.replaceState(...),
// which won't cause the browser to attempt to load the new url.
// When the single page app is loaded further down in this file,
// When the single page app is loaded further down in index.html,
// the correct url will be waiting in the browser's history for
// the single page app to route accordingly.
(function(l) {
Expand Down

0 comments on commit f795078

Please sign in to comment.