diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index 173e12e97d..0000000000 --- a/.editorconfig +++ /dev/null @@ -1,17 +0,0 @@ -# http://editorconfig.org - -root = true - -[*] -charset = utf-8 -indent_style = space -indent_size = 4 -end_of_line = lf -insert_final_newline = true -trim_trailing_whitespace = true - -[*.hbs] -insert_final_newline = false - -[*.md] -trim_trailing_whitespace = false diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md deleted file mode 100644 index f885d40864..0000000000 --- a/.github/ISSUE_TEMPLATE.md +++ /dev/null @@ -1,19 +0,0 @@ -Do you need help or have a question? Please come chat in our forum: https://forum.ghost.org 👫. - -If you're filing a bug 🐛, please include the following information: - -### Screenshot - -![]() - -### Steps to Reproduce - - 1. This is the first step - 2. This may be the post content used to cause an issue... - -### Technical details - -* Casper Version: -* Ghost Version: -* Browser Version: -* OS Version: diff --git a/.github/workflows/deploy-theme.yml b/.github/workflows/deploy-theme.yml deleted file mode 100644 index 23bbd201cc..0000000000 --- a/.github/workflows/deploy-theme.yml +++ /dev/null @@ -1,15 +0,0 @@ -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.1 - with: - api-url: ${{ secrets.GHOST_ADMIN_API_URL }} - api-key: ${{ secrets.GHOST_ADMIN_API_KEY }} - theme-name: "casper-master" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6341f4fc60..55b77f5ba1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,15 +1,29 @@ name: Test + on: pull_request: - push: - branches: - - master - - 'renovate/*' + +permissions: + contents: read + jobs: test: + name: Test runs-on: ubuntu-latest - if: github.event_name == 'push' || (github.event_name == 'pull_request' && !startsWith(github.head_ref, 'renovate/')) + steps: - - uses: actions/checkout@v1 - - run: yarn - - run: yarn test:ci + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd + with: + persist-credentials: false + + - uses: pnpm/action-setup@ac6db6d3c1f721f886538a378a2d73e85697340a + + - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e + with: + node-version: lts/* + cache: pnpm + cache-dependency-path: pnpm-lock.yaml + + - run: pnpm install --frozen-lockfile + + - run: pnpm test:ci diff --git a/.yarnrc b/.yarnrc deleted file mode 100644 index e46d1b8dfb..0000000000 --- a/.yarnrc +++ /dev/null @@ -1,2 +0,0 @@ -version-tag-prefix "" -version-git-message "%s" diff --git a/LICENSE b/LICENSE index 2dfed062b8..d24c76dee6 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2013-2020 Ghost Foundation +Copyright (c) 2013-2026 Ghost Foundation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation diff --git a/README.md b/README.md index 1485851214..66cb4d845a 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,12 @@ # 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. +A classic theme for [Ghost](http://github.com/tryghost/ghost/), originally the default theme. These days, our default theme is [Source](http://github.com/tryghost/source/) + +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.   -![screenshot-desktop](https://user-images.githubusercontent.com/353959/66987533-40eae100-f0c1-11e9-822e-cbaf38fb8e3f.png) +![screenshot-desktop](https://user-images.githubusercontent.com/1418797/183329195-8e8f2ee5-a473-4694-a813-a2575491209e.png)   @@ -12,7 +14,7 @@ The default theme for [Ghost](http://github.com/tryghost/ghost/). This is the la Ghost uses a simple templating language called [Handlebars](http://handlebarsjs.com/) for its themes. -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. +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/themes/) which explains every possible Handlebars helper and template. **The main files are:** @@ -32,14 +34,14 @@ One neat trick is that you can also create custom one-off templates by adding th # Development -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: +Casper styles are compiled using Gulp/PostCSS to polyfill future CSS spec. You'll need [Node](https://nodejs.org/), [pnpm](https://pnpm.io/) and [Gulp](https://gulpjs.com) installed globally. After that, from the theme's root directory: ```bash # install dependencies -yarn install +pnpm install # run development server -yarn dev +pnpm dev ``` Now you can edit `/assets/css/` files, which will be compiled to `/assets/built/` automatically. @@ -48,14 +50,31 @@ The `zip` Gulp task packages the theme files into `dist/.zip`, which ```bash # create .zip file -yarn zip +pnpm zip +``` + +# Publishing a release + +Releases are shipped in two steps. First bump the version — this updates `package.json` and creates the matching commit and `v` git tag: + +```bash +# pick one of: patch | minor | major (or an explicit version, e.g. 5.13.0) +pnpm version minor ``` +Then run `ship`, which checks the working tree is clean, pushes the commit and tag, and drafts the GitHub release from the changelog: + +```bash +pnpm ship +``` + +> [!NOTE] +> `pnpm version` must be run first — unlike the old `yarn version`, `pnpm version` is not interactive and `pnpm ship` no longer performs the bump itself. + # PostCSS Features Used - Autoprefixer - Don't worry about writing browser prefixes of any kind, it's all done automatically with support for the latest 2 major versions of every browser. -- Variables - Simple pure CSS variables -- [Color Function](https://github.com/postcss/postcss-color-function) +- [Color Mod](https://github.com/jonathantneal/postcss-color-mod-function) # SVG Icons @@ -64,7 +83,10 @@ Casper uses inline SVG icons, included via Handlebars partials. You can find all You can add your own SVG icons in the same manner. +# Translations + +Please see [@TryGhost/Themes/theme-translations/README.md](https://github.com/TryGhost/Themes/blob/main/packages/theme-translations/README.md) for how to build, edit, or contribute translations. # Copyright & License -Copyright (c) 2013-2020 Ghost Foundation - Released under the [MIT license](LICENSE). +Copyright (c) 2013-2026 Ghost Foundation - Released under the [MIT license](LICENSE). diff --git a/SECURITY.md b/SECURITY.md deleted file mode 100644 index 9fa77b7339..0000000000 --- a/SECURITY.md +++ /dev/null @@ -1,9 +0,0 @@ -# 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 🙏. \ No newline at end of file diff --git a/assets/built/casper.js b/assets/built/casper.js index c45c2607ee..a01a8ea746 100644 --- a/assets/built/casper.js +++ b/assets/built/casper.js @@ -1,2 +1 @@ -!function(n){"use strict";n.fn.fitVids=function(e){var i={customSelector:null,ignore:null};if(!document.getElementById("fit-vids-style")){var t=document.head||document.getElementsByTagName("head")[0],r=document.createElement("div");r.innerHTML='

x

',t.appendChild(r.childNodes[1])}return e&&n.extend(i,e),this.each(function(){var e=['iframe[src*="player.vimeo.com"]','iframe[src*="youtube.com"]','iframe[src*="youtube-nocookie.com"]','iframe[src*="kickstarter.com"][src*="video.html"]',"object","embed"];i.customSelector&&e.push(i.customSelector);var r=".fitvidsignore";i.ignore&&(r=r+", "+i.ignore);var t=n(this).find(e.join(","));(t=(t=t.not("object object")).not(r)).each(function(){var e=n(this);if(!(0
').parent(".fluid-width-video-wrapper").css("padding-top",100*t+"%"),e.removeAttr("height").removeAttr("width")}})})},n.fn.fitVids._count=0}(window.jQuery||window.Zepto),function(e){e.addEventListener("DOMContentLoaded",function(){e.querySelectorAll(".kg-gallery-image img").forEach(function(e){var t=e.closest(".kg-gallery-image"),i=e.attributes.width.value/e.attributes.height.value;t.style.flex=i+" 1 0%"})})}((window,document)),function(t,i){var r=i.querySelector("link[rel=next]");if(r){var n=i.querySelector(".post-feed");if(n){var o=300,s=!1,a=!1,d=t.scrollY,l=t.innerHeight,c=i.documentElement.scrollHeight;t.addEventListener("scroll",f,{passive:!0}),t.addEventListener("resize",v),h()}}function u(){if(404===this.status)return t.removeEventListener("scroll",f),void t.removeEventListener("resize",v);this.response.querySelectorAll(".post-card").forEach(function(e){n.appendChild(i.importNode(e,!0))});var e=this.response.querySelector("link[rel=next]");e?r.href=e.href:(t.removeEventListener("scroll",f),t.removeEventListener("resize",v)),c=i.documentElement.scrollHeight,a=s=!1}function e(){if(!a)if(d+l<=c-o)s=!1;else{a=!0;var e=new t.XMLHttpRequest;e.responseType="document",e.addEventListener("load",u),e.open("GET",r.href),e.send(null)}}function h(){s||t.requestAnimationFrame(e),s=!0}function f(){d=t.scrollY,h()}function v(){l=t.innerHeight,c=i.documentElement.scrollHeight,h()}}(window,document),function(s,a){s.Casper||(s.Casper={}),s.Casper.stickyNavTitle=function(e){var t=a.querySelector(e.navSelector),i=a.querySelector(e.titleSelector),r=s.scrollY,n=!1;function o(){i.getBoundingClientRect().top+s.scrollY+(i.offsetHeight+35)<=r?t.classList.add(e.activeClass):t.classList.remove(e.activeClass),n=!1}s.addEventListener("scroll",function(){r=s.scrollY,function(){n||requestAnimationFrame(o);n=!0}()},{passive:!0}),o()}}(window,document); -//# sourceMappingURL=casper.js.map \ No newline at end of file +function lightbox(e){document.querySelectorAll(e).forEach(function(e){e.addEventListener("click",function(e){var t=e;t.preventDefault();for(var n,o=[],i=0,r=t.target.closest(".kg-card").previousElementSibling;r&&(r.classList.contains("kg-image-card")||r.classList.contains("kg-gallery-card"));){var a=[];r.querySelectorAll("img").forEach(function(e){a.push({src:e.getAttribute("src"),msrc:e.getAttribute("src"),w:e.getAttribute("width"),h:e.getAttribute("height"),el:e}),i+=1}),r=r.previousElementSibling,o=a.concat(o)}t.target.classList.contains("kg-image")?o.push({src:t.target.getAttribute("src"),msrc:t.target.getAttribute("src"),w:t.target.getAttribute("width"),h:t.target.getAttribute("height"),el:t.target}):(n=!1,t.target.closest(".kg-gallery-card").querySelectorAll("img").forEach(function(e){o.push({src:e.getAttribute("src"),msrc:e.getAttribute("src"),w:e.getAttribute("width"),h:e.getAttribute("height"),el:e}),n||e===t.target?n=!0:i+=1}));for(var s=t.target.closest(".kg-card").nextElementSibling;s&&(s.classList.contains("kg-image-card")||s.classList.contains("kg-gallery-card"));)s.querySelectorAll("img").forEach(function(e){o.push({src:e.getAttribute("src"),msrc:e.getAttribute("src"),w:e.getAttribute("width"),h:e.getAttribute("height"),el:e})}),s=s.nextElementSibling;e=document.querySelectorAll(".pswp")[0];new PhotoSwipe(e,PhotoSwipeUI_Default,o,{bgOpacity:.9,closeOnScroll:!0,fullscreenEl:!1,history:!1,index:i,shareEl:!1,zoomEl:!1,getThumbBoundsFn:function(e){var e=o[e].el,t=window.pageYOffset||document.documentElement.scrollTop,e=e.getBoundingClientRect();return{x:e.left,y:e.top+t,w:e.width}}}).init()})})}((e,t)=>{"function"==typeof define&&define.amd?define("ev-emitter/ev-emitter",t):"object"==typeof module&&module.exports?module.exports=t():e.EvEmitter=t()})("undefined"!=typeof window?window:this,function(){function e(){}var t=e.prototype;return t.on=function(e,t){var n;if(e&&t)return-1==(n=(n=this._events=this._events||{})[e]=n[e]||[]).indexOf(t)&&n.push(t),this},t.once=function(e,t){var n;if(e&&t)return this.on(e,t),((n=this._onceEvents=this._onceEvents||{})[e]=n[e]||{})[t]=!0,this},t.off=function(e,t){e=this._events&&this._events[e];if(e&&e.length)return-1!=(t=e.indexOf(t))&&e.splice(t,1),this},t.emitEvent=function(e,t){var n=this._events&&this._events[e];if(n&&n.length){n=n.slice(0),t=t||[];for(var o=this._onceEvents&&this._onceEvents[e],i=0;i{"function"==typeof define&&define.amd?define(["ev-emitter/ev-emitter"],function(e){return n(t,e)}):"object"==typeof module&&module.exports?module.exports=n(t,require("ev-emitter")):t.imagesLoaded=n(t,t.EvEmitter)})("undefined"!=typeof window?window:this,function(t,e){function r(e,t){for(var n in t)e[n]=t[n];return e}function a(e,t,n){var o,i;return this instanceof a?(o="string"==typeof(o=e)?document.querySelectorAll(e):o)?(this.elements=(i=o,Array.isArray(i)?i:"object"==typeof i&&"number"==typeof i.length?c.call(i):[i]),this.options=r({},this.options),"function"==typeof t?n=t:r(this.options,t),n&&this.on("always",n),this.getImages(),s&&(this.jqDeferred=new s.Deferred),void setTimeout(this.check.bind(this))):void l.error("Bad element for imagesLoaded "+(o||e)):new a(e,t,n)}function n(e){this.img=e}function o(e,t){this.url=e,this.element=t,this.img=new Image}var s=t.jQuery,l=t.console,c=Array.prototype.slice,u=((a.prototype=Object.create(e.prototype)).options={},a.prototype.getImages=function(){this.images=[],this.elements.forEach(this.addElementImages,this)},a.prototype.addElementImages=function(e){"IMG"==e.nodeName&&this.addImage(e),!0===this.options.background&&this.addElementBackgroundImages(e);var t=e.nodeType;if(t&&u[t]){for(var n=e.querySelectorAll("img"),o=0;o{"function"==typeof define&&define.amd?define(t):"object"==typeof exports?module.exports=t():e.PhotoSwipeUI_Default=t()})(this,function(){return function(o,s){function e(e){if(T)return!0;e=e||window.event,C.timeToIdle&&C.mouseUsed&&!y&&a();for(var t,n,o=(e.target||e.srcElement).getAttribute("class")||"",i=0;i