@@ 48,11 48,13 @@ const process = async function(processing_started, to_process) {
processing_started.push(path);
if (path.endsWith('.html')) {
const doc = await getDoc(path, credentials);
+ const head = doc.querySelector('head');
+ const meta_viewport = doc.createElement('meta');
+ meta_viewport.setAttribute('name', 'viewport');
if (getContentLoc(path) === 'webspace') {
// Remove Redundant 'div'
doc.querySelector('div.titlepage')?.remove();
- const head = doc.querySelector('head');
// Fix Character Encoding
doc.querySelector('meta').remove();
const meta = doc.createElement('meta');
@@ 78,7 80,16 @@ const process = async function(processing_started, to_process) {
.forEach(script_tag => script_tag.remove());
head.appendChild(mathjax_script_tags[0]);
head.appendChild(mathjax_script_tags[1]);
+ // Viewport
+ meta_viewport.setAttribute(
+ 'content', 'width=743, initial-scale=1'
+ );
+ } else {
+ meta_viewport.setAttribute(
+ 'content', 'width=device-width, initial-scale=1'
+ );
}
+ head.appendChild(meta_viewport);
const ref_paths = getRefPaths(
pubignore, processing_started.concat(to_process), path, doc
);