Skip to content

Releases: jmalarcon/MIIS

v3.5.0 - New well-known field "ClientIP"

08 Mar 18:01
Compare
Choose a tag to compare

Added a new well-known field called ClientIP that returns the real IP that has been used to connect to the site. It returns the client IP in case is a direct connection and finds the forwarded original IP in case they're using a proxy.

V3.4.0 - Better caching dependency on folders and new CachingTimeOut property

25 Apr 19:25
Compare
Choose a tag to compare

This release has a revamped Markdown file caching and it includes a folder tree caching dependency to be able to invalidate caching when there are changes inside folders with nested subfolders. This is very useful for posts stored in a folder structure instead of all of them in the same folder or for special files such as sitemaps (although in that case, maybe disabling the cache for the sitemap is a good idea, since they are not frequently requested).

It adds a new property called CachingTimeOut that allows to specify the timeout in seconds to force the cache invalidation for any MIIS handled file (.md or .mdh). It can be set on the Front Matter of any file or in web.config to affect many files at once. If the timeout conflicts with the timeout set internally by any Front Matter source (for files that are going to be published in the future) the minimum of both values is used. This can be useful for especial Front Matter sources that get information from sources that you can't control hen they're refreshed. So, instead of setting the cache timeout value from the FM Source, it can be more flexibly established from the file itself using this property.

MIISFilesEnumeratorFMS.dll bumped to v1.2.0

V3.3.0 - The possibility to include default files in FilesFromFolder

22 Apr 12:39
Compare
Choose a tag to compare
  • Added support to retrieve default files with the FilesFromFolder and PaginatorFor Front-Matter sources.
    • Now you can include index and default pages in the results by using a 3rd parameter (true) in the FilesFromFolder and PaginatorFor Front-Matter sources.
    • For example: files: FilesFromFolder ~/ false true will get all the .md and .mdh files from the site, so that you can easily create a sitemap.xml with all the pages in the site, for example.
    • Notice that the former third parameter to sort the files by date ascendingly, has been removed. This is a small breaking change and if you need to sort the files in a different way just use the sort and reverse filters. Take into account that the sort filter allows to sort the files by any of their properties (name, url, url_no_ext...)
  • Automatically remove the name of the default files (index or default) from the URL properties of files. That way, for example /blog/index will automatically be: /blog/. Much nicer.
  • Bumped MIISFilesEnumeratorFMS.dll to 1.1.0 and MIIShandler.dll to 3.3.0

MIIS 3.2.0

19 Apr 18:32
Compare
Choose a tag to compare

Added a new and useful Liquid tag filter: if_null that can save a lot of work and make some files clearer.

See if-null-filter.md file in the Tests folder to see how it works.

MIIS 3.1.0

13 Apr 19:42
Compare
Choose a tag to compare

Added support for the following Liquid filters not available in 3.0.0 (because they weren't available in DotNetLiquid):

  • concat: it works with arrays or any IEnumerable colleciton. It adds a custom optional parameter to indicate in you want to remove duplicated elements, for example: {{ relatedposts | concat: myposts, true}}. That saves you the use of the uniq filter for that, and is faster.
  • reverse: Reverses the order of the items in an array or any IEnumerable.

and added two new useful filters to work with URLs:

  • relative_url: generates the url relative to the root folder of the site to the specified path . For example if you call it inside a content in the /blog folder: {{ "images/logo.jpg" | relative_url }} it'll return: /blog/images/logo.jpg.
  • absolute_url: it's exactly the same but including the full protocol and domain: {{ "images/logo.jpg" | absolute_url }} --> https://www.yoursite.com/blog/images/logo.jpg.

Both of them work with relative paths, paths with ../, root related paths with ~/and absolute paths with the full URL (for example, external images).

Important: make sure you remove the WhereFilter.dll file in the /bin/MIISCustomFilters folder. Now its name is MIISLiquidFilters.dll and includes all the Liquid filters in the same DLL.

MIIS 3.0.0

30 Mar 19:05
Compare
Choose a tag to compare

Version 3.0 is here (at last)!!! 😱

It's rebuilt almost from scratch to add tons of new features and enhancements.

I've been using it for several real web sites for the last 6 months, some of them with hundreds of thousands of unique users per month, so it's thoroughly tested in real life conditions.

Unfortunately I didn't have the time yet to document everything on the main site, but I'll do it as soon as I can. Anyway you can see almost all the features in action in the Tests folder of the main repository. Just copy that folder to your MIIS site and you can play and test with it.

🆕 New features

This is a, more or less, exhaustive list of new features:

  • Support for Liquid Tags and syntax. Mostly compatible with Jekyll and the likes for the simple migration of templates (note that advanced templates that use Ruby extensions and other specific things would need a more laborious adaptation).

  • You can easily create your own liquid tags and filters in .NET asseblies (DLLs). Automatic detection and use.

  • Templates:

    • Added inheritance support to template's layouts. Just add a Layout property in the front-matter of the layout. Prevents circular references.
    • If you specify TemplateName: raw in the Front-Matter, then no template will be used and you'll get the final raw HTML for the requested page. useful for debugging and to return raw information, for example for returning JSON or XML files (RSS, Atom).
    • When you use TemplateName:raw you can also add a new mime field in the page (it's a Front-Mater only field) that allows you to specify the MIME type of the raw content that is going to be returned from the current page. This parameter can be useful to return formatted text that gets generated from a raw .mdh file (for example, to create special kinds of files, such as RSS, JSON... directly from MIIS).
    • Now you can disable the current template in a page by specifying TemplateName: none in the Front-Matter (or web.config in any folder). This will use the default HTML5 basic template that only includes de basic tags, a CSS file and the content. This is useful for testing purposes or to create some basic pages for special purposes.
  • Front-Matter sources (FMS): they're a way to create data sources for your Front-Matter fields. The work in global fields in web.config too. I've included several useful FMS out of the box:

    • FilesFromFolder: processes and retrieves information form files in any folder for a lot of different uses: you can have a posts collection for a blog (with automatic tags and categories), you can create language resources for multilingual templates and sites, maintain and reuse information for authors...
    • PaginatorForFolder: a FMS that eases the creation of paged content from files, compatible with the one in Jekyll.
    • CategsFromFolder: retrieves the categories for files in a folder. Useful to work with documentation, blogs... Compatible with the paginator FMS.
    • TagsFromFolder : retrieves the tags for files in a folder. Useful to work with documentation, blogs... Compatible with the paginator FMS.
  • File Processing Fields now can act as components too, being wrapped in specific layouts for reuse, using the new component field.

  • Many new possibilities for inserting files in your content or in templates:

    • Insert a sub-file in the data context of the current file (using the Front-Matter data of the current file).
    • Insert a sub-file in its own data context (keeping its Front-Matter data).
    • Insert a sub-file without using any context (no data used for the processing of the file and therefore all the placeholders are deleted in the final HTML).
    • Insert a sub-file using the data context of another file. Useful for keeping data-only files that can be resused all over the place.
  • Now you can use any parameter received form field, cookie or server variable in your content through a conventional placeholder. For example {{HTTP_USER_AGENT}} or the name of a field sent in the GET or POST methods. The use of placeholders that refer to any of those parameters (query string, form data, cookies or server variables) automatically disable the caching mechanism because they vary on each request. So use them carefully if caching is important for you. For security reasons if you don't include any of them in your content they are dismissed, so never mind. If you create a custom Front-Matter Source and want to take advantage of query or form parameters in cached pages, generating an individual cache for them, you must declare them accordingly (see examples).

  • New standard fields available to use in templates and content pages:

    • {{FileExt}}: current content file extension.
    • {{Url}}: current file absolute URL from the root folder (not including domain, i.e: /folder/file.md).
    • {{UrlNoExt}}: current file absolute URL without the file extension (i.e: `/folder/file).
    • {{Domain}}: current domain that is serving the site, including the port if it's not the default one (80 or 443) (ie: www.mydomain.com).
    • {{BaseUrl}}: protocol + domain (i.e: https://www.mydomain.com)
    • {{Now}} and {{Today}}: return the server's current date and time in the short form for the current user's locale (i.e.: 30/03/2020 18:27:17). You can format dates using the date filter. By default it uses the .NET formatting instead of Ruby formatting (typical of Liquid), but you can change that (see the DateFormat global parameter below).
    • {{Time}}: Just the time (i.e.: 18:27:07).
    • {{Content}}: The final HTML content, WITHOUT the template and WITH liquid tags processed. Now, you can reuse this field in any content, not just in templates. Useful for processing files with Front-Matter Sources.
    • {{Date}}: the date for a file. You can manually specify it in the Front-Matter or it will use the creation date for the file.
    • {{DateCreated}}: the creation date for the file.
    • {{DateModified}}: the modification date for the file.
    • {{dir}}: the current directory absolute path from the root where the file is located (i.e.: /midir/muSubDir/).
    • {{TemplateName}}: sets or gets the name of the template used for the current file.
    • {{Layout}}: sets or gets the name of the current layout of the template used for the current file.
    • {{excerpt}}, {{description}}, {{summary}}: fields that can be used to specify a summary for the current file (read in the content or template, and write in the Front-Matter). If more than one is used, the precedence is: {{excerpt}}, {{description}} and {{summary}}.
    • {{UniqueId}}:
    • {{isauthenticated}}: true if the current user has been authenticated in the site using any of the supported methods (Forms, Windows, OAuth...) or false if not.
    • {{authtype}}: the type of authentication performed.
    • {{username}}: the name of the currently authenticated user.
  • Enable or disable caching per file, not only globally as in 2.x. You can have caching enabled globally in web.config and at the same time disable it only for specific files, or the other way around. The parameter to enable/disable caching is now called Caching. The old UseMDCaching parameter has been deprecated. It still works, but it can disappear in future updates. Use Caching instead.

  • More advanced Markdown extensions enabled by default (if in doubt about their function, see Markdig's documentation to know more about them):

    • Abbreviations
    • AutoIdentifiers
    • Citations
    • CustomContainers
    • DefinitionLists
    • EmphasisExtras
    • Figures
    • Footers
    • Footnotes
    • GridTables
    • Mathematics
    • MediaLinks
    • PipeTables
    • ListExtras
    • TaskLists
    • Diagrams
    • AutoLinks
    • GenericAttributes
  • You can now use the new EnableMDExtensions field (globally or per file) to enable some more Markdown extensions if needed. Just add them in a parameter with a "+" sign to separate them (case insensitive). For example: <add key="MIIS:EnableMDExtensions" value="hardlinebreak+bootstrap+smartypants"/>. The available extra extensions are

    • hardlinebreak: Use softline breaks in Markdown as Hardline breaks in HTML
    • bootstrap: Adds some Bootstrap classes to the resulting HTML. See this
    • smartypants: Translates plain ASCII punctuation characters into “smart” typographic punctuation HTML entities. See this
    • nofollowlinks: Adds rel=nofollow to all links rendered to HTML
    • nohtml: Disables the HTML support in the markdown processor (for constraint/safe parsing), so you couldn't mix HTML into your Markdown content.
    • globalization: Adds support for right-to-left content by adding appropriate html attributes.
    • nonascii-noescape: Disable URI escape with % characters for non-US-ASCII characters in order to workaround a bug under IE/Edge with local file links containing non US-ASCII chars. DO NOT USE OTHERWISE.
  • Added the naming and dateformat global parameters.

    • They allow to change ...
Read more

MIIS 2.3.0

06 Apr 10:20
Compare
Choose a tag to compare

This is the last intended update until the next major version 3.0.0 that will have major breaking changes.

What's new?

  • ⚠️ Removed the allowDownloading option and the corresponding "download" query string parameter.
  • Now you can disable the current template in a page by specifying `TemplateName: none´ in the Front-Matter. This will use the default HTML5 basic template that only includes de basic tags, a CSS file and the content. This is useful for testing purposes or to create some basic pages for special purposes.
  • Raw contents: If you specify `TemplateName: raw´ in the Front-Matter, then no template will be used and you'll get the final raw HTML for the requested page. useful for debugging and to return raw information.
  • MIME type: When you use the "raw" template to get raw contents from a file, you can also add a new {{mime}} parameter in the page (it's a Front-Mater only field) that allows you to specify the MIME type of the raw content that is going to be returned from the current page. This parameter can be useful to return formatted text that gets generated from a raw .mdh file.
  • 6 new standard fields available to use in templates and content pages:
    • {{Url}}
    • {{NoExtUrl}}
    • {{Domain}}
    • {{BaseUrl}}
    • {{Now}}
    • {{Time}}
  • Fixed extra new line added at the beginning of the content because of Front-Matter removed. No extra new line is added now.

Minor bug fixed

05 Apr 12:47
Compare
Choose a tag to compare

Fixed a minor bug that happened when there were a $& or similar combination inside a piece of content.

See issue #28 .

MIIS 2.2.0

20 Aug 19:27
Compare
Choose a tag to compare
  • Added the new "HttpStatusCode" property that allows pages to send an specific status code to the client, such as 404, 410, 500, etc... in order to create special pages with specific purposes.
  • Added 404 sample page to the release files.
  • Updated templates to latest jQuery version
  • Updated markdig Markdown library to the latest version

MIIS 2.1.0

24 Mar 20:39
Compare
Choose a tag to compare
  • Added the new "Published" property that allows you to prevent certain files or entire folders to be rendered when requested.
  • Squashed a bug with templates' caching preventing some files to invalidate their cache