                                 url:       -> "/blog/#{@slugify @title}.sq.#{@ext}"
                                 width:      32
                                 height:     32
-                                crop:       true
+                                crop:       true # With this option, the image will be cropped in order to have the exact 32x32 size
                     ]
             ,
+                # Another model to add links on the sidebar of the blog
+                # Nothing more than the articles model
                 name:   ['Link', 'Links']
                 list:
                     fields: [


    plugins:

        # This contains all the configuration of the admin panel of our blog
        minicms:

            #prefix:
            #    url:    'cms'     # Access the admin panel through '/cms' by default
            #    meta:   'cms'     # Store form data of each content into a 'cms' field by default

            secret: 'keyboard cat blog' # Secret, required by signed cookie

            auth: (login, password, callback) ->
                if login is 'admin' and password is 'password'
                    callback null, true
                else
                    callback "Invalid login or password.", false

            models: [
                name:   ['Configuration', 'Configuration']
                unique: true # When unique, there can only be 1 entry, not more, not less
                form:
                    url:    "/index" # Save configuration meta in index file
                    ext:    'html.md'
                    meta:
                        title:      -> @title
                        layout:     'home'
                        about:      -> @about
                    content:    -> @title
                    components: [
                        field:      'title'
                        label:      'Website Title'
                        type:       'text'
                    ,
                        field:      'author'
                        label:      'Website Author'
                        type:       'text'
                    ,
                        field:      'about'
                        label:      'About me'
                        type:       'textarea'
                        height:     100
                    ,
                        field:      'category'
                        label:      'Category'
                        type:       'choice'
                        expanded:   true
                        data:       ->  ['Sport', 'News']
                    ,
                        field:      'subCategory'
                        deps:       ['category'] # This field will update when the category field changes value
                        label:      'Sub-category'
                        type:       'choice'
                        data:       ->
                                        if @category is 'Sport'
                                            return ['Footbal', 'Tennis', 'Handball', 'Swimming']
                                        else if @category is 'News'
                                            return ['Technology', 'Finance', 'Gossip']
                                        else
                                            return []
                    ,
                        field:      'logo'
                        label:      'Website Logo'
                        type:       'file'
                        use:        'standard'
                        optional:   true
                        images:
                            standard:
                                # You can hardcode an extension (png, jpg, gif), or use the @ext value to dynamically generate the right type.
                                # Also works with animated gifs (but a bit experimental)
                                url:        -> "/logo.#{@ext}"
                                width:      220
                                height:     220
                    ,
                        field:      'wysiwygExample'
                        label:      'Wysiwyg example'
                        type:       'wysiwyg'
                        height:     450
                    ,
                        field:      'markdownExample'
                        label:      'Markdown example'
                        type:       'markdown'
                        height:     450
                    ]
            ,
                name:   ['Article', 'Articles']
                list:
                    fields: [
                        name:   'Title'
                        value:  -> @title
                    ,
                        name:   'Image'
                        html:   ->
                            if @image?
                                return '<div style="height:32px"><img src="'+@image.square.url+'" style="width:32px;height:32px" alt="image" /></div>'

                    ,
                        field:      'content'
                        type:       'markdown'
                        # You can add your custom validator on any field
                        # Well, this is actually useless here because the default validator is doing the same check,
                        # but feel free to check more things for your own needs.
                        validate:   (val) -> typeof(val) is 'string' and val.length > 0
                        # You can also add your custom sanitizer that will be called before saving the content
                        sanitize:   (val) -> return val?.trim()
                    ,
                        field:      'image'
                        type:       'file'
                        use:        'thumbnail'
                        optional:   true
                        images:
                            # This time we have 3 image profiles
                            # Each of them will be generated from the original picture
                            # Notice they all have a different url
                            standard:
                                url:       -> "/blog/#{@slugify @title}.#{@ext}"
                                width:      498
