feat: add nginx proxy for theme injection (cleaner approach)
This commit is contained in:
22
asciinema/theme/inject.js
Normal file
22
asciinema/theme/inject.js
Normal file
@@ -0,0 +1,22 @@
|
||||
// Inject custom theme CSS and favicon
|
||||
(function() {
|
||||
// Inject custom CSS
|
||||
var link = document.createElement('link');
|
||||
link.rel = 'stylesheet';
|
||||
link.href = '/theme/custom.css';
|
||||
document.head.appendChild(link);
|
||||
|
||||
// Inject custom favicon
|
||||
var favicon = document.createElement('link');
|
||||
favicon.rel = 'icon';
|
||||
favicon.type = 'image/svg+xml';
|
||||
favicon.href = '/theme/favicon.svg';
|
||||
|
||||
// Remove existing favicons first
|
||||
var existingFavicons = document.querySelectorAll('link[rel*="icon"]');
|
||||
existingFavicons.forEach(function(el) {
|
||||
el.remove();
|
||||
});
|
||||
|
||||
document.head.appendChild(favicon);
|
||||
})();
|
||||
Reference in New Issue
Block a user