I don't know if you guys do this in Germany, but in America we sign yearbooks right before summer vacation. We normally say stuff like "Have a great summer!" or "Let's keep in touch." or "It's been a nice year with you." and stuff like that. What do they say in German?
As noted in the comments, there is no tradition of school yearbooks and the things attached to it (picture day, signing them etc.) in Germany (or in German-speaking regions that I'm aware of). However, I would probably write something like
Ich wünsche Dir einen schönen Sommer! [I wish you a great summer!]
Genieße die Ferien und melde Dich mal! [Enjoy the school break and drop me a line sometime!]
Einen schönen Urlaub und erhol' Dich gut! [A nice vacation and relax well!, wherein the 'Ich wünsche Dir' is implied, compare above.]
followed by my name, of course. If one wishes to write more than that, the search terms would be "Poesiealbum" and "Freundschaftsbuch", which are books you have your friends write something in to remember them by, for older and younger kids, respectively.
As already said, yearbooks aren't too popular in Germany. There's the Poesiealbum but it works somewhat different.
You buy a notebook with a nice cover of your choice and all empty pages. Then you write or draw something on the first pages to make a start. After that you give it your dearest friend, so she can see what you have done and she writes or draws something on her empty page. And then the book wanders among your friends, all seeing what others have written for you and how to conform or how to make a difference. Whatever fits the person most.
And of course they may also want to have you write or draw in their book.
You usually have that book for years and get something from the hearts and minds of your dearest friends over the years.
Don't worry about the sheer amount of work, it's not the way everyone has such a book. Maybe one out of ten. But having two or three of those books is sufficient to recollect who was friends with whom on 50th reunion and arrange the seats accordingly.
As tofro already wrote in a comment:
Yearbooks are an American habit - They are not very common with German schools.
And I must add: I also never have seen a yearbook in Austria, and I think this is true also for Switzerland and other countries where German is spoken.
So the most correct answer probably is: You do not write anything at all.
But if there was something like this in German spoken countries, I think you just would write the same phrases, just in German language. You simply need to translate the English comments into German. But then you often end up with commands (thats what those sentences are grammatically) that are normally not used this way in German. But this is not related to yearbooks. It's a matter of how you use commands in German.
Here are translations of your examples:
Have a great summer!
Habe einen schönen Sommer!1
Let's keep in touch.
Lass uns in Verbindung bleiben.2
It's been a nice year with you.
Das war ein nettes/schönes Jahr mit dir.3
This sentence is grammatically correct, and it is a command. It is a command, because it has the verb at position 1, and the verb is an imperative. The subject is merged into the imperative verb in case of Du-form, i.e. it is not present as an discrete word in the sentence. If you use the Sie-form, the subject has to be used explicitly: »Haben Sie einen schönen Sommer!«
But in German you normally do not use commands in such situations. Since the imperative of haben (habe!) and the indicative for 1st person singular in present tense (ich habe) are equal, and because such commands are so rarely used in German, some people even might understand this command as an ellipsis of this statement:
Ich habe einen schönen Sommer.
I have a nice summer.
If you write this into a yearbook, it might sound very egoistic, like "I will have a nice summer, but I don't care about what might happen to you during this time.«
In German, you normally tell, that you wish something:
Ich wünsche dir einen schönen Sommer.
I wish you a nice summer.
»Let's« is very common in English, an it's verbatim translation »Lass uns« become more and more frequent used in German, but in many regions it still is used very rare (see Regionale Verbreitung von »Lass uns ...« for details). And also sentences starting with »Lass uns« are commands.
Instead I think someone would write:
Wir bleiben in Verbindung. (Wir bleiben in Kontakt.)
We keep in touch. (We keep in contact.)
Ich ruf(e) dich an.
I'll call you.
(»ruf« is a colloquial variation of »rufe« similar to »hab«, as discussed in this Question: Usage of "Hab" during conversations)
This works fine in German too, because it is a statement, not a command.