]> git.donarmstrong.com Git - lilypond.git/commitdiff
Web build: add topdir files for lilypond.org.
authorGraham Percival <graham@percival-music.ca>
Thu, 21 Jan 2010 20:06:02 +0000 (20:06 +0000)
committerGraham Percival <graham@percival-music.ca>
Thu, 21 Jan 2010 20:09:46 +0000 (20:09 +0000)
Documentation/web/GNUmakefile
Documentation/web/server/GNUmakefile [new file with mode: 0644]
Documentation/web/server/favicon.ico [new file with mode: 0644]
Documentation/web/server/lilypond.org.htaccess [new file with mode: 0644]
Documentation/web/server/robots.txt [new file with mode: 0644]
website.make

index 18c3867b8d0962e0b0cb04e24a3e1183122d3d67..a8e0f49e0c900f9de4de85f04268c02d4bc69740 100644 (file)
@@ -1,4 +1,4 @@
 depth = ../..
 LOCALSTEPMAKE_TEMPLATES = ly
-SUBDIRS = ly-examples
+SUBDIRS = ly-examples server
 include $(depth)/make/stepmake.make
diff --git a/Documentation/web/server/GNUmakefile b/Documentation/web/server/GNUmakefile
new file mode 100644 (file)
index 0000000..a51c5b6
--- /dev/null
@@ -0,0 +1,6 @@
+depth=../../..
+LOCALSTEPMAKE_TEMPLATES = ly
+include $(depth)/make/stepmake.make
+
+EXTRA_DIST = lilypond.org.htaccess favicon.ico robots.txt
+
diff --git a/Documentation/web/server/favicon.ico b/Documentation/web/server/favicon.ico
new file mode 100644 (file)
index 0000000..82d4b3f
Binary files /dev/null and b/Documentation/web/server/favicon.ico differ
diff --git a/Documentation/web/server/lilypond.org.htaccess b/Documentation/web/server/lilypond.org.htaccess
new file mode 100644 (file)
index 0000000..77cecd1
--- /dev/null
@@ -0,0 +1,102 @@
+RewriteEngine On
+
+# Deny following of symlinks by robots.
+# HTTrack is a known offender.
+# better yet, to redirect this to page that tells adminstrator
+# about brokenness
+RewriteCond %{HTTP_USER_AGENT} httrack [NC]
+RewriteRule ^.*/source/.*$ /please-respect-robots.txt.html [L]
+
+# Permanent top level entry points -- ./doc
+RedirectMatch ^/music-glossary /doc/Documentation/user/music-glossary/index
+RedirectMatch ^/tutorial /doc/Documentation/user/lilypond-learning/Tutorial
+RedirectMatch ^/documentation/$ /doc
+# Possibly resurrect this with new web site
+# This breaks the documentation index with old site
+# RedirectMatch ^/documentation$ /doc
+RedirectMatch ^/bugs   http://code.google.com/p/lilypond/issues/list
+RedirectMatch ^/wiki   http://wiki.lilynet.net
+RedirectMatch ^/authors /doc/Documentation/topdocs/AUTHORS
+RedirectMatch ^/news    /doc/Documentation/topdocs/NEWS
+RedirectMatch ^/stable    /doc/stable
+
+#old# default doc dir
+RedirectMatch ^/doc/*$ /doc/v2.12
+# make attempt at `latest' symlink avoid ^v catch-all doc fix rule below
+RedirectMatch ^/doc//*latest/*(.*)$ /doc/v2.13/$1
+RedirectMatch ^/doc//*development/*(.*)$ /doc/v2.13/$1
+RedirectMatch ^/doc//*stable/*(.*)$ /doc/v2.12/$1
+RedirectMatch ^/doc//*([^v].*)$ /doc/v2.12/$1
+RedirectMatch ^(/Documentation.*)$ /doc/v2.12$1
+RedirectMatch ^/index$ /
+
+# fix root calculation: no double slashes
+# RedirectMatch ^(.*/)/+(.*)$ $1$2
+
+###########################################
+
+## Rewrite all non-existing files at toplevel to the /web/ dir, so our
+## internal structure for rsync doesn't have to be changed.
+## This works for the current/old site as well as the new one.
+
+RewriteEngine on
+RewriteBase /
+
+SetEnvIf REQUEST_URI .* WEB=/web
+## To switch over to the new site, we do not even need to put it in /web
+## we could do
+# SetEnvIf REQUEST_URI .* WEB=/doc/v2.13/Documentation
+
+# Rewrite empty to /web
+RewriteCond %{REQUEST_URI} ^/*$
+RewriteRule ^(/*)$ %{ENV:WEB}/ [QSA,L]
+
+# css Request without directory part
+RewriteCond %{REQUEST_URI} ^/?[^/]+[.]css$
+# ...that does not match match an existing file
+RewriteCond %{REQUEST_FILENAME} !-f
+# ...and does not match an existing directory
+RewriteCond %{REQUEST_FILENAME} !-d
+# ...prefix with web
+RewriteRule ^(.+)$ %{ENV:WEB}/$1 [QSA,L]
+
+# Request without trailing slash
+RewriteCond %{REQUEST_URI} !.*/$
+# ...that would access a directory in /web
+RewriteCond %{DOCUMENT_ROOT}%{ENV:WEB}%{REQUEST_URI} -d
+# ...and does not start with /web
+RewriteCond %{REQUEST_URI} !^%{ENV:WEB}
+RewriteCond %{REQUEST_URI} !^/web
+# ...and does not start with /doc$
+RewriteCond %{REQUEST_URI} !^/doc$
+# ...add trailing slash for [menu] and to avoid /web/ in browser url
+RewriteRule ^(.+)$ http://%{HTTP_HOST}/$1/ [R,QSA,L]
+
+# Request that does not start with /web
+RewriteCond %{REQUEST_URI} !^/web
+RewriteCond %{REQUEST_URI} !^%{ENV:WEB}
+# ...and does not start with /doc/
+RewriteCond %{REQUEST_URI} !^/doc/
+# ...and is not /doc$
+RewriteCond %{REQUEST_URI} !^/doc$
+# ...and does not match match an existing file
+RewriteCond %{REQUEST_FILENAME} !-f
+# ...and does not match an existing directory
+RewriteCond %{REQUEST_FILENAME} !-d
+# ..prefix with /web
+RewriteRule ^(.+)$ %{ENV:WEB}/$1 [QSA,L]
+
+###########################################
+
+# latin1 version copied to web and doc/2.x
+AddDefaultCharset utf-8
+AddCharset utf-8 .html
+AddCharset utf-8 .de
+AddCharset utf-8 .en
+AddCharset utf-8 .es
+AddCharset utf-8 .fr
+AddCharset utf-8 .nl
+AddCharset utf-8 .txt
+
+# fix broken auto language selection for Hungarian
+AddLanguage hu .hu
diff --git a/Documentation/web/server/robots.txt b/Documentation/web/server/robots.txt
new file mode 100644 (file)
index 0000000..27db672
--- /dev/null
@@ -0,0 +1,19 @@
+# avoid 404s -- so that we can take action if any occur in /stats
+
+User-agent: *
+Disallow: /doc/v1.6/
+Disallow: /doc/v1.8/
+Disallow: /doc/v1.9/
+Disallow: /doc/v2.0/
+Disallow: /doc/v2.1/
+Disallow: /doc/v2.2/
+Disallow: /doc/v2.3/
+Disallow: /doc/v2.4/
+Disallow: /doc/v2.5/
+Disallow: /doc/v2.6/
+Disallow: /doc/v2.7/
+Disallow: /doc/v2.8/
+Disallow: /doc/v2.9/
+Disallow: /doc/v2.10/
+Disallow: /doc/v2.11/
+Disallow: /doc/v2.13/
index f301272d6761345f92ffe1791a2610da4600ae85..a6752531f89903a69fb8c0881b11f02ef2891159 100644 (file)
@@ -34,6 +34,7 @@ EXTRACT_TEXI_FILENAMES=python $(script-dir)/extract_texi_filenames.py
 CREATE_VERSION=python $(script-dir)/create-version-itexi.py
 CREATE_WEBLINKS=python $(script-dir)/create-weblinks-itexi.py
 
+SERVER_FILES=$(top-src-dir)/Documentation/web/server/
 
 # don't include web
 MANUALS=$(wildcard $(top-src-dir)/Documentation/*.tely)
@@ -77,7 +78,8 @@ website-examples:
        mkdir -p $(OUT)/website/ly-examples
        cp $(EXAMPLES)/* $(OUT)/website/ly-examples
 
-
 website: website-texinfo website-css website-pictures website-examples
-
+       cp $(SERVER_FILES)/favicon.ico $(OUT)/website/
+       cp $(SERVER_FILES)/lilypond.org.htaccess $(OUT)/website/.htaccess
+       cp $(SERVER_FILES)/robots.txt $(OUT)/website/