Skip to content

Commit

Permalink
Update to Ghost 3.0 (#2)
Browse files Browse the repository at this point in the history
* Fixed incorrect image aspect ratio when images have width/height attrs

no issue
- when large images have width/height attributes but the image is constrained to it's container or `max-width` style the aspect ratio would be broken because browsers use the `height` attribute value even though the width is smaller

* Rebuild CSS

* ✨Added Koenig gallery card support (TryGhost#475)

no issue

- Update CSS and JS for new gallery card
- Updates CSS to support new gallery card
- Adds JS to support grid layout for gallery view
- Fix gallery breakout size
- Refining styles for gallery card

* Upgrading Casper to 2.6.0

* Restructure spacings for generic figure element

* Upgrading Casper to 2.6.1

* 🐛 Fixed word-wrap for extra long anchor links text (TryGhost#478)

refs TryGhost#466

Anchor links didn't break, when the text was too long. Using `word-break: break-all` specifically on a-tags in post-content fixes this without screwing up other tags and their breaks.

* Upgrading Casper to 2.6.2

* Adjusting spaces for galleries and wide images in a sequence (TryGhost#480)

* Upgrading Casper to 2.6.3

* [Fix] Inline <code> tag word-break inside a <p> tag (TryGhost#483)

* Remove css rule that stops syntax highlighting  (TryGhost#484)

* Remove suspect css rule

Removed the ".post-full-content pre code * { color: inherit }" rule which prevents highlight.js from working.

* Changed to just exclude span

Less disruptive to just remove span from color inheritance.

* Remove extra newline

* Link to required dependencies

Refs TryGhost#468

* Minified javascript in zip(TryGhost#476)

no issue

* Added js minification step to gulp zip script

* Upgrading Casper to 2.6.4

* Add titles to icon links

* Minified js (TryGhost#485)

no issue

- Added a `js` task to run on the gulp build process and minifies our js files
- Changed the required scripts in `default.hbs` to use the minified js files in `/built/`
- Moved existing `js` tasks from `zip` task

* Remove double slash in link

no issue

* Upgrading Casper to 2.7.0

* 🎨 Optimised infinite scroll (TryGhost#503)

no issue
- removed jQuery usage
- use the `<link rel="next">` tag provided by Ghost to determine the next page to fetch

* Upgrading Casper to 2.7.1

no issue

* Responsive images (TryGhost#505)

* Upgrading Casper to 2.8.0

* 2019

* Upgrading Casper to 2.8.1

* Bumped default Ghost API version to v2

no issue

- This change is due to Content API becoming stable https://github.com/TryGhost/Ghost/releases/tag/2.10.0

* Migrated from @blog -> @site

no issue

- This rename is due to new {{@site}} alias introduced in Ghost (TryGhost/Ghost@dd1cf5f) as {{@blog}} variable is deprecated now, and will be removed in v3

* Update no-image classes

Closes TryGhost#513

* Upgrading Casper to 2.9.0

* Use a larger logo size (TryGhost#520)

* Updated gulp to handle errors for every stream (TryGhost#500)

no-issue

Previously we only added an error handler to the first stream in each
pipeline, this meant that if another stream errors you would get
unhelpful error handlers.

* Added missing closing brackets in partials/header.hbs styles (TryGhost#521)

* Upgrading Casper to 2.9.1

* Updated .travis.yml to use Node v10

no issue

- see TryGhost/Ghost@99c3338#diff-354f30a63fb0907d4ad57269548329e3
- see https://docs.ghost.org/faq/node-versions/

* Added "yarn ship" command

no issue

- @todo: add the ability to draft a release when running `yarn ship`

* Upgrading Casper to 2.9.2

* Fix bug with embeds overflowing content width

* v2.9.3

* Add renovate.json

* Update renovate.json

* Pin dependencies

* Update renovate.json

- group CSS dependencies together

* 🐛 Fixed author cover images not displaying

closes TryGhost#542
- user model has `cover_image` property rather than `feature_image`

* Update Renovate Configuration

- make PR names make more sense

* Update dependency gscan to v2.2.1

* Update gulp

* Update css processors

* Update css processors

* Update gulp

* Re-written gulpfile for gulp 4

- use the new, simpler format
- sourcemap and watch support is built in, so these plugins can be removed
- remove js filter - not sure what that did :/
- simplified task structure

* Updated all built assets

- many dependencies have changed, need to rebuild

* 🛠 Always build before test, test before ship

- Make sure we update our build files before running tests
- This also ensures they get updated before shipping

* Update dependency gscan to v2.3.0

* Regenerate yarn.lock

- results in clean lodash versions
- needed due to lodash security vuln

* Update Renovate Configuration

- schedule renovate for early monday mornings

* Upgrading Casper to 2.9.4

* 🐛 Fixed incorrect/missing colours for various elements

closes TryGhost#548
- the recent postcss upgrade resulted in real CSS variables being output with a fallback mechanism, unfortunately this broke a number of colors throughout the theme
- disabled the fallback mechanism to revert back to the previous behaviour

* v2.9.5

* Gulpfile ES6

no issue

- ES6

* Extended `yarn ship`: more automation

no issue

- added gulp task to extend casper release automation
- will draft the release for you
- will get the user facing commits from changelog
- runs after `yarn ship` (postship)
- full automation with env variables is possible

* Added .yarnrc

no issue

- Casper uses `%s` tag naming
- Let's keep this, otherwise release order is broken
- Ghost & Ghost-Admin use this notation too
- It will tell `yarn version` to use `%s` instead of `v%s`

* Update dependency autoprefixer to v9.5.0 (TryGhost#553)

* Update dependency @tryghost/release-utils to v0.3.1

* 2.9.6

* Fixed deprecated {{lang}} helper usage

no issue

- {{lang}} helper was deprecated in favor of {{@site.lang}} with TryGhost/gscan@73e0082

* 2.9.7

* Update Renovate Configuration


Updates the base configuration to include:
- node support policy
- lockfile maintenance
- optimistic automerging

* Added SECURITY.md file

- Consistent with other public repos
- Points at our docs on how to report security issues

* Updated .travis.yml file

- ran slimer fix travis to get latest settings

* 2.9.8

* Update css processors

* Update dependency gscan to v2.4.0

* Update dependency @tryghost/release-utils to v0.3.2

* Lock file maintenance

* 2.9.9

* Update dependency gscan to v2.4.1

* Lock file maintenance

* Added livereload for .hbs files

* 2.9.10

* Updated .travis.yml file

- most up-to-date version of our config

* Update Renovate Configuration

- Use the new shared configuration
- This is a special config for themes which is scheduled monthly, not weekly.

* Updated travis.yml file

* 2.9.11

* Update dependency gscan to v2.5.1

* Update dependency gulp to v4.0.1

* Re-build CSS using latest dependencies (TryGhost#573)

no issue

- CSS preprocessor dependencies have been updated, this re-builds the CSS to match the latest processed output
  - the primary change is the addition of the `::-moz-selection` vendor prefix

* Lock file maintenance (TryGhost#572)

* ✨ Added support for code cards with captions (TryGhost#575)

refs TryGhost/Ghost#10719

- adds styling for `.kg-code-card` so that code blocks are styled the same no matter if they are top-level or inside of a `<figure>` element

* 2.10.0

* Substituted deprecated {{each}} helper with recommended {{foreach}}

refs TryGhost/gscan#123

- As documentation says (https://docs.ghost.org/api/handlebars-themes/helpers/foreach/)  {{foreach}} should always be used instead of native {{each}} helper
- Deprecation warning was implemented in gscan and  will prompt when uploading the theme

* 2.10.1

* Update dependency gscan to v2.6.0

* Update dependency gulp to v4.0.2

* 2.10.2

* Update dependency gscan to v2.6.2

* Update dependency autoprefixer to v9.6.0

* 2.10.3

* Updated links to docs site

* 2.10.4

* 🔗 Updated docs link to be version-less

* Better contrast for selected text inside `pre code` blocks

* 2.10.5

* Update CSS preprocessors

* Update dependency gscan to v2.7.0

* 2.10.6

* Improve gulp globbing (TryGhost#598)

* Remove unused conditional

Closes TryGhost#593

* 2.10.7

* ✨ Added bookmark card CSS (TryGhost#607)

refs TryGhost/Admin@9bfd340 and TryGhost/Ghost@c2aa620

Adds css for styling new bookmark card which generates following html -
  ```html
  <figure class="kg-card kg-bookmark-card">
    <a href="[URL]" class="kg-bookmark-container">
      <div class="kg-bookmark-content">
        <div class="kg-bookmark-title">[TITLE]</div>
        <div class="kg-bookmark-description">[DESCRIPTION]</div>
        <div class="kg-bookmark-metadata">
          <img src="[ICON]" class="kg-bookmark-icon">
          <span class="kg-bookmark-author">[AUTHOR]</span>
          <span class="kg-bookmark-publisher">[PUBLISHER]</span>
        </div>
      </div>
      <div class="kg-bookmark-thumbnail">
        <img src="[THUMBNAIL]">
      </div>
    </a>
  </figure>
  ```

* 2.11.0

* Added max length for bookmark card publisher field (TryGhost#608)

no issue

- fixed style for bookmark cards with too long publisher field

* 2.11.1

* Update dependency gscan to v2.9.0

* Update dependency gulp-livereload to v4.0.2

* 2.11.2

* Added deploy ghost theme github action

- see https://github.com/marketplace/actions/deploy-ghost-theme
- use the new deploy theme github action to automatically deploy master to a test site

* Automatically deploy theme on master only

- switch from all branches to master only

* Updated current version and previous version logic (TryGhost#554)

no issue

- Use current version from `package.json` instead of `npm_package_version` env variable
- Use `release.tag_name` instead of `release.name` for previous version

* Updated jQuery to 3.4.1 to avoid known vulnerabilities (TryGhost#590)

no issue

https://snyk.io/vuln/npm:jquery?lh=3.2.1&utm_source=lighthouse&utm_medium=ref&utm_campaign=audit

* Fixed code cards with long lines from being too wide

no issue

Credit to https://github.com/mvasilkov for the fix -  TryGhost#602

* Bumped Gscan and made rule check explicit to v2 set (TryGhost#622)

* Bumped gscan to v3.0.0

* Added explicit v2 version check for gscan command

* Update dependency postcss-custom-properties to v9 (TryGhost#592)

* Updated Build Tools (TryGhost#571)

* Concatenated all JS into a single file (TryGhost#624)

no issue

- moved large inline JS from templates into separate JS files
  - floating header
  - gallery card support
- use `gulp-concat` to concatenate all JS files into a single `built/casper.js` file
- reduces external JS file requests from 3 (jquery, infinite-scroll.js, jquery.fitvids.js) down to 2 (jquery, casper.js) and reduces page size by removing repeated inline code

* Fixed deprecated autoprefixer config warning when running build tasks

no issue

Passing browser options directly into `autoprefixer()` has been deprecated in favour of general browserslist configuration in `package.json` or a `.browserslistrc` config file

- moved autoprefixer browsers list into `browserslist` config in `package.json`
- updated `autoprefixer` version

* V3 (TryGhost#626)

* Changed {{code}} to {{statusCode}}

refs TryGhost/gscan@2ebd9fe

- {{code}} use has been deprecated in canary rule set of gscan

* V3 Update

* Update package and readme for 3.0

* Improve install instructions

* Update to support browserlist

* Upgrade dependencies

* Fix misnamed property

* V3 darkmode (TryGhost#619)

Added dark mode styles

* Casper final  refinements batch 1

* Casper final  refinements batch 2

* Fixed bookmark card hover bug

* Fixed header social links

* Updated screenshots

* Updated readme

no issue

- refreshed screenshot

* Udpate screenshot in readme

no issue

* 3.0.0-beta.2

* Fixed cut header for post cards

no issue

* 3.0.0-beta.3

* 3.0.0-beta.4

* Updated current version and previous version logic (TryGhost#554)

no issue

- Use current version from `package.json` instead of `npm_package_version` env variable
- Use `release.tag_name` instead of `release.name` for previous version

* Updated jQuery to 3.4.1 to avoid known vulnerabilities (TryGhost#590)

no issue

https://snyk.io/vuln/npm:jquery?lh=3.2.1&utm_source=lighthouse&utm_medium=ref&utm_campaign=audit

* Fixed code cards with long lines from being too wide

no issue

Credits - TryGhost#602

* Bumped gscan version to v3.0.0 (TryGhost#621)

* Bumped gscan to v3.0.0

- This also fixes failing CI builds because the default rules that are being checked were for v2

* Added explicit version check for gscan command

* Added member subscription support (TryGhost#623)

* Added member subscription support

no issue

* Added member subscription success message

no issue

* Added member subscription overlay

* Refined members subscription overlay

* Deleted unused website icon

* Ran CSSComb

* Updated built assets

* 3.0.0-beta.5

* Updated built assets for v3

no issue

* 3.0.0-beta.6

* Remove unused partial

* V3 cleanup (TryGhost#625)

* Removed unused infinity icon

* Removed unused location icon

* Removed unused 'point' icon

* Removed unused Ghost logo icon

* Removed unused author partials

* Cleaned up index log

* Fixed responsive feature image sizes for page template

* 3.0.0-beta.7

* Fixed duplicate browserslist config (TryGhost#628)

no issue

- removes duplicate `browserslist` key from `package.json`

* Updated built CSS (TryGhost#627)

no issue

- ran `gulp` to rebuild the CSS after the v3 merge

* Fixed sticky title and author hover JS (TryGhost#629)

no issue

- replaces author hover JS that was lost during merge
- replaces `floating-header.js` with `sticky-nav-title.js` containing the relevant JS that was lost during merge with a cleanup for unused variables and unnecessary event listeners
- removes reference to non-existent `{{> floating-header}}` partial

* 3.0.0-beta.8

* Update deploy-theme.yml

- bump action version
- add a custom theme name

* 3.0.0

* Update package.json
  • Loading branch information
QzSG committed Oct 24, 2019
1 parent 49b2912 commit 32a3c9e
Show file tree
Hide file tree
Showing 50 changed files with 5,451 additions and 4,049 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/deploy-theme.yml
@@ -0,0 +1,15 @@
name: Deploy Theme
on:
push:
branches:
- master
jobs:
deploy:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@master
- uses: TryGhost/action-deploy-theme@v1.2.0
with:
api-url: ${{ secrets.GHOST_ADMIN_API_URL }}
api-key: ${{ secrets.GHOST_ADMIN_API_KEY }}
theme-name: "casper-master"
4 changes: 4 additions & 0 deletions .gitignore
Expand Up @@ -22,3 +22,7 @@ projectFilesBackup
.DS_Store

dist/

config.json
changelog.md
changelog.md.bk
9 changes: 7 additions & 2 deletions .travis.yml
@@ -1,6 +1,11 @@
dist: xenial
language: node_js
sudo: false
node_js:
- "8"
- 10

cache: yarn

# Don't run builds for renovate PRs
if: NOT head_branch =~ ^renovate


2 changes: 2 additions & 0 deletions .yarnrc
@@ -0,0 +1,2 @@
version-tag-prefix ""
version-git-message "%s"
2 changes: 1 addition & 1 deletion LICENSE
@@ -1,4 +1,4 @@
Copyright (c) 2013-2018 Ghost Foundation
Copyright (c) 2013-2019 Ghost Foundation

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
Expand Down
34 changes: 19 additions & 15 deletions README.md
@@ -1,50 +1,54 @@
# Casper

The default theme for [Ghost](http://github.com/tryghost/ghost/). This is the latest development version of Casper. If you're just looking to download the latest release, head over to the [releases](https://github.com/TryGhost/Casper/releases) page.
The default theme for [Ghost](http://github.com/tryghost/ghost/). This is the latest development version of Casper! If you're just looking to download the latest release, head over to the [releases](https://github.com/TryGhost/Casper/releases) page.

&nbsp;

![screenshot-desktop](https://user-images.githubusercontent.com/120485/27221326-1e31d326-5280-11e7-866d-82d550a7683b.jpg)
![screenshot-desktop](https://user-images.githubusercontent.com/353959/66987533-40eae100-f0c1-11e9-822e-cbaf38fb8e3f.png)

&nbsp;

# First time using a Ghost theme?

Ghost uses a simple templating language called [Handlebars](http://handlebarsjs.com/) for its themes.

We've documented our default theme pretty heavily so that it should be fairly easy to work out what's going on just by reading the code and the comments. Once you feel comfortable with how everything works, we also have full [theme API documentation](https://themes.ghost.org) which explains every possible Handlebars helper and template.
This theme has lots of code comments to help explain what's going on just by reading the code. Once you feel comfortable with how everything works, we also have full [theme API documentation](https://ghost.org/docs/api/handlebars-themes/) which explains every possible Handlebars helper and template.

**The main files are:**

- `default.hbs` - The main template file
- `index.hbs` - Used for the home page
- `post.hbs` - Used for individual posts
- `default.hbs` - The parent template file, which includes your global header/footer
- `index.hbs` - The main template to generate a list of posts, usually the home page
- `post.hbs` - The template used to render individual posts
- `page.hbs` - Used for individual pages
- `tag.hbs` - Used for tag archives
- `author.hbs` - Used for author archives
- `tag.hbs` - Used for tag archives, eg. "all posts tagged with `news`"
- `author.hbs` - Used for author archives, eg. "all posts written by Jamie"

One really neat trick is that you can also create custom one-off templates just by adding the slug of a page to a template file. For example:
One neat trick is that you can also create custom one-off templates by adding the slug of a page to a template file. For example:

- `page-about.hbs` - Custom template for the `/about/` page
- `page-about.hbs` - Custom template for an `/about/` page
- `tag-news.hbs` - Custom template for `/tag/news/` archive
- `author-ali.hbs` - Custom template for `/author/ali/` archive


# Development

Casper styles are compiled using Gulp/PostCSS to polyfill future CSS spec. You'll need Node and Gulp installed globally. After that, from the theme's root directory:
Casper styles are compiled using Gulp/PostCSS to polyfill future CSS spec. You'll need [Node](https://nodejs.org/), [Yarn](https://yarnpkg.com/) and [Gulp](https://gulpjs.com) installed globally. After that, from the theme's root directory:

```bash
$ yarn install
$ yarn dev
# install dependencies
yarn install

# run development server
yarn dev
```

Now you can edit `/assets/css/` files, which will be compiled to `/assets/built/` automatically.

The `zip` Gulp task packages the theme files into `dist/<theme-name>.zip`, which you can then upload to your site.

```bash
$ yarn zip
# create .zip file
yarn zip
```

# PostCSS Features Used
Expand All @@ -63,4 +67,4 @@ You can add your own SVG icons in the same manner.

# Copyright & License

Copyright (c) 2013-2018 Ghost Foundation - Released under the [MIT license](LICENSE).
Copyright (c) 2013-2019 Ghost Foundation - Released under the [MIT license](LICENSE).
9 changes: 9 additions & 0 deletions SECURITY.md
@@ -0,0 +1,9 @@
# Reporting Security Vulnerabilities

Potential security vulnerabilities can be reported directly us at `security@ghost.org`. The Ghost Security Team communicates privately and works in a secured, isolated repository for tracking, testing, and resolving security-related issues.

The full, up-to-date details of our security policy and procedure can always be found in our documentation:

https://ghost.org/docs/concepts/security/

Please refer to this before emailing us. Thanks for helping make Ghost safe for everyone 🙏.
2 changes: 2 additions & 0 deletions assets/built/casper.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 32a3c9e

Please sign in to comment.