Skip to content

Commit

Permalink
New thumbnail shortcode
Browse files Browse the repository at this point in the history
  • Loading branch information
Roberto Alsina committed Sep 18, 2017
1 parent a9c0889 commit cab7b40
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGES.txt
Expand Up @@ -4,6 +4,7 @@ New in master
Features
--------

* New 'thumbnail' shortcode (Issue #2809)
* Rewrite ``nikola auto`` with asyncio and aiohttp (Issue #2850)
* New ``listings`` shortcode similar to the reStructuredText listings
directive (Issue #2868)
Expand Down
3 changes: 3 additions & 0 deletions docs/manual.txt
Expand Up @@ -1232,6 +1232,9 @@ raw
Passes the content along, mostly used so I can write this damn section and you can see the shortcodes instead
of them being munged into shortcode **output**. I can't show an example because Inception.

thumbnail
Takes as argument a path to an image, and it will show the thumbnail as a link to the full-sized image
(it's pretty basic, could be improved).

Community shortcodes
~~~~~~~~~~~~~~~~~~~~
Expand Down
1 change: 1 addition & 0 deletions nikola/data/shortcodes/jinja/thumbnail.tmpl
@@ -0,0 +1 @@
<a href="{{ _args[0] }}"><img src="{{ '.thumbnail.'.join(_args[0].rsplit('.', 1)) }}"></a>
1 change: 1 addition & 0 deletions nikola/data/shortcodes/mako/thumbnail.tmpl
@@ -0,0 +1 @@
<a href="${_args[0]}"><img src="${'.thumbnail.'.join(_args[0].rsplit('.', 1))}"></a>

0 comments on commit cab7b40

Please sign in to comment.