kolber / stacey

Cheap & easy content management
http://staceyapp.com
MIT License
1.04k stars 132 forks source link

Issue with yml for html content #73

Closed bricebou closed 11 years ago

bricebou commented 11 years ago

Hi,

I've just discovered Stacey and I find it really interesting but after playing with an older version (with txt files) I've discovered this git repository and it seems that I've an issue with line endings or HTML elements in my yml files ; for example the content above give me that message

An exception has been thrown during the rendering of a template ("Unable to parse file "./content/5.web/2.gmap/1.gmap2/2.poly-kml/gmap2.yml": Unable to parse line 3

If I put the content on a single line there is no problem anymore but you have to admit that it's far from easy to read your code anymore... :/ Maybe an issue with my saving parameters (I'm using Sublime Text, I save in UTF-8) ?

title: 3.3 Encoded polylines and polygons
content: | 
<p>Lorsque l'on a des fichiers KML extrêmement lourds, le traitement et l'affichage peut s'avérer lent, comme lorsque l'on souhaite afficher des tracés complexes et très précis donc avec de très nombreux points (par exemple, les frontières du Limousin). L'une des solutions consiste à réduire le nombre de points, grâce à l'algorithme de Douglas et à utiliser des <em>polygons</em> ou <em>polylines</em> cryptés. Pour obtenir un polygone cryptés tout en réduisant sa précision à partir d'un fichier KML, nous utilisons <a href="http://facstaff.unca.edu/mcmcclur/googlemaps/encodepolyline/encodeForm.html" target="_blank">cet outil en ligne</a>.</p>
<p>Nous n'allons pas ici placer le code correspondant à l'exemple dans la mesure où il suffit de créer une carte et d'ajouter le code fourni par le programme. Attention toutefois à ne pas préciser, lors de la création de la carte, les coordonnées pour centrer celle-ci ainsi que le niveau de zoom par défaut dans la mesure où ils sont calculés par la suite dans le code obtenu et ce de telle sorte que la forme soit entièrement visible.</p>
<div id="map9" style="height: 400px;"></div>

Thanks for your answers and for the work on stacey.

PS : Sorry if my english is not very clear :/

kolber commented 11 years ago

In the YAML format, you do need to indent each line of a multi-line text block in by two spaces. That should solve your issue for now. It is a bit annoying, but it's something I have been working on a fix for.

bricebou commented 11 years ago

Ok, thanks for your answer, I've tried and it's working. But it seems to me that stacey with YAML is a bit more complex : I haven't manage to have a working category page as previously (I have a list of categories and sub-categories but it uses file names instead of category titles specified in category.yml files).

Do you have examples of "extended" templates ?

Thanks again.

bricebou commented 11 years ago

Well, after "playing" a little more time with the git version of stacey, I've managed to understand a little bit more the way it works.

But I still don't have a satisfying category / sub-category page... I explain: I have a structure like that:

When I'm on the category page I'd like to see the sub-categories when it exists and the pages or only the pages. I cant show you online, but I've forked your repository and you can access it here : https://github.com/bricebou/stacey and the files for this display are there : https://github.com/bricebou/stacey/blob/master/templates/category.html and https://github.com/bricebou/stacey/blob/master/templates/partials/navigation/category-lists-projects.html

Is there a way to distinguish a category / sub-category folder from a page folder ?

Thanks again for Stacey and for your answers.

kolber commented 11 years ago

Thanks for the response Brice. Glad that solved your issue.

Perhaps it might be possible to check if there is more than one level of children to determine if it is a category or subcategory? Or it may even be simpler to set a variable on the parent page directly.

bricebou commented 11 years ago

Thanks but I don't really understand what you are suggesting :/ Could you give me an example or more detailed informations ?

Thanks again.

kolber commented 11 years ago

I don't have any at hand, but can you not add something like a pagetype variable?

Like:

title: Page Title

pagetype: category

content: etc...
bricebou commented 11 years ago

This part I understood :) It's the template part that is more problematic ; I have to do something like that : {% if child.pagetype = "category" %} then test again the presence of a child and if this one is also a category ?

In my idea, it would be more "logic" to do something like that : while child and child = category only display category name and then projects. I mean, to have an automated recursive process.

I'm sorry for my limited understanding :/ and thanks again.