diff options
author | randomdan <randomdan@localhost> | 2010-09-29 16:42:19 +0000 |
---|---|---|
committer | randomdan <randomdan@localhost> | 2010-09-29 16:42:19 +0000 |
commit | 35180f2e054d701f8906b3e036b4e23bad7efdde (patch) | |
tree | 91927eb42b7d6567015a9327b56bce1e8cf283aa | |
parent | Handle null fields (diff) | |
download | gentoobrowse-35180f2e054d701f8906b3e036b4e23bad7efdde.tar.bz2 gentoobrowse-35180f2e054d701f8906b3e036b4e23bad7efdde.tar.xz gentoobrowse-35180f2e054d701f8906b3e036b4e23bad7efdde.zip |
Split the browse stylesheet into it's component parts, add some SEO stuff
-rw-r--r-- | gentoobrowse/base.xslt | 14 | ||||
-rw-r--r-- | gentoobrowse/categories.xslt | 32 | ||||
-rw-r--r-- | gentoobrowse/category.xslt | 28 | ||||
-rw-r--r-- | gentoobrowse/home.xslt | 5 | ||||
-rw-r--r-- | gentoobrowse/package.xslt (renamed from gentoobrowse/browse.xslt) | 42 | ||||
-rw-r--r-- | gentoobrowse/present/categories.xml | 2 | ||||
-rw-r--r-- | gentoobrowse/present/category.xml | 2 | ||||
-rw-r--r-- | gentoobrowse/present/package.xml | 2 | ||||
-rw-r--r-- | gentoobrowse/style.css | 8 |
9 files changed, 92 insertions, 43 deletions
diff --git a/gentoobrowse/base.xslt b/gentoobrowse/base.xslt index bc6e7a8..47e6612 100644 --- a/gentoobrowse/base.xslt +++ b/gentoobrowse/base.xslt @@ -9,6 +9,7 @@ <head> <link rel="stylesheet" href="/style.css" type="text/css" /> <link rel="shortcut icon" href="/images/glogo-small.png" type="image/png" /> + <meta http-equiv="content-language" content="en" /> <xsl:call-template name="head" /> </head> <body> @@ -16,12 +17,12 @@ <div class="tabs"> <a href="/">Home</a> | <a href="/categories">Browse</a> | - <a href="/search">Search</a> | + <a href="/search" rel="nofollow">Search</a> | <xsl:if test="count(/gentoo/project2:session/project2:var[@name='loggedInUserID']) = 0"> - <a href="/login">Login</a> + <a href="/login" rel="nofollow">Login</a> </xsl:if> <xsl:if test="count(/gentoo/project2:session/project2:var[@name='loggedInUserID']) > 0"> - <a href="/accountHome">My Account</a> + <a href="/accountHome" rel="nofollow">My Account</a> </xsl:if> </div> <table width="100%"> @@ -58,14 +59,11 @@ <xsl:template name="head"> <title>Gentoo Browse</title> </xsl:template> - <xsl:template name="content"> - </xsl:template> <xsl:template match="package"> <li> <a> - <xsl:attribute name="href"> - /package/<xsl:value-of select="catname" />/<xsl:value-of select="pkgname" /> - </xsl:attribute> + <xsl:attribute name="href">/package/<xsl:value-of select="catname" />/<xsl:value-of select="pkgname" /></xsl:attribute> + <xsl:attribute name="title"><xsl:value-of select="description" /></xsl:attribute> <xsl:value-of select="catname" />/<xsl:value-of select="pkgname" /> </a> - <xsl:value-of select="description" /> </li> diff --git a/gentoobrowse/categories.xslt b/gentoobrowse/categories.xslt new file mode 100644 index 0000000..15b25af --- /dev/null +++ b/gentoobrowse/categories.xslt @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:project2="http://project2.randomdan.homeip.net/" exclude-result-prefixes="project2" > + <xsl:import href="base.xslt" /> + <xsl:output encoding="utf-8" method="html" media-type="text/html" indent="yes" + doctype-system="http://www.w3.org/TR/html4/loose.dtd" + doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN" /> + <xsl:template name="head"> + <title>Category List - Gentoo Browse</title> + <meta name="description" content="Complete list of Gentoo package categories" /> + </xsl:template> + <xsl:template name="content"> + <xsl:apply-templates select="/gentoo/categories" /> + </xsl:template> + <xsl:template match="/gentoo/categories"> + <h2>Package categories</h2> + <ul> + <xsl:apply-templates select="/gentoo/categories/category" /> + </ul> + </xsl:template> + <xsl:template match="/gentoo/categories/category"> + <li> + <a> + <xsl:attribute name="href"> + /category/<xsl:value-of select="catname" /> + </xsl:attribute> + <xsl:value-of select="catname" /> + </a> + (<xsl:value-of select="packages" />) + </li> + </xsl:template> +</xsl:stylesheet> diff --git a/gentoobrowse/category.xslt b/gentoobrowse/category.xslt new file mode 100644 index 0000000..3bc6512 --- /dev/null +++ b/gentoobrowse/category.xslt @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:project2="http://project2.randomdan.homeip.net/" exclude-result-prefixes="project2" > + <xsl:import href="base.xslt" /> + <xsl:output encoding="utf-8" method="html" media-type="text/html" indent="yes" + doctype-system="http://www.w3.org/TR/html4/loose.dtd" + doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN" /> + <xsl:template name="head"> + <title><xsl:value-of select="/gentoo/project2:uriElems/project2:uriElem[2]" /> Package List - Gentoo Browse</title> + <meta name="description"> + <xsl:attribute name="content">Complete list of Gentoo packages in the <xsl:value-of select="/gentoo/project2:uriElems/project2:uriElem[2]" /> category</xsl:attribute> + </meta> + <meta name="keywords"> + <xsl:attribute name="content"> + <xsl:for-each select="/gentoo/packages/package/pkgname"><xsl:value-of select="." />, </xsl:for-each> + </xsl:attribute> + </meta> + </xsl:template> + <xsl:template name="content"> + <xsl:apply-templates select="/gentoo/packages" /> + </xsl:template> + <xsl:template match="/gentoo/packages"> + <h2>Packages</h2> + <ul> + <xsl:apply-templates select="/gentoo/packages/package" /> + </ul> + </xsl:template> +</xsl:stylesheet> diff --git a/gentoobrowse/home.xslt b/gentoobrowse/home.xslt index 9a32178..23ad66e 100644 --- a/gentoobrowse/home.xslt +++ b/gentoobrowse/home.xslt @@ -4,6 +4,11 @@ <xsl:output encoding="utf-8" method="html" media-type="text/html" indent="yes" doctype-system="http://www.w3.org/TR/html4/loose.dtd" doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN" /> + <xsl:template name="head"> + <title>Newest ebuilds - Gentoo Browse</title> + <meta name="google-site-verification" content="f2uqzTiSxj7gbzzRzf4nOCB3WfQuWV9Knfjb9ju69jU" /> + <meta name="description" content="Newest released ebuilds for Gentoo" /> + </xsl:template> <xsl:template name="content"> <xsl:apply-templates select="/gentoo/newebuilds" /> </xsl:template> diff --git a/gentoobrowse/browse.xslt b/gentoobrowse/package.xslt index 8bbf2c0..bc0187a 100644 --- a/gentoobrowse/browse.xslt +++ b/gentoobrowse/package.xslt @@ -5,34 +5,15 @@ <xsl:output encoding="utf-8" method="html" media-type="text/html" indent="yes" doctype-system="http://www.w3.org/TR/html4/loose.dtd" doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN" /> + <xsl:template name="head"> + <title><xsl:value-of select="/gentoo/summary/package/pkgname" /> (in <xsl:value-of select="/gentoo/summary/package/catname" />) Package Details - Gentoo Browse</title> + <meta name="description"> + <xsl:attribute name="content"><xsl:value-of select="/gentoo/summary/package/description" /></xsl:attribute> + </meta> + </xsl:template> <xsl:template name="content"> - <xsl:apply-templates select="/gentoo/categories" /> - <xsl:apply-templates select="/gentoo/packages" /> <xsl:apply-templates select="/gentoo/summary/package" /> </xsl:template> - <xsl:template match="/gentoo/categories"> - <h2>Package groups</h2> - <ul> - <xsl:apply-templates select="/gentoo/categories/category" /> - </ul> - </xsl:template> - <xsl:template match="/gentoo/categories/category"> - <li> - <a> - <xsl:attribute name="href"> - /category/<xsl:value-of select="catname" /> - </xsl:attribute> - <xsl:value-of select="catname" /> - </a> - (<xsl:value-of select="packages" />) - </li> - </xsl:template> - <xsl:template match="/gentoo/packages"> - <h2>Packages</h2> - <ul> - <xsl:apply-templates select="/gentoo/packages/package" /> - </ul> - </xsl:template> <xsl:template match="/gentoo/summary/package/versions"> <div class="tabvisible" id="versions"> <ul> @@ -124,18 +105,18 @@ </p> <div class="tabstrip"> <!-- handles --> - <a class="tabhandle" href="javascript:showTab('versions');">Versions</a> + <h3 class="tabhandle"><a href="javascript:showTab('versions');">Versions</a></h3> <xsl:if test="count(/gentoo/summary/package/deps/package) > 0"> - <a class="tabhandle" href="javascript:showTab('deps');">Dependencies</a> + <h3 class="tabhandle"><a href="javascript:showTab('deps');">Dependencies</a></h3> </xsl:if> <xsl:if test="count(/gentoo/summary/package/packageBugs/bug) > 0"> - <a class="tabhandle" href="javascript:showTab('bugs');">Open bugs</a> + <h3 class="tabhandle"><a href="javascript:showTab('bugs');">Open bugs</a></h3> </xsl:if> <xsl:if test="count(/gentoo/summary/package/maskdetails/mask) > 0"> - <a class="tabhandle" href="javascript:showTab('masks');">Masks</a> + <h3 class="tabhandle"><a href="javascript:showTab('masks');">Masks</a></h3> </xsl:if> <xsl:if test="count(/gentoo/summary/package/changelog/line) > 0"> - <a class="tabhandle" href="javascript:showTab('changelog');">Change log</a> + <h3 class="tabhandle"><a href="javascript:showTab('changelog');">Change log</a></h3> </xsl:if> </div> <div class="tabbox" id="tabcontainer"> @@ -172,6 +153,7 @@ <li> <a target="_blank"> <xsl:attribute name="href">http://bugs.gentoo.org/<xsl:value-of select="bugid" /></xsl:attribute> + <xsl:attribute name="title"><xsl:value-of select="summary" /></xsl:attribute> <xsl:value-of select="bugid" /> </a> - <xsl:value-of select="summary" /> diff --git a/gentoobrowse/present/categories.xml b/gentoobrowse/present/categories.xml index 5b886a5..4a6d3dc 100644 --- a/gentoobrowse/present/categories.xml +++ b/gentoobrowse/present/categories.xml @@ -1,4 +1,4 @@ <?xml version="1.0"?> -<view name="categories" root="gentoo" style="browse.xslt" xmlns:xi="http://www.w3.org/2001/XInclude"> +<view name="categories" root="gentoo" style="categories.xslt" xmlns:xi="http://www.w3.org/2001/XInclude"> <xi:include href="../views/categories.xml" /> </view> diff --git a/gentoobrowse/present/category.xml b/gentoobrowse/present/category.xml index d6c4748..8f0f031 100644 --- a/gentoobrowse/present/category.xml +++ b/gentoobrowse/present/category.xml @@ -1,4 +1,4 @@ <?xml version="1.0"?> -<view name="category" root="gentoo" style="browse.xslt" xmlns:xi="http://www.w3.org/2001/XInclude"> +<view name="category" root="gentoo" style="category.xslt" xmlns:xi="http://www.w3.org/2001/XInclude"> <xi:include href="../views/category.xml" /> </view> diff --git a/gentoobrowse/present/package.xml b/gentoobrowse/present/package.xml index ba625d9..9abb818 100644 --- a/gentoobrowse/present/package.xml +++ b/gentoobrowse/present/package.xml @@ -1,4 +1,4 @@ <?xml version="1.0"?> -<view name="package" root="gentoo" style="browse.xslt" xmlns:xi="http://www.w3.org/2001/XInclude"> +<view name="package" root="gentoo" style="package.xslt" xmlns:xi="http://www.w3.org/2001/XInclude"> <xi:include href="../views/package.xml" /> </view> diff --git a/gentoobrowse/style.css b/gentoobrowse/style.css index 8aa6394..fbbe53d 100644 --- a/gentoobrowse/style.css +++ b/gentoobrowse/style.css @@ -108,10 +108,14 @@ form.tracker { .tabhidden { display: none; } -.tabhandle { - display: span; +.tabhandle a { text-decoration: none; padding: 0 30px; +} +.tabhandle { + font-weight: normal; + display: inline; + padding: 0 0; font-size: 14px; border: 1px solid grey; margin: 0 4px; |