2
1
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2023-12-13 21:00:40 +01:00
Commit graph

117 commits

Author SHA1 Message Date
Kevin Ansfield 47322e4239 Re-instate mobiledoc dom rendering with bypass of SimpleDOM parsing (#8937)
closes #8757

- update the markdown card render method to use SimpleDOM's `createRawHtmlSection`. This avoids SimpleDOM parsing and tokenization of broken or unsupported free-form HTML that markdown allows
- replace markdown extraction/render with mobiledoc's renderer in the `Post` model
- removes `jsdom` as it's no longer necessary
2017-08-31 12:09:02 +02:00
Aileen Nowak 30bee115fe Used got to handle requests for image-size (#8892)
refs #8589, refs #8868

- swap `request` with `got` in `getImageSizeFromUrl` util
- less handling for request cases e.g. timeouts, follow redirects
2017-08-31 11:39:37 +02:00
David Wolfe be54da265b Add segment analytics for blog data (#8912)
no issue
- adds data to track such as post published
- adds ability to add custom data and event prefix via config file
2017-08-22 12:23:23 +01:00
Aileen Nowak b086b432ad Dumped icojs and use image-size for .ico (#8888)
refs #8868

The `image-size` library supports now `.ico` files, which means there is no longer need to use the `icojs` library.
- removes unnecessary `icojs` dependency
- refactors `getIconDimensions` fn in blog icon util to fetch image sizes synchronus
- removes unnecessary `getIconDimensions` fn in blog icon validation, as there is no longer need to use different image size fn for different file extensions, and uses `getIconDimensions` from blog util fn instead.
- updates and adds more tests
2017-08-17 17:44:05 +01:00
Hannah Wolfe b6b299a8f7 Used ghost-ignition.debug, removed debug dep (#8881)
no issue

- Upgraded ghost-ignition
- Use debug from ghost-ignition everywhere in the code base
- Remove debug dependency
- Fixed random typo in Gruntfile.js
2017-08-15 18:29:27 +07:00
kirrg001 bb6b58cae7 ⬆️ Bump dependencies
no issue

- cookie-session@1.3.0
- ghost-ignition@2.8.13
- gscan@1.1.7
- image-size@0.6.1
- markdown-it@8.3.2
- mysql@2.14.1
- mocha@3.5.0
- nock@9.0.14
2017-08-08 14:57:10 +02:00
kirrg001 ffecf87551 ⬆️ Bumb dependencies
no issue

- compression@1.7.0
- cors@2.8.4
- gscan@1.1.6
- jsonpath@0.2.12
- knex-migrator@2.1.5
- semver@5.4.1
2017-08-03 11:09:03 +04:00
kirrg001 68803ae250 ⬆️ Bump dependencies
no issue

- knex-migrator@2.1.4
2017-08-01 17:20:01 +04:00
kirrg001 acfb0d31ea ⬆️ Bump dependencies
no issue

- ghost-ignition@2.8.12
2017-08-01 13:40:50 +04:00
Katharina Irrgang 7845617607 Custom Post Excerpt Feature (#8792)
closes #8793

- 1.3 post excerpt migration
  - add 1.3 migration to add `excerpt` to post schema

NOTE:
    - knex-migrator relies on the package.json safe version
    - so right now Ghost is on 1.2
    - the migration script is for 1.3
    - if you pull down the PR (or if we merge this PR into master), you have to run `knex-migrator migrate --v 1.3 --force`
    - knex-migrator will tell you what you have todo

- Bump dependencies
  - knex-migrator@2.1.3
- Soft limit for custom_excerpt
- Extended {{excerpt}} to use custom excerpt
   - when a `custom_excerpt` field exists, the `{{excerpt}}` helper will output this and fall back to autogenerated excerpt if not.
- Refactored behaviour of (meta) description
   - html tag `<meta name="description" />` for posts, tags and author doesn't get rendered if not provided.
        - fallback for `author.bio` removed
        - fallback for `tag.description` removed
   - structured data and schema.org for `post` context takes the following order to render description fields:
        1. custom excerpt
        2. meta description
        3. automated excerpt (50 words)
    - updated and added tests to reflect the changes
2017-08-01 12:39:34 +04:00
Katharina Irrgang b11ffd976b ⬆️ bump dependencies (#8761)
no issue

- gscan@1.1.5
2017-07-27 11:47:27 +04:00
kirrg001 f4ecd65853 ⬆️ bump dependencies
no issue

- gscan@1.1.4
2017-07-18 15:31:12 +02:00
kirrg001 07e35e3d0b ⬆️ bump dependencies
no issue

- gscan@1.1.3
- grunt-contrib-clean@1.1.0
- grunt-contrib-compress@1.4.3
- grunt-contrib-jshint@1.1.0
- jshint@2.9.5
- mocha@3.4.2
2017-07-11 10:45:43 +02:00
kirrg001 6a589f7878 ⬆️ bump dependencies
no issue

- gscan@1.1.2
- body-parser@1.17.2
- debug@2.6.8
- express@4.15.3
- html-to-text@3.3.0
- image-size@0.5.5
- uuid@3.1.0
2017-06-22 19:40:56 +02:00
kirrg001 d823412987 ⬆️ bump dependencies
no issue

- gscan 1.1.1
2017-06-08 16:14:51 +02:00
kirrg001 85ed078df8 ⬆️ gscan 1.1.0 2017-06-06 13:07:50 +07:00
kirrg001 8680099765 🎨 gscan 1.1.0 & optimisations
refs #8222

- differentiate between errors and fatal errors
- use gscan errors in theme middleware
- Adds a new `error()` method to `currentActiveTheme` constructor which will return the errors we receive from gscan
- In middleware, if a theme couldn't be activated because it's invalid, we'll fetch the erros and send them to our error handler. We also use a new property `hideStack` to control, if the stack (in dev mode and if available) should be shown or the gscan errors (in prod mode, or in dev if no stack error)
- In our error handler we use this conditional to send a new property `gscan` to our error theme
- In `error.hbs` we'll iterate through possible `gscan` error objects and render them.
- remove stack printing
- stack for theme developers in development mode doesn't make sense
- stack in production doesn't make sense
- the stack is usually hard to read
- if you are developer you can read the error stack on the server log
- utils.packages: transform native error into Ghost error
- use `onlyFatalErrors` for gscan format and differeniate fatal errors vo.2
- optimise bootstrap error handling
- transform theme is missing into an error
- add new translation key
- show html tags for error.hbs template: rule
2017-06-06 13:07:50 +07:00
Ryan McCarvill 957f51e677 🐝 Allow unbalanced HTML in markdown card. (#8320)
no issue

The simpledom interpreter that the Mobiledoc DOM renderer uses does not allow for unbalanced or incorrect HTML such as that which is entered by a user.

This PR adds a step where the HTML is sanitised and balanced before being passed to simpledom.

- use latest jsdom (+pin version), update yarn.lock, add comments
- don't use node-4 incompatible shorthand method definition
- grab <body> content rather than document content
- update markdown card specs to match markdown-it behaviour
- revert to jsdom 9.12.0 for node 4.x support, close window to free memory
- moved 3rd party libs into render function
2017-05-23 16:15:32 +02:00
kirrg001 b20fb26061 ⬇️️ revert dependencies: knex@0.13.0 to knex@0.12.9
no issue

We have recently merged `knex:0.13.0` into Ghost master.

It was absolutely fine and it works, because yarn is smart. but...
- in case you use `npm` for the installation, the installation of the Ghost dependency fails because of a peer dependency error
- we install 2x knex, which isn't really useful
- bookshelf doesn't actually support knex 0.13.0 yet, see https://github.com/tgriesser/bookshelf/issues/1566
2017-05-22 14:59:21 +02:00
Kevin Ansfield 5d868d14ad replace custom showdown fork with markdown-it (#8451)
refs https://github.com/TryGhost/Ghost-Admin/pull/690, closes #1501, closes #2093, closes #4592, closes #4627, closes #4659, closes #5039, closes #5237, closes #5587, closes #5625, closes #5632, closes #5822, closes #5939, closes #6840, closes #7183, closes #7536

- replace custom showdown fork with markdown-it
- swaps showdown for markdown-it when rendering markdown
- match existing header ID behaviour
- allow headers without a space after the #s
- add duplicate header ID handling
- remove legacy markdown spec
- move markdown-it setup into markdown-converter util
- update mobiledoc specs to match markdown-it newline behaviour
- update data-generator HTML to match markdown-it newline behaviour
- fix Post "converts html to plaintext" test
- update rss spec to match markdown-it newline behaviour
- close almost all related showdown bugs
2017-05-15 18:48:14 +02:00
kirrg001 33c95f4523 ⬆️ bump dependencies
no issue

- express@4.15.2
- body-parser@1.17.1
- uuid@3.0.1
2017-05-12 08:59:09 +01:00
Greenkeeper df8e7f873e Update fs-extra to version 3.0.1 🚀 (#8440)
* chore(package): update fs-extra to version 3.0.1

https://greenkeeper.io/

* chore: yarn.lock
2017-05-10 09:51:54 +02:00
Greenkeeper a3e74b305a Update debug to version 2.6.6 🚀 (#8425)
* chore(package): update debug to version 2.6.6

https://greenkeeper.io/

* chore: yarn.lock
2017-05-10 09:47:23 +02:00
Greenkeeper 7a4d76c57d Update image-size to version 0.5.2 🚀 (#8446)
* chore(package): update image-size to version 0.5.2

https://greenkeeper.io/

* chore: yarn.lock
2017-05-10 09:46:54 +02:00
Greenkeeper 8704cc9169 Update knex to version 0.13.0 🚀 (#8428)
* chore(package): update knex to version 0.13.0

https://greenkeeper.io/

* chore: yarn.lock
2017-05-02 13:43:50 +02:00
Greenkeeper 53cc834cd1 Update mocha to version 3.3.0 🚀 (#8376)
* chore(package): update mocha to version 3.3.0

https://greenkeeper.io/

* chore: yarn.lock
2017-05-02 13:33:47 +02:00
Katharina Irrgang 76bd4fdef6 🙀 Image field naming & new img_url helper (#8364)
* 🙀  change database schema for images
    - rename user/post/tag images
    - contains all the required changes from the schema change

* Refactor helper/meta data
    - rename cover to cover_image
    - also rename default settings to match the pattern
    - rename image to profile_image for user
    - rename image to feature_image for tags/posts

* {{image}} >>> {{img_url}}
    - rename
    - change the functionality
    - attr is required
    - e.g. {{img_url feature_image}}

* gscan 1.0.0
    - update yarn.lock

* Update casper reference: 1.0-changes
    - see 5487b4da8d
2017-04-24 18:21:47 +01:00
Greenkeeper df26e38ccf Update debug to version 2.6.4 🚀 (#8367)
* chore(package): update debug to version 2.6.4

https://greenkeeper.io/

* chore: yarn.lock
2017-04-24 16:37:02 +02:00
Greenkeeper c3403d581a Update ghost-ignition to version 2.8.11 🚀 (#8377)
* chore(package): update ghost-ignition to version 2.8.11

https://greenkeeper.io/

* chore: yarn.lock
2017-04-24 13:21:00 +02:00
Greenkeeper b4c70677d8 Update gscan to version 0.2.4 🚀 (#8368)
* chore(package): update gscan to version 0.2.4

https://greenkeeper.io/

* chore: yarn.lock
2017-04-21 01:26:56 +02:00
Greenkeeper 1ccea56370 Update gscan to version 0.2.3 🚀 (#8344)
* chore(package): update gscan to version 0.2.3

https://greenkeeper.io/

* chore: yarn.lock
2017-04-17 16:04:31 +02:00
Hannah Wolfe e9a537004b Added pre-commit hook to handle submodules (#8302)
refs #8235

Usage:
- for existing development setups: `grunt symlink` (will create the pre-commit symlink)
- for fresh development setups: `npm run init` (symlinking happens as part of the typical set up)

-  Added pre-commit hook to handle submodules
  - Checks to see if there are any submodules about to be committed
  - Output matches closely to `git st` to make it easy to read
  - Requires interaction from the committer to accept that this really should be committed
-  Use grunt symlink to register githooks
  - Grunt symlink will make a link to the pre-commit hook
  - It ONLY does this if there isn't already a pre-commit hook, so won't overwrite anything
  - It does this as part of npm run init, not grunt init, because a release repo would NEVER want this
  - This is a dev tool, that configures the repo for development
2017-04-13 08:26:48 +01:00
Greenkeeper 6a7879d4f8 Update nock to version 9.0.13 🚀 (#8306)
* chore(package): update nock to version 9.0.13

https://greenkeeper.io/

* chore: yarn.lock
2017-04-11 10:26:31 +02:00
Hannah Wolfe a413d70313 Asset amends (#8294)
refs #8221

🔥 Remove ghost=true concept from asset url helper

 💯 Introduce CSS minification with cssnano
- add new grunt-cssnano dependency
- wire up grunt task to minify public/ghost.css

🎨 Rename minification config & hash params
- Change minifyInProduction -> hasMinFile
  - this means this asset should have a .min file available
- Change minifyAssets -> useMinFiles
  - this means that in this env we want to serve .min files if available

🎨 Update public/ghost.css to serve .min for prod
- add the new `hasMinFile` property

🎨 Move minified asset handling to asset_url util
- this logic should be in the util, not the asset helper
- updated tests

📖 Error handler always needs asset helper
- this removes the TODO and adds a more sensible comment
- we also need to update our theme documentation around error templates

🔥 Don't use asset helper in ghost head
- use getAssetUrl util instead!
- removed TODO

📖 Update proxy docs
🎨 Simplify asset helper & add tests
- this refactor is a step prior to moving this from metadata to being a url util
- needed to skip some new tests

🐛 Add missing handler for css file
2017-04-10 11:30:21 +02:00
Greenkeeper 791f1b55df Update gscan to version 0.2.2 🚀 (#8281)
* chore(package): update gscan to version 0.2.2

https://greenkeeper.io/

* chore: yarn.lock
2017-04-06 13:55:10 +02:00
Greenkeeper 9d020c93fc Update icojs to version 0.7.2 🚀 (#8278)
* chore(package): update icojs to version 0.7.2

https://greenkeeper.io/

* chore: yarn.lock
2017-04-05 19:11:09 +02:00
Katharina Irrgang 817b8d09ca 😱 🎨 Refactor storage adapter (#8229)
refs #7687

There are four main changes in this PR:

we have outsourced the base storage adapter to npm, because for storage developers it's annoying to inherit from a script within Ghost
we hacked theme storage handling into the default local storage adapter - this was reverted, instead we have added a static theme storage here
use classes instead of prototyping
optimise the storage adapter in general - everything is explained in each commit

----

* rename local-file-store to LocalFileStorage

I would like to keep the name pattern i have used for scheduling.
If a file is a class, the file name reflects the class name.
We can discuss this, if concerns are raised.

* Transform LocalFileStorage to class and inherit from new base

- inherit from npm ghost-storage-base
- rewrite to class
- no further refactoring, happens later

* Rename core/test/unit/storage/local-file-store_spec.js -> core/test/unit/storage/LocalFileStorage_spec.js

* Fix wrong require in core/test/unit/storage/LocalFileStorage_spec.js

* remove base storage and test

- see https://github.com/kirrg001/Ghost-Storage-Base
- the test has moved to this repo as well

* Use npm ghost-storage-base in storage/index.js

* remove the concept of getStorage('themes')

This concept was added when we added themes as a feature.
Back then, we have changed the local storage adapter to support images and themes.
This has added some hacks into the local storage adapters.
We want to revert this change and add a simple static theme storage.

Will adapt the api/themes layer in the next commits.

* Revert LocalFileStorage

- revert serve
- revert delete

* add storagePath as property to LocalFileStorage

- define one property which holds the storage path
- could be considered to pass from outside, but found that not helpful, as other storage adapters do not need this property
- IMPORTANT: save has no longer a targetDir option, because this was used to pass the alternative theme storage path
- IMPORTANT: exists has now an alternative targetDir, this makes sense, because
  - you can either ask the storage exists('my-file') and it will look in the base storage path
  - or you pass a specific path where to look exists('my-file', /path/to/dir)

* LocalFileStorage: get rid of store pattern

- getUniqueFileName(THIS)
- this doesn't make sense, instances always have access to this by default

* Add static theme storage

- inherits from the local file storage, because they both operate on the file system
- IMPORTANT: added a TODO to consider a merge of themes/loader and themes/storage
- but will be definitely not part of this PR

* Use new static theme storage in api/themes

- storage functions are simplified!

* Add https://github.com/kirrg001/Ghost-Storage-Base as dependency

- tarball for now, as i am still testing
- will release if PR review get's accepted

* Adapt tests and jscs/jshint

* 🐛  fix storage.read in favicon utility

- wrong implementation of error handling

* 🎨  optimise error messages for custom storage adapter errors

* little renaming in the storage utlity

- purpose is to have access to the custom storage instance and to the custom storage class
- see next commit why

* optimise instanceof base storage

- instanceof is always tricky in javascript
- if multiple modules exist, it can happen that instanceof is false

* fix getTargetDir

- the importer uses the `targetDir` option to ensure that images land in the correct folder

* ghost-storage-base@0.0.1 package.json dependency
2017-04-05 15:10:34 +01:00
Greenkeeper b9563ab6af Update moment-timezone to version 0.5.13 🚀 (#8272)
* chore(package): update moment-timezone to version 0.5.13

https://greenkeeper.io/

* chore: yarn.lock
2017-04-05 09:56:39 +02:00
kirrg001 9b73949e35 bump yarn.lock sub-dependencies
no issue

- run `yarn upgrade` to bump sub-dependencies
2017-04-04 14:13:26 +02:00
Katharina Irrgang a42b233b04 Revert: Update sinon to version 2.1.0 (#8262)
no issue

- https://greenkeeper.io/
- revert because sinon has changed their API obviously and it shows lots of depreaction warnings right now
- as sinon is "just" a testing dependency, i wouldn't spend this time right now and add sinon to the ignore list

* Revert: Update sinon to version 2.1.0
* yarn update
2017-04-04 11:54:48 +01:00
Greenkeeper e348303337 Update bluebird to version 3.5.0 🚀 (#8096)
* chore(package): update bluebird to version 3.5.0

https://greenkeeper.io/

* chore: yarn.lock
2017-04-04 10:48:39 +02:00
Greenkeeper a78ee40f63 Update should to version 11.2.1 🚀 (#8117)
* chore(package): update should to version 11.2.1

https://greenkeeper.io/

* chore: yarn.lock
2017-04-04 10:48:05 +02:00
Greenkeeper f0abb25611 Update debug to version 2.6.3 🚀 (#8151)
* chore(package): update debug to version 2.6.3

https://greenkeeper.io/

* chore: yarn.lock
2017-04-04 10:28:37 +02:00
Greenkeeper 68efdfa4e7 Update moment to version 2.18.1 🚀 (#8207)
* chore(package): update moment to version 2.18.1

https://greenkeeper.io/

* chore: yarn.lock
2017-04-04 10:27:57 +02:00
Greenkeeper c1a67df9e1 Update superagent to version 3.5.2 🚀 (#8208)
* chore(package): update superagent to version 3.5.2

https://greenkeeper.io/

* chore: yarn.lock
2017-04-04 10:19:42 +02:00
Greenkeeper d689559975 Update ghost-ignition to version 2.8.10 🚀 (#8177)
* chore(package): update ghost-ignition to version 2.8.10

https://greenkeeper.io/

* chore: yarn.lock
2017-04-04 10:13:19 +02:00
Greenkeeper ea2afd1823 Update should-http to version 0.1.1 🚀 (#8209)
* chore(package): update should-http to version 0.1.1

https://greenkeeper.io/

* chore: yarn.lock
2017-04-04 10:12:37 +02:00
Greenkeeper 157d48588d Update fs-extra to version 2.1.2 🚀 (#8181)
* chore(package): update fs-extra to version 2.1.2

https://greenkeeper.io/

* chore: yarn.lock
2017-04-04 09:49:58 +02:00
Greenkeeper e2b7aead2f Update simple-html-tokenizer to version 0.4.1 🚀 (#8232)
* chore(package): update simple-html-tokenizer to version 0.4.1

https://greenkeeper.io/

* chore: yarn.lock
2017-04-04 09:47:57 +02:00
Greenkeeper c25eff732d Update knex to version 0.12.9 🚀 (#8224)
* chore(package): update knex to version 0.12.9

https://greenkeeper.io/

* chore: yarn.lock
2017-04-04 09:47:09 +02:00