Skip to content

Commit

Permalink
New handling of /user files (-> *.dist files for easier updates)
Browse files Browse the repository at this point in the history
I provided two separate archives until now: One for installation,
one for update. The only difference between them was that the update
archive did not contain the /user sub-directory to keep use-defined
changes.

However, this was too complicated for many users as only my templates
were delivered with as two separate archives. So I changed my mind
and use /user/*.dist files to provide examples and templates. These
files are dummies and may be overwritten. However, the user can take
and just remove the ".dist" extension to use them as starting point
for own modifications.
  • Loading branch information
andreashaerter committed Feb 9, 2014
1 parent e76c447 commit 4b676a6
Show file tree
Hide file tree
Showing 10 changed files with 115 additions and 90 deletions.
67 changes: 39 additions & 28 deletions README
Expand Up @@ -33,59 +33,70 @@
these hints for customizing the template:

- Place your files in "prsnl10/user"
The place for *all* userdefined, custom stuff is "prsnl10/user".
Reason: this folder will not be touched on updates. Therefore you may
delete everything except "prsnl10/user" and copy all new files into
"prsnl10/" to update without loosing your changes. Do not forget to
empty your browser's cache afterwards.
The place to store *all* user-defined, custom stuff is the "prsnl10/user"
directory because your files will not be touched or overwritten on
template updates! So you normally can copy all new files into "prsnl10/"
to update the template without loosing your changes.
Note: There are example files helping you modifying the template.
The are delivered with the ".dist" extensions. Just remove the
".dist" extension to use them.

- Own logo
If you want to replace the default text showed in the headline, simply
create a "logo.[png|gif|jpg]" in "prsnl10/user". The template recognizes
the file automatically and will use it instead of the default text. Do not
forget to empty your browser's cache afterwards.
If you want to replace the default logo showed in the upper left, simply
create a "logo.[png|gif|jpg]" in "monobook/user". The template recognizes
the file automatically and will use it instead of the default text.
Note: Do not forget to empty your browser's cache if you cannot see any
effect.
Hint: If you want to use a text-based logo, you might find the font
files [1] for "Droid Sans" out of Google's Webfont Directory [2]
useful.

- Own favicon
If you want to replace the default favicon, simply create a "favicon.ico"
in "prsnl10/user". The template recognizes the file automatically and
will use it instead of the default one. Do not forget to empty your
browser's cache afterwards. By the way: you might find the online
FavIcon Generator [3] useful.
will use it instead of the default one. You might find the online FavIcon
Generator [3] useful.
Note: "favicon.png" is also possible but not recommended (because it is
not supported by older MSIE versions).

- Own CSS
To apply additional CSS rules, edit "prsnl10/user/screen.css"
(influences normal layout) and/or "prsnl10/user/print.css" (influences
print layout) and/or "prsnl10/user/rtl.css" (influences "right-to-left"
languages like Hebrew). These files will be included automatically (as the
last ones for the relevant media, therefore you are able to overrule
existing styles). Do not forget to empty your browser's cache afterwards.
To apply additional CSS rules, create a
- "prsnl10/user/screen.css" file to influence the normal layout. You
can rename the "screen.css.dist" to "screen.css" as starting point.
- "prsnl10/user/print.css" file to influence the print layout. You
can rename the "print.css.dist" to "print.css" as starting point.
- "prsnl10/user/rtl.css" file to influences "right-to-left" languages
like Hebrew. You can rename the "rtl.css.dist" to "rtl.css" as
starting point.
The file(s) will be included automatically (as the last ones for the
relevant media, therefore you are able to overrule existing styles).
Note: Do not forget to empty your browser's cache if you cannot see any
effect.

- Own JavaScript
To load additional JavaScript, edit "prsnl10/user/user.js". Do not
forget to empty your browser's cache afterwards.
To load additional JavaScript, create a "prsnl10/user/user.js" file. You
can rename the "user.js.dist" to "user.js" as starting point (it contains
some examples and useful comments how to define your own JavaScript).
ATTENTION: You have to activate the template option "prsnl10_loaduserjs"
(->"Load 'prsnl10/user/user.js'?") in the DokuWiki Config
Manager!

- Web analytics software (Piwik, Google Analytics etc.)
Tools like Piwik and Google Analytics normally provide a small code
snippet ("tag") which you have to include at your website to make
everything work. If you want to use such software with this template, have
a look at "prsnl10/user/tracker.php". This file exists to make it easier
for you. You don't have to deliberate where you have to copy and paste the
code, simply do it there.
everything work. If you want to use such software with this template,
create a "prsnl10/user/tracker.php.dist". You don't have to deliberate
where you have to copy and paste the code, simply do it there. You can
rename the "tracker.php.dist" to "tracker.php" as a good starting point
(it contains some examples and useful comments how to define your own
boxes).

- Own Apple Touch Icon
If you want to replace the default Apple Touch Icon, simply create a
"apple-touch-icon.png" in "prsnl10/user". The template recognizes the
file automatically and will use it instead of the default one. Have a
look at Apple's developer database (cf. "Configuring Web Applications"[4])
if you need more information.
"apple-touch-icon.png" in "prsnl10/user". The template recognizes the file
automatically and will use it instead of the default one. Have a look at
Apple's developer database (cf. "Configuring Web Applications" [4]) if you
need more information.

[1] <http://www.google.com/webfonts/family?family=Droid+Sans>
[2] <http://j.mp/inYDGL>
Expand Down
2 changes: 1 addition & 1 deletion main.php
Expand Up @@ -100,7 +100,7 @@
}

//load userdefined js?
if (tpl_getConf("prsnl10_loaduserjs")){
if (tpl_getConf("prsnl10_loaduserjs") && file_exists(DOKU_TPL."user/user.js")){
echo "<script type=\"text/javascript\" charset=\"utf-8\" src=\"".DOKU_TPL."user/user.js\"></script>\n";
}
?>
Expand Down
7 changes: 0 additions & 7 deletions user/print.css

This file was deleted.

9 changes: 9 additions & 0 deletions user/print.css.dist
@@ -0,0 +1,9 @@
/*
Place for user defined CSS rules (print media) - this file can safely be
preserved when updating. See README for details.

Note: All example files are delivered with the ".dist" extensions to make
sure your changes do not get overwritten when updating the template.
Just remove the ".dist" extension to use them.
*/

7 changes: 0 additions & 7 deletions user/screen.css

This file was deleted.

9 changes: 9 additions & 0 deletions user/screen.css.dist
@@ -0,0 +1,9 @@
/*
Place for user defined CSS rules (screen media) - this file can safely be
preserved when updating. See README for details.

Note: All example files are delivered with the ".dist" extensions to make
sure your changes do not get overwritten when updating the template.
Just remove the ".dist" extension to use them.
*/

31 changes: 0 additions & 31 deletions user/tracker.php

This file was deleted.

39 changes: 39 additions & 0 deletions user/tracker.php.dist
@@ -0,0 +1,39 @@
<?php

/**
* Place for user defined web analytics software codes/tags
*
* Tools like Piwik and Google Analytics normally provide a small HTML code
* snippet ("tag") which you have to include at your website to make everything
* work. This template tries to make this easier for you.
*
* You don't have to deliberate where you have to copy and paste the code
* simply create a "/user/tracker.php" file. The template recognizes and loads
* the provided tracker data automatically. You may want to rename this file
* from "tracker.php.dist" to "tracker.php" to get a good starting point. Just
* copy and paste the needed HTML code/tag AFTER the closing "?>"
*
* Note: All example files are delivered with the ".dist" extensions to make
* sure your changes do not get overwritten when updating the template.
* Just remove the ".dist" extension to use them.
*
*
* LICENSE: This file is open source software (OSS) and may be copied under
* certain conditions. See COPYING file for details or try to contact
* the author(s) of this file in doubt.
*
* @license GPLv2 (http://www.gnu.org/licenses/gpl2.html)
* @author ARSAVA <dokuwiki@dev.arsava.com>
* @link http://piwik.org/
* @link http://www.google.com/analytics/
* @link https://www.dokuwiki.org/template:prsnl10
* @link https://www.dokuwiki.org/devel:configuration
*/


//check if we are running within the DokuWiki environment
if (!defined("DOKU_INC")){
die();
}

//place the needed HTML source codes BELOW this line ?>
16 changes: 0 additions & 16 deletions user/user.js

This file was deleted.

18 changes: 18 additions & 0 deletions user/user.js.dist
@@ -0,0 +1,18 @@
/*
Place for user defined JavaScript - this file can safely be preserved
when updating. See README for details.

Note: All example files are delivered with the ".dist" extensions to make
sure your changes do not get overwritten when updating the template.
Just remove the ".dist" extension to use them.

To use own JavaScript:

1. Create a /user/user.js file. You may just want to rename this file from
"user.js.dist" to "user.js"

2. Do not forget to activate the template option
"prsnl10_loaduserjs" (->"Load 'prsnl10/user/user.js'?") in the
DokuWiki Config Manager! Otherwise, any changes to this file
won't have any effect!
*/

0 comments on commit 4b676a6

Please sign in to comment.