Apostrophe 2.1.0 released

37 views
Skip to first unread message

Tom Boutell

unread,
Sep 16, 2016, 4:41:39 PM9/16/16
to apostr...@googlegroups.com
We've just published version 2.1.0.

"Is this a big deal?"

Not really. 2.0.0 was a big deal! 2.1.0 just means we added features.
According to the semantic versioning policy, we must bump the minor
(middle) version number every time we do that.

"What are the new features?"

RICH TEXT AND PLAINTEXT HELPERS

New template helpers to access the rich text and the plaintext of your
docs without calling apos.area or apos.singleton. These are helpful
when you just want the text and you don't want the rest of the markup
or the ability to edit.

"Examples?"

{# Output just the rich text from all apostrophe-rich-text widgets in an area #}
{{ apos.areas.richText(data.page.body) }}

{# Plaintext only, no markup; truncate to 100 characters, or shorter
to avoid breaking words #}
{{ apos.areas.plaintext(data.page.body, { limit: 100 }) }}

{# I don't like "...", just cut it off #}
{{ apos.areas.plaintext(data.page.body, { limit: 100, ellipsis: '' }) }}

CUSTOM IMAGE SIZES

By default Apostrophe generates several image sizes, as covered in the
documentation.

Beginning in 2.1.0, there is a convenient `addImageSizes` option to
add more without fuss:

modules: {
'apostrophe-attachments': {
addImageSizes: [
{
name: 'button',
width: 100,
height: 100
}
]
}
}

Now you can use `button` as a `size` option with the
`apostrophe-images` widget, or when calling `apos.attachments.url`
directly.

As always the image will be NO LARGER THAN the specified size on each
dimension, without any distortion. So it will be smaller in one
dimension, or both if the original is too small.

Enjoy!

--


THOMAS BOUTELL, SUPPORT LEAD
P'UNK AVENUE | (215) 755-1330 | punkave.com

Cli F

unread,
Sep 16, 2016, 5:18:02 PM9/16/16
to apostrophenow
Great Tom! What is the recommended upgrade process from 2.0.0 to 2.1.0?

Tom Boutell

unread,
Sep 16, 2016, 5:48:09 PM9/16/16
to apostr...@googlegroups.com

npm update!

No BC breaks allowed without going to 3.0, etc.


--
You received this message because you are subscribed to the Google Groups "apostrophenow" group.
To unsubscribe from this group and stop receiving emails from it, send an email to apostrophenow+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Cli F

unread,
Sep 16, 2016, 5:53:05 PM9/16/16
to apostrophenow
I did try that, changed the version number in package.json to 2.1.0 and got this error:

 No compatible version found: async@'>=2.1.0 <3.0.0'


Valid installs seem to be as follows:

npm ERR! notarget Valid install targets:

npm ERR! notarget ["0.1.0","0.1.1","0.1.2","0.1.3","0.1.4","0.1.5","0.1.6","0.1.7","0.1.8","0.1.9","0.1.10","0.1.11","0.1.12","0.1.13","0.1.14","0.1.15","0.1.16","0.1.17","0.1.18","0.1.19","0.1.20","0.1.21","0.1.22","0.2.0","0.2.1","0.2.2","0.2.3","0.2.4","0.2.5","0.2.6","0.2.7","0.2.8","0.2.9","0.2.10","0.3.0","0.4.0","0.4.1","0.5.0","0.6.0","0.6.1","0.6.2","0.7.0","0.8.0","0.9.0","0.9.2","1.0.0","1.1.0","1.2.0","1.1.1","1.2.1","1.3.0","1.4.0","1.4.1","1.4.2","1.5.0","1.5.1","1.5.2","2.0.0-alpha.0","2.0.0-rc.1","2.0.0-rc.2","2.0.0-rc.3","2.0.0-rc.4","2.0.0-rc.5","2.0.0-rc.6","2.0.0","2.0.1"]

To unsubscribe from this group and stop receiving emails from it, send an email to apostropheno...@googlegroups.com.

Tom Boutell

unread,
Sep 16, 2016, 6:19:57 PM9/16/16
to apostr...@googlegroups.com

I think you changed the version number of the async module rather than apostrophe?


To unsubscribe from this group and stop receiving emails from it, send an email to apostrophenow+unsubscribe@googlegroups.com.

Cli F

unread,
Sep 16, 2016, 6:38:36 PM9/16/16
to apostrophenow
That'll be it, thanks Tom :)

Cli F

unread,
Sep 16, 2016, 6:45:22 PM9/16/16
to apostrophenow
Tried running one of the new template helpers:

{{ apos.areas.richText(data.page.body) }} 

but get this error:

Error: Unable to call `apos["areas"]["richText"]`, which is undefined or falsey] name: 'Template render error' }


On Saturday, September 17, 2016 at 6:41:39 AM UTC+10, Tom Boutell wrote:

Tom Boutell

unread,
Sep 16, 2016, 7:19:12 PM9/16/16
to apostr...@googlegroups.com

Suspect you did not really update yet, but will test at home later!


--
You received this message because you are subscribed to the Google Groups "apostrophenow" group.
To unsubscribe from this group and stop receiving emails from it, send an email to apostrophenow+unsubscribe@googlegroups.com.

Cli F

unread,
Sep 16, 2016, 7:45:18 PM9/16/16
to apostrophenow
I'm sure you are right and I am doing something wrong! But as an experiment I have just created a fresh install test-project as per your tutorial at http://apostrophenow.org/tutorials/getting-started/creating-your-first-project.html. And when I add

{{ apos.areas.richText(data.page.body) }}

the same error gets thrown.

Error: Unable to call `apos["areas"]["richText"]`, which is undefined or falsey] name: 'Template render error' }


It should be noted that the package.json file that is created on your test project reads:

{
  "name": "test-project",
  "version": "0.6.0",
  "description": "Minimal test-project",
  "main": "app.js",
  "scripts": {
    "start": "node app.js"
  },
  "repository": {
    "type": "git",
    "url": ""
  },
  "author": "P'unk Avenue",
  "license": "MIT",
  "dependencies": {
    "apostrophe": "punkave/apostrophe#unstable"
  }
}

and I changed the version number to: 2.1.0

and ran npm update - no joy

then I added the url to: "url": "g...@github.com:punkave/apostrophe.git"

no joy...


To unsubscribe from this group and stop receiving emails from it, send an email to apostropheno...@googlegroups.com.

Tom Boutell

unread,
Sep 16, 2016, 8:42:23 PM9/16/16
to apostr...@googlegroups.com

Hmmm,i think you might be using an old version of the apostrophe-cli but I will check later! All of this is good source material to improve our tutorials.


To unsubscribe from this group and stop receiving emails from it, send an email to apostrophenow+unsubscribe@googlegroups.com.

Tom Boutell

unread,
Sep 17, 2016, 10:32:04 AM9/17/16
to apostr...@googlegroups.com
Thanks for pushing us on this! You led us to an important oversight:
the apostrophe-boilerplate project, which the apostrophe command line
tool clones, had not been updated to use the official npm release of
apostrophe 2.

That has now been done. From now on when you create projects with
"apostrophe create" you will get the official npm release. And the npm
dependency for the apostrophe module is already set to "^2.0.0", which
means you will get updates in the 2.x series just by typing npm
update.

I had better explain how to update an *existing* project that was
created from this pre-release boilerplate.

What you want to do is set the version number for the apostrophe
module in the "dependencies" property:

"dependencies": {
"apostrophe": "^2.0.0"
}

This, of course, wasn't obvious because we had an old git-based
dependency URL in there rather than a version number.

Again, once you set it to "^2.0.0", a simple "npm update" should
suffice to get you the real, latest, npm-published Apostrophe version,
which as of this writing is 2.1.0.

Sorry this was such a hassle, and thanks again for calling the problem
to our attention!
Reply all
Reply to author
Forward
0 new messages