From 1b878ded691635ac1f1fdd5291895b8127386cc4 Mon Sep 17 00:00:00 2001 From: Ng Wei En Date: Thu, 18 Nov 2021 14:18:48 +0800 Subject: [PATCH] Update README.md and LICENSE.md --- LICENSE | 2 +- README.md | 43 +++++++++++++++++++++++++++++++------------ 2 files changed, 32 insertions(+), 13 deletions(-) diff --git a/LICENSE b/LICENSE index 366ae5f6..c67f6994 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2013-2021 Ghost Foundation +Copyright (c) 2013-2021 Ghost Foundation, 2021 Advisory Singapore Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 664e83ea..5074a768 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,28 @@ -# Dawn +# dawn-advisory-theme ![Deploy Theme](https://github.com/AdvisorySG/dawn-advisory-theme/workflows/Deploy%20Theme/badge.svg) A highly functional theme that adapts to the reader's preferences. Let them read, search, subscribe, navigate, and more with ease. Completely free and fully responsive, released under the MIT license. -**Demo: https://dawn.ghost.io** +This theme was originally based off [TryGhost/Dawn](https://github.com/TryGhost/Dawn).   # Instructions -1. [Download this theme](https://github.com/TryGhost/Dawn/archive/main.zip) -2. Log into Ghost, and go to the `Design` settings area to upload the zip file +1. [Setup a local Ghost instance](https://ghost.org/docs/install/local/). +2. Ensure you have [Node v14](https://nodejs.org/) installed. +3. From the root directory, execute the `zip` Gulp task: + +```bash +# Install dependencies +npm + +# Package the theme into a zip archive +npm run zip +``` + +4. Upload the zipfile at `dist/dawn-advisory-theme.zip` onto your local Ghost instance at `Settings > Theme > Change theme > Upload theme`. + +Optionally, if you have access to the [Admin panel of Advisory](https://beta.advisory.sg/ghost/), you can go to `Settings > Labs > Migration Options > Export your content` in order to export the posts and settings used for the actual website as a JSON file. This file can be imported into your local instance of Ghost, at `Settings > Labs > Migration Options > Import content`. Take note that this will not remove existing posts/pages. # Search @@ -62,23 +75,29 @@ The theme looks for a menu item with three dots (`...`) in its URL, and uses tha # Development -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: +Styles are compiled using Gulp/PostCSS to polyfill future CSS spec. You'll need [Node](https://nodejs.org/) and [Gulp](https://gulpjs.com) installed globally. After that, from the theme's root directory: ```bash # Install -yarn +npm # Run build & watch for changes -$ yarn dev +npm run 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/.zip`, which you can then upload to your site. +## Speedy Development -```bash -yarn zip -``` +To speed up development with a local instance of Ghost, you may use an alternative procedure to directly place the theme directory in the `content/themes/` directory of Ghost. + +Firstly, use the earlier mentioned process with `npm run zip` and upload the theme. This is important, as **Ghost will not recognise your new theme directory if you do not perform this import first**. In the `content/themes/` directory from the root directory of your Ghost installation, you should see the `dawn-advisory-theme` directory. (**Do not perform this step by importing a zipfile directly from the GitHub Actions builds; as the zipfile has an appended hash, Ghost will not recognise your new `dawn-advisory-theme` directory. Make sure to rename the zipfile to `dawn-advisory-theme.zip` before importing.**) + +Once you have verified that the `content/themes/dawn-advisory-theme/` directory is in place and Ghost recognises the directory as a theme, remove the `dawn-advisory-theme` directory and clone this repository into the `content/themes/` directory under the same directory name `dawn-advisory-theme`. (Alternatively, if you use an Unix-based system, you may create a symbolic link instead. Windows users may wish to create a shortcut from the Ghost directory instead.) + +Finally, run `npm run dev` in the `content/themes/dawn-advisory-theme/` directory and refresh the Ghost admin panel. You should see the correct theme appear. Upon making changes to theme files, `npm run dev` should build the changed files and the changes should be reflected upon refresh. + +This method is not officially supported by Ghost and might break any time (though the theme handling logic is unlikely to be modified in the foreseeable future). Take note that if you add new post templates, you may need to restart Ghost manually for the changes to take place in the Admin panel. # PostCSS Features Used @@ -86,4 +105,4 @@ yarn zip # Copyright & License -Copyright (c) 2013-2021 Ghost Foundation - Released under the [MIT license](LICENSE). +Copyright (c) 2013-2021 Ghost Foundation, 2021 Advisory Singapore - Released under the [MIT license](LICENSE).