This
is intended to make it easy to produce image galleries and photo albums
where you need to produce images in multiple resolutions. Also, it
will be used for user avatars: Since mee.nu users have complete control
over their site layouts, there won't be a single fixed size for
avatars, and resizing in the browser produces ugly images.
The
advantages (apart from the improved quality) is that it makes it very
easy to keep the image proportions, and it produces smaller files for
fast loading times. (And less strain on your bandwidth.) Doing
high-quality image processing is fairly CPU intensive, but we already
have 16 CPUs at our disposal, so that is not anticipated to be a
problem.
One hitch: This doesn't currently work for animated GIFs.
Neither does the image processing function in the file module; the GIF
library I'm using is lacking in several respects. This will be resolved in the next month or so.
2
Yep, we're going to be adding something along those lines. It's called a "lightbox", and there's a whole range of Javascript functions available to do it. I haven't standardised on a Javascript library yet, but I'll have to do so soon.
Posted by: Pixy Misa at July 04, 2007 01:44 PM (PiXy!)
The pullquote
tagmakes foreasy and
attractivemagazine-stylepullquotes.
The pullquote
tag makes for easy and
attractive magazine-style pullquotes. You can place the
pullquote to the left or right of the text, set your own colour
schemes, control the line breaks yourself or let the system handle it
for you, and select different text for the quote and the main body.
Code: [pullquote left strip scheme=orange]The pullquote
tag|makes for|easy and
attractive|magazine-style|pullquotes.[/pullquote]
placed either left or right (the default) of the body text.
Markup in the body text may cause problems in the pullquote. The strip option removes any markup from the pullquote, leaving it in the body.
This textappearsonly inthepullquote.
When
needed, the pullquote text can be different to the body text. To
specify that the contents are to appear in the pullquote only, specify
the nobody option.
Schemes
can be user-defined in your CSS. The standard schemes include
red,orange,green,blue,and purple
red, orange, green, blue, and purple. The default scheme (if no scheme is specified) is black and grey. The CSS code for the blue scheme, for example, is simply:
Oops. The code executed in the comment. Preview is the friend I ignore.
With square brackets in place of the parentheses, the code looks like:
(pullquote right nobody)"Oh,|that's|very|impressive."(/pullquote)
I also tried adding "strip" but it didn't change the line breaks.
Posted by: Michael Rittenhouse at September 27, 2007 11:12 AM (/2Jf1)
3
Hmm.. Haven't looked at this in a little while; what you are doing seems right. I'll grab a copy of your blog to my test environment so I can see why it's not working.
Posted by: Pixy Misa at September 28, 2007 11:24 AM (PiXy!)
As I noted before, I love the pullquotes for the way they break up copy and help draw the reader into a longer article.
I am having trouble getting them to appear alongside a longer paragraph without the code (apparently) causing a break in the paragraph itself.
If I put the code at the very beginning of the paragraph (before the first sentence), the pullquote is nicely positioned but I get a couple of blank spaces in the first line of the paragraph, where the code is hidden.
If I put the code at the end of the previous paragraph to eliminate the blank spaces, the pullquote can only be positioned alongside the opening lines of the following paragraph. I can't move the pullquote down to a more attractive location, several lines into the paragraph. (See this example.)
If I splice the code down inside the paragraph a few lines, it breaks the paragraph like a stray line break.
Any suggestions?
Posted by: Michael Rittenhouse at January 27, 2008 10:18 PM (FPLdZ)
That's right. One note - this is not in place in the current system, but will be included in this weekend's update.
Can we do testing on args? Like [if {1}]value="{1}"[/if]?
Actually, that won't necessarily work with the plain if, which always assumes that you've fed it a template tag. if.nz should do what you want, though.I'm working to extend this to allow using template tags as parameters in other template tags, using $ to denote a variable as opposed to an absolute value. So you'll be able to do [include $foo], and the template that gets included depends on what the value of foo is at that point. That should also make it into this weekend's update.
(This isn't just an academic exercise; I needed this functionality to extend some of the user-interface templates. Naturally, once it's in place I make it available to everyone.
)
Posted by: Pixy Misa at April 19, 2007 03:55 PM (PiXy!)
Formatting Options
You can add formatting to any data tag using the format= option. The main formatting commands are described below.
Date and Time
Dates and times use a format string as described below. You can use any combination of formatting options and text in the format string. If the format string contains spaces, you will need to enclose it in either single or double quotes.
Date Formatting Options
Code
Meaning
Examples
%a
Abbreviated weekday name.
Tue, Thu
%A
Full weekday name.
Tuesday, Thursday
%b
Abbreviated month name
Jan, Aug
%B
Full month name.
January, August
%c
Date and time.
Tue Apr 3 14:53:38 2007
%d
Day of month.
3
%j
Day of year.
093
%m
Month.
1, 8
%U
Week of year (weeks starting Sunday).
13
%W
Week of year (weeks starting Monday).
13
%x
Date (mm/dd/yy).
04/03/07
%y
Year.
07
%Y
Year with century.
2007
Time Formatting Options
Code
Meaning
Examples
%H
Hour (24-hour clock).
11, 23
%I
Hour (12-hour clock).
11, 11
%M
Minute.
03, 29
%p
AM or PM.
AM, PM
%S
Second.
15, 59
%X
Time.
14:53:38
Some Examples
Code
Result
%A, %B %d
Monday, April 09
%I:%M %p
08:57 PM
%A, %B %d %Y %I:%M %p
Monday, April 09 2007 08:57 PM
%Y-%m-%d
2007-04-09
Example: [post.date format="%I:%M %p"]
Text
Multiple text formatting options can be applied by separating the commands with commas. The formatting commands are applied in the order they are listed. Example: [post.text format="first=100,underscore,lower"].
Option
Description
left=n
Returns the first n characters of the text.
right=n
Returns the last n characters of the text.
first=n
Returns the first n words of the text.
last=n
Returns the last n words of the text.
trim
Removes any leading and trailing spaces.
trim=s
Removes any leading or trailing instances of string s.
lower
Converts text to lower case.
upper
Converts text to upper case.
words
Returns the number of words in the text.
letters
Returns the number of letters in the text.
nospace
Removes any spaces from the text.
underscore
Convert any spaces in the text to underscores.
Numbers
Number formatting works by placing the formatted value into a string containing both formatting options and text.
Option
Description
%d
Signed integer decimal.
%i
Signed integer decimal.
%o
Unsigned octal.
%u
Unsigned decimal.
%x
Unsigned hexadecimal (lower case).
%X
Unsigned hexadecimal (upper case).
%e
Floating point exponential (lower case).
%E
Floating point exponential (lower case).
%f
Floating point decimal format.
%F
Floating point decimal format.
%g
Variable floating point format.
%G
Variable floating point format.
%s
Default representation.
%%
% symbol.
As an example, you could have [post.words format="There are %d words in this post."]
Each of the numeric formatting options can take a number of flags:
Some Quick Notes About Caching
The caching module is designed to keep the most frequently requested pages in memory so that they can be served more quickly. Every time you request a page, the server first checks if it already has a copy in the cache. If it doesn't, it creates the page from the templates, and then saves a copy in the cache - possibly pushing an older page out of the way to do so.
Pages live in the cache for a limited amount of time, currently 120 seconds. They are automatically flushed (removed from the cache) after certain events; leaving a comment on a page, for example, will flush that individual page. And pages are never cached if you are logged in, so you will never see an old copy of a page while you are maintaining your site.
The real benefit of the cache comes in when you get a link from a high-traffic site like Slashdot, Fark, or Instapundit. The main page of my blog currently takes around 400 milliseconds to generate (it has a lot of comments...) Once in the cache, it takes just 3.5 milliseconds - over 100x faster. You can imagine the difference that would make to the server if I got 10,000 visitors in the space of an hour. Typically the performance gain would be somewhat less than that, in the range of 20x to 60x, but still definitely worthwhile.
If you log out and reload a page a couple of times, you'll see that the system actually tells you that it's coming from the cache, so you can keep an eye on this yourself.
There's a second way to work with custom CSS - use the template engine.
There are two steps to this:
First, create a folder. Give it a type of "Style" and a name that you find appropriate - let's say "Default", since this will be your default CSS. Set the path to be something like "css/mystyle.css", or "css/mee.nu.css" if you don't want to change your Header template just yet.
Set the index template and page template both to Style.Default.
Make sure that it's not marked private! If you mark a folder as private, only you can access its contents - which is not a good thing for your CSS files (unless you want to try out a new design, in which case it's ideal).
Save your new folder.
Now create a template. Set the type as Style and the name as Default. Make sure you set the content to "text/css", or you may have problems.
Now, just put your CSS code into the template. Make sure it's marked as active. Save it, and you're done!
The advantage of this method is that you can use template tags, including conditional tags, in generating your CSS. The downside is that because the CSS is generated dynamically, it won't be cached by the browser, so your pages will appear just a little more slowly.
But, we can edit our CSS in the website without going through the whole upload thing. Now I just have to take all my styles out of the HTML and move it into the stylesheet...
Posted by: McGurk at April 13, 2007 02:05 PM (Ri74D)
Posts[Note: This documentation is for the updated version of the system that is in testing right now. Some features documented here may not work correctly just yet. The new version is expected to be available by the end of Sunday, April 15th.]
Posted by: Flibbertigibbet at December 03, 2007 04:50 AM (ru7wW)
6
Um. I just realised, I cheated when I did that for the standard templates. I need to fix it.
Basically, the post isn't picking up all the category data automatically; my cheat was to use the category name in the link - which works for me, but isn't correct in the general case.
I'll get this fixed for you.
Posted by: Pixy Misa at December 07, 2007 12:20 PM (PiXy!)
7
Scratch that. Reverse it! I actually did it properly, but it's sort of hidden.
Use [post.category.path]. The system is wrapping the category data into the post data. It does the same for the author - there's a [post.author] object inside the post data containing the user details of the author.
I need do document that better.
Posted by: Pixy Misa at December 08, 2007 01:48 AM (PiXy!)
1
Why am I only getting the coding back out, and not a video? Am I stupid?
Posted by: henryjo at April 14, 2007 02:19 PM (/vh1x)
2
Hi henryjo. Don't mark the youtube tag in colour; I do that in the documentation
because it prevents the system from processing it - which is exactly
what you don't want.
Posted by: Pixy Misa at April 14, 2007 02:54 PM (PiXy!)
3
I am stupid or something cuz, now I get a big white space?
Posted by: henryjo at April 14, 2007 03:39 PM (/vh1x)
Posted by: Pixy Misa at May 06, 2007 04:31 PM (PiXy!)
6
There. Hmm. You didn't turn off BBCode on that post, did you?
Don't colour the text the way I do in my examples, though - I do that so that the examples won't work so that you can read them. If you colour the text it won't work for you either - probably not what you want!
Posted by: Pixy Misa at May 06, 2007 04:33 PM (PiXy!)
7
Thanks. This place gets better on the time. Any more info on paid subscription plans for blog space yet?
Posted by: Metzger at July 17, 2007 05:17 PM (2eGp3)
Working With Custom CSS
By default, your site is set up with a standard CSS file, which you can find here: http://mee.nu/css/mee.css.
You will find the CSS location specified in your Header template. In the future - probably later this week - I'll add a setting to the Manage Site page to make this easier to change, but for now you can just edit that template. Find the line that says:
Where /files/my.css is the location of your CSS file.
There are a couple of ways you can put your own CSS into action. The first way is to simply edit it offline, and then upload the file into your files directory.
The second way is more complicated, but more powerful; it lets you use template tags to process the CSS, so that you can (for example) deliver different CSS to different browsers. I'll cover that tomorrow.
Well I tried this method (tweaking with a copy of mee.nu.css and saving it down in my files folder as my.css) to fiddle around with the appearance of the page, but I decided I was coming to an ugly dead-end. When I tried reseting to the default css, something happened, because the h-line.gif and v-line.gif borders will not come back no matter what I try. I've tried routing my header back to mee.nu/css/mee.nu.css . I've put a copy of the original css in my files folder and sent the header there for the style sheet. Neither brought the borders back.
Any idea what's going on?
Posted by: Will at April 20, 2007 09:04 PM (SOx9v)
2
mee.nu.css doesn't have the borders; you want mee.css.
Give that a try.
Posted by: Pixy Misa at April 20, 2007 09:12 PM (PiXy!)
3
That did it. But mee.nu.css (the one you supplied in your link) references v-line and h-line in #banner and #menu. Is there some reason why those would not work?
Posted by: Will at April 20, 2007 09:34 PM (SOx9v)
4
Wait... I think I see what's wrong. Does it have to do with the way the url is incomplete when linking the image? Mee.css has those urls filled out completely? (another work around I attempted)
Posted by: Will at April 20, 2007 09:37 PM (SOx9v)
New Toys
A new set of features has been uploaded to mee.nu, ready for our full-scale beta test. You'll see new options for managing your posts, files, folders, templates and directories, automatic RSS and Atom feeds, site statistics, and a host of other bells and whistles.
3
If you mean look through a screen of thumbnails or something similar - not yet, but I do plan to add that.
Posted by: Pixy Misa at April 10, 2007 08:32 PM (PiXy!)
4
Three items that I have found while working on the new digs:
1. Whenever I upload a file, and then rename it with a name that already exists, instead of writing over it, there are now two files listed with the same name. Hard to distinguish which one is the new one, especially when dealing with uploading my new css.
2. A text editor for the CSS file would be nice as opposed to editing it offline and having to upload it. (put it on my wish list of things).
3. On the comments, if we can make it so that it has an option to remember commenter's info.
Minor things so far. Great job Pixy!!
Posted by: duncan at April 11, 2007 12:30 AM (V1YuZ)
Whenever I upload a file, and then rename it with a name that already
exists, instead of writing over it, there are now two files listed with
the same name. Hard to distinguish which one is the new one, especially
when dealing with uploading my new css.
Rats. I thought I'd fixed that. I'll take another look.
A text editor for the CSS file would be nice as opposed to editing it
offline and having to upload it. (put it on my wish list of things).
There's actually a way to do that, and I'll post about that today in the Docs section.
On the comments, if we can make it so that it has an option to remember commenter's info.
At the moment, it always remembers the commenter's info. This works slightly strangely if you're a registered user, because it looks at your Profile page rather than at what you last type in for a comment.
Posted by: Pixy Misa at April 11, 2007 03:43 AM (PiXy!)
12
I think there's a post about replacing the banner image somewhere, but I can't find it, so here goes:
You want the Banner template (you already seem to have found that).
You want an image that is roughly 408x98 (it's that size because I started with a 400x90 box and added a drop shadow).
Remove the whole section that starts with <div id="titlebox"> and ends with </a> </div>.
In its place, put <a href="/"> <img src="/images/myimage.jpg" border="0"> </a> (where myimage.jpg is replaced with the real name of your image.)
That should do the trick!
We'll be adding new templates over the next two weeks, and a new template builder module which will handle putting images into the banner for you. I've put a preview on my blog.
Posted by: Pixy Misa at June 23, 2007 04:40 AM (PiXy!)