From ceab72ad341bb216467a3bdaf6ee0a32be99de02 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Wed, 26 Nov 2014 00:02:55 +0000 Subject: [PATCH] page.tmpl: tell mobile browsers we have a responsive layout, unless told not to Mobile browsers typically assume that arbitrary web pages are designed for a "desktop-sized" browser window (around 1000px) and display that layout, zoomed out, in order to avoid breaking naive designs that assume nobody will ever look at a website on a phone or something. People who are actually doing "responsive design" need to opt-in to mobile browsers rendering it at a more normal size. --- IkiWiki.pm | 7 +++++++ IkiWiki/Render.pm | 1 + templates/page.tmpl | 1 + 3 files changed, 9 insertions(+) diff --git a/IkiWiki.pm b/IkiWiki.pm index dfe89ad32..03f058ef7 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -549,6 +549,13 @@ sub getsetup () { safe => 0, rebuild => 0, }, + responsive_layout => { + type => "boolean", + default => 1, + description => "theme has a responsive layout? (mobile-optimized)", + safe => 1, + rebuild => 1, + }, } sub defaultconfig () { diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm index 9d6f636a2..c1a3dcbf2 100644 --- a/IkiWiki/Render.pm +++ b/IkiWiki/Render.pm @@ -134,6 +134,7 @@ sub genpage ($$) { ctime => displaytime($pagectime{$page}, undef, 1), baseurl => baseurl($page), html5 => $config{html5}, + responsive_layout => $config{responsive_layout}, ); run_hooks(pagetemplate => sub { diff --git a/templates/page.tmpl b/templates/page.tmpl index 301c737fe..9e8b330a4 100644 --- a/templates/page.tmpl +++ b/templates/page.tmpl @@ -8,6 +8,7 @@ <TMPL_VAR TITLE> +