summaryrefslogtreecommitdiffstats
path: root/website/templates
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2010-10-11 18:02:43 +0100
committerRichard W.M. Jones <rjones@redhat.com>2010-10-13 09:49:58 +0100
commit728c0634432b39aacc7650bcdac92243b5817e6b (patch)
treec2ebed1c9c5d8604d70a3d0d94b2ae31819ab627 /website/templates
parent968acff01a0c4d20d89881ab20850ff2db2cbad8 (diff)
downloadvirt-tools-728c0634432b39aacc7650bcdac92243b5817e6b.tar.gz
virt-tools-728c0634432b39aacc7650bcdac92243b5817e6b.tar.xz
virt-tools-728c0634432b39aacc7650bcdac92243b5817e6b.zip
virt-tools website using Template Toolkit (incomplete).
Diffstat (limited to 'website/templates')
-rw-r--r--website/templates/globals99
-rw-r--r--website/templates/google_analytics14
-rw-r--r--website/templates/h211
-rw-r--r--website/templates/page56
-rw-r--r--website/templates/ttree.conf10
5 files changed, 190 insertions, 0 deletions
diff --git a/website/templates/globals b/website/templates/globals
new file mode 100644
index 0000000..79d7d2f
--- /dev/null
+++ b/website/templates/globals
@@ -0,0 +1,99 @@
+[% USE date -%]
+[%
+# This global template is included in every HTML file. It is
+# included before the DOCTYPE and it *must not* generate any
+# output. Be careful to chomp! However it is a very useful
+# place to put global variables. Note that the only variable
+# that is passed in here is topdir.
+
+year = date.format(date.now, '%Y')
+printable_date = date.format
+
+# These are the sections / tabs of the site as they appear in
+# the navigation at the top of all pages.
+
+sections = [ "home", "news", "learning", "faq", "about", "contact" ]
+
+section_titles.home = "Home"
+section_titles.news = "News"
+section_titles.learning = "Tutorials and videos"
+section_titles.faq = "FAQ"
+section_titles.about = "About this site"
+section_titles.contact = "Contact us"
+
+section_paths.home = "/"
+section_paths.news = "/news/"
+section_paths.learning = "/learning/"
+section_paths.faq = "/faq/"
+section_paths.about = "/about/"
+section_paths.contact = "/contact/"
+
+# The full list of local resources under src/learning/
+#
+# Put new documents at the top.
+#
+# If the resource is really beginner level, then set difficulty = 0.
+# Use this sparingly because these appear in 'Get started' on the
+# front page of the site, and also at the top of the list.
+#
+# Other variables:
+# difficulty: Difficulty level 0 (absolute beginner) 1 (easy) .. 5 (hardest).
+# cmdline: (optional) Set to 1 if this involves using the command line.
+# author: (optional) String containing author's name.
+# date: (optional) Date last updated (use: date +%F)
+#
+# The text will be displayed to the user as:
+# <a href="/learning/[name]/">[link]</a> [rest]
+
+learning_documents = [
+ { difficulty = 0, cmdline = 1,
+ name = "start-virt-tools",
+ link = "Where to get virt tools.",
+ rest = "Learn how to download or obtain virt tools on Fedora,
+ Debian, Ubuntu, RHEL and more." },
+ { difficulty = 0,
+ name = "start-conventions",
+ link = "Names and terms used in the rest of the documentation.",
+ rest = "If you confused by words like <q>paravirt</q>, <q>migration</q>,
+ <q>domain</q>, then start here." },
+ { difficulty = 0,
+ name = "start-install-with-virt-manager",
+ link = "Install a virtual machine",
+ rest = "with virt-manager. A step by step guide to creating
+ your first virtual machine using simple graphical tools." },
+ { difficulty = 0,
+ name = "start-vm-with-virt-manager",
+ link = "Start and stop virtual machines",
+ rest = "using graphical virt-manager." },
+ { difficulty = 0, cmdline = 1,
+ name = "start-list-with-command-line",
+ link = "List virtual machines",
+ rest = "from the command line and shell scripts." },
+ { difficulty = 1, cmdline = 1,
+ name = "start-stop-vm-with-command-line",
+ link = "Start and stop virtual machines",
+ rest = "from the command line and shell scripts." },
+ { difficulty = 1, cmdline = 1,
+ name = "check-hardware-virt",
+ link = "Check if your hardware supports virtualization.",
+ rest = "Hardware virtualization is supported by many but not all
+ modern hardware. If enabled it offers great performance
+ benefits. This article explains the different types of
+ hardware virtualization and how to check if your hardware
+ supports it." },
+ { difficulty = 3, cmdline = 1,
+ name = "install-with-command-line",
+ link = "Install a virtual machine",
+ rest = "using the command line. Create a VM from the command line
+ and shell scripts." },
+ { difficulty = 5, cmdline = 1,
+ author = "Richard W.M. Jones", date = "2010-10-12",
+ name = "advanced-virt-df",
+ link = "Advanced use of virt-df.",
+ rest = "Check free disk space. Regularly check from a cron job,
+ draw graphs to predict future usage, and generate alerts
+ if VMs are running low on space." },
+]
+
+# NB: Make sure you don't add blank lines to the end of this file!
+-%]
diff --git a/website/templates/google_analytics b/website/templates/google_analytics
new file mode 100644
index 0000000..2c881d1
--- /dev/null
+++ b/website/templates/google_analytics
@@ -0,0 +1,14 @@
+[%# Google analytics for tracking.
+ Ask RWMJ for access to the account. %]
+
+<script type="text/javascript">
+ var _gaq = _gaq || [];
+ _gaq.push(['_setAccount', 'UA-19035706-1']);
+ _gaq.push(['_trackPageview']);
+
+ (function() {
+ var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+ })();
+</script>
diff --git a/website/templates/h2 b/website/templates/h2
new file mode 100644
index 0000000..d5f7db1
--- /dev/null
+++ b/website/templates/h2
@@ -0,0 +1,11 @@
+<h2>
+[%- IF anchor -%]
+<a name="[% anchor %]">
+[%- END -%]
+[% h2 %]
+[%- IF anchor -%]
+</a>&nbsp;<a href="#[% anchor %]" title="Permanent link to this heading" class="vtpermalink">#</a>
+[%- END -%]
+</h2>
+
+[% content %]
diff --git a/website/templates/page b/website/templates/page
new file mode 100644
index 0000000..93dd573
--- /dev/null
+++ b/website/templates/page
@@ -0,0 +1,56 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+<title>[% title %]</title>
+<meta name="description" content="Virt Tools are open source virtualization management tools for Linux system administrators. This site provides tutorials, videos, documentation, online help and roadmaps to help you understand and get started with the tools." />
+<meta name="keywords" content="virsh, virt-install, virt-manager, virt-top, virt-df, virt-p2v, virt-v2v, virt-viewer, virt-df, ncftool, augeas, aug-tool, guestfish, guestfs-browser, hivex, libguestfs, virt-what" />
+<link rel="stylesheet" href="[% topdir %]/css/standard.css" type="text/css" title="Standard"/>
+[% IF local_stylesheet %]<link rel="stylesheet" href="style.css" type="text/css" title="Standard"/>[% END %]
+<link rel="alternate stylesheet" href="[% topdir %]/css/easytoread.css" type="text/css" title="High contrast, big fonts"/>
+</head>
+<body>
+<h1><span>[% h1 %]</span></h1>
+
+[% IF topdir == "../.." -%]
+<p id="vtbacktosectiontop">
+(from&nbsp;<a href="../">[% section_titles.$section %]</a>)
+</p>
+[%- END %]
+
+<ul id="vtmenu">
+[% FOREACH s IN sections -%]
+ [%- IF section == s -%]
+ [%- IF topdir == "." || topdir == ".." -%]
+ <li class="vtmenuselected">
+ <span>[% section_titles.$s %]</span>
+ </li>
+ [%- ELSE -%]
+ <li class="vtmenuselected">
+ <a href="[% topdir %][% section_paths.$s %]">[% section_titles.$s %]</a>
+ </li>
+ [%- END -%]
+ [%- ELSE -%]
+ <li class="vtmenunotselected">
+ <a href="[% topdir %][% section_paths.$s %]">[% section_titles.$s %]</a>
+ </li>
+ [%- END -%]
+[%- END %]
+</ul>
+
+[% content %]
+
+[% IF topdir == "../.." -%]
+<p id="vtbacktosectionbottom">
+Back to <a href="../">[% section_titles.$section %]</a>.
+</p>
+[%- END %]
+
+<p id="vtfooter">
+Copyright &copy; [% year %] <a href="http://redhat.com/">Red Hat Inc.</a> &mdash;
+License: GPLv2+ &mdash;
+Last updated on [% printable_date %]
+</p>
+
+[%- INCLUDE google_analytics -%]
+</body>
+</html>
diff --git a/website/templates/ttree.conf b/website/templates/ttree.conf
new file mode 100644
index 0000000..69eea7c
--- /dev/null
+++ b/website/templates/ttree.conf
@@ -0,0 +1,10 @@
+ignore = ~$
+copy = \.(gif|png|jpg|pdf)$
+recurse
+verbose
+
+lib = templates
+src = src
+dest = build
+
+depend *=globals,page,h2