- Fix ($user-html-header$) to support <script src="foo">. While the rendered

result of <script> end tag by the DSSSL stylesheet was </script\n> to avoid
  unnecessary spaces after the tag, most of the www browsers and HTML
  processors cannot recognize it as the end of <script>.  To workaround this,
  ($user-html-headers$) now outputs the start and the end tag independently
  in each single line.

- Add %html-header-script% to control if <script> is included in <head>.

- Add html.header.script.google knob for SGML and XML documents in non-DocBook
  DTD.  %html.header.script.google; and $html.header.script.google.

- Add WWWFREEBSDORG make(1) knob to control the <script> inclusion.  Note that
  <script> is disabled temporarily.

Discussed with:	gjb and core
Tested by:	gjb
This commit is contained in:
Hiroki Sato 2012-01-31 02:01:32 +00:00
parent 6d66f15a84
commit d4e4d91864
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/www/; revision=38352
4 changed files with 19 additions and 6 deletions

View file

@ -4,7 +4,7 @@
<!ENTITY title "The FreeBSD Project">
]>
<!-- $FreeBSD: www/en/index.xsl,v 1.175 2012/01/10 04:38:05 gjb Exp $ -->
<!-- $FreeBSD: www/en/index.xsl,v 1.176 2012/01/12 20:42:22 hrs Exp $ -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:import href="http://www.FreeBSD.org/XML/www/lang/share/sgml/libcommon.xsl"/>
@ -20,6 +20,7 @@
<xsl:param name="news.project.xml" select="'none'"/>
<xsl:param name="events.xml-master" select="'none'"/>
<xsl:param name="events.xml" select="'none'"/>
<xsl:param name="html.header.script.google" select="'IGNORE'"/>
<xsl:output type="html" encoding="&xml.encoding;"
doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"/>
@ -44,7 +45,9 @@
<link rel="stylesheet" media="screen" href="&base;/layout/css/fixed.css?20060509" type="text/css" title="Normal Text" />
<link rel="alternate stylesheet" media="screen" href="&base;/layout/css/fixed_large.css" type="text/css" title="Large Text" />
<script type="text/javascript" src="&base;/layout/js/styleswitcher.js"></script>
<xsl:if test="$html.header.script.google != 'IGNORE'">
<script type="text/javascript" src="&base;/layout/js/google.js"></script>
</xsl:if>
<link rel="alternate" type="application/rss+xml"
title="FreeBSD Project News" href="&base;/news/rss.xml" />
<link rel="alternate" type="application/rss+xml"

View file

@ -1,5 +1,5 @@
# bsd.web.mk
# $FreeBSD: www/share/mk/web.site.mk,v 1.80 2011/07/25 07:35:42 hrs Exp $
# $FreeBSD: www/share/mk/web.site.mk,v 1.81 2011/09/27 19:08:40 gjb Exp $
#
# Build and install a web site.
@ -78,6 +78,10 @@ HTML2TXTOPTS?= -dump ${HTML2TXTFLAGS}
ISPELL?= ispell
ISPELLOPTS?= -l -p /usr/share/dict/freebsd ${ISPELLFLAGS}
.if defined(WWWFREEBSDORG)
SGMLNORMOPTS+= -i html.header.script.google
.endif
WEBCHECK?= ${PREFIX}/bin/webcheck
WEBCHECKOPTS?= -ab ${WEBCHECKFLAGS}
WEBCHECKDIR?= /webcheck

View file

@ -1,4 +1,4 @@
<!-- $FreeBSD: www/share/sgml/common.ent,v 1.6 2011/11/27 08:01:03 glewis Exp $ -->
<!-- $FreeBSD: www/share/sgml/common.ent,v 1.7 2012/01/16 07:11:53 glewis Exp $ -->
<!-- FreeBSD Common Entities -->
<!-- PUBLIC "-//FreeBSD//ENTITIES FreeBSD Common Entities//EN" -->
@ -18,6 +18,7 @@
<!ENTITY % xml.features "IGNORE">
<!ENTITY % sgml.features "INCLUDE">
<!ENTITY % html.header.script.google "IGNORE">
<!--
Base is the absolute URL for the given page, minus the actual page

View file

@ -1,4 +1,4 @@
<!-- $FreeBSD: www/share/sgml/header.ent,v 1.17 2011/08/15 19:14:53 gjb Exp $ -->
<!-- $FreeBSD: www/share/sgml/header.ent,v 1.18 2011/12/31 11:22:10 bz Exp $ -->
<!-- FreeBSD HTML Header Entities -->
<!-- PUBLIC "-//FreeBSD//ENTITIES HTML FreeBSD Header Entities//EN" -->
@ -79,6 +79,11 @@
]]>
<!ENTITY header1.rsslink ''>
<![ %html.header.script.google; [
<!ENTITY header1.googlejs '<script type="text/javascript" src="&enbase;/layout/js/google.js"></script>'>
]]>
<!ENTITY header1.googlejs ''>
<!ENTITY header1 '
<head>
<title>&title;</title>
@ -86,7 +91,7 @@
&header1.link;
&header1.rsslink;
<script type="text/javascript" src="&enbase;/layout/js/styleswitcher.js"></script>
<script type="text/javascript" src="&enbase;/layout/js/google.js"></script>
&header1.googlejs;
</head>
'>