generated from TryGhost/Starter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit e75b866
Showing
44 changed files
with
8,545 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: Deploy Theme | ||
on: | ||
push: | ||
branches: | ||
- main | ||
jobs: | ||
deploy: | ||
runs-on: ubuntu-18.04 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: Borales/actions-yarn@v3 | ||
with: | ||
cmd: install | ||
- run: yarn install | ||
- run: yarn test:ci | ||
- run: yarn ship | ||
- name: Deploy Ghost Theme | ||
uses: TryGhost/[email protected] | ||
with: | ||
api-url: ${{ secrets.GHOST_ADMIN_API_URL }} | ||
api-key: ${{ secrets.GHOST_ADMIN_API_KEY }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: Test | ||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
- 'renovate/*' | ||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
if: github.event_name == 'push' || (github.event_name == 'pull_request' && !startsWith(github.head_ref, 'renovate/')) | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- run: yarn | ||
- run: yarn test:ci |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
b-cov | ||
*.seed | ||
*.log | ||
*.csv | ||
*.dat | ||
*.out | ||
*.pid | ||
*.gz | ||
|
||
pids | ||
logs | ||
results | ||
|
||
npm-debug.log | ||
node_modules | ||
package-lock.json | ||
|
||
.idea/* | ||
*.iml | ||
projectFilesBackup | ||
|
||
.DS_Store | ||
|
||
dist/ | ||
built/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
Copyright (c) 2013-2022 Ghost Foundation | ||
|
||
Permission is hereby granted, free of charge, to any person | ||
obtaining a copy of this software and associated documentation | ||
files (the "Software"), to deal in the Software without | ||
restriction, including without limitation the rights to use, | ||
copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the | ||
Software is furnished to do so, subject to the following | ||
conditions: | ||
|
||
The above copyright notice and this permission notice shall be | ||
included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES | ||
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT | ||
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, | ||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | ||
OTHER DEALINGS IN THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# Ghost Starter Theme | ||
|
||
A starter framework for Ghost themes! Fork this repository and start your development here with all the main things you need to develop a custom Ghost theme. | ||
|
||
| ||
|
||
# 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. | ||
|
||
**The main files are:** | ||
|
||
- `default.hbs` - The main template file | ||
- `index.hbs` - Used for the home page | ||
- `post.hbs` - Used for individual posts | ||
- `page.hbs` - Used for individual pages | ||
- `tag.hbs` - Used for tag archives | ||
- `author.hbs` - Used for author archives | ||
|
||
One 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: | ||
|
||
- `page-about.hbs` - Custom template for the `/about/` page | ||
- `tag-news.hbs` - Custom template for `/tag/news/` archive | ||
- `author-ali.hbs` - Custom template for `/author/ali/` archive | ||
|
||
| ||
|
||
# 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: | ||
|
||
```bash | ||
# Install | ||
yarn | ||
|
||
# Run build & watch for changes | ||
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 | ||
``` | ||
|
||
| ||
|
||
# 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. | ||
- [Color Mod](https://github.com/jonathantneal/postcss-color-mod-function) | ||
|
||
| ||
|
||
# Copyright & License | ||
|
||
Copyright (c) 2013-2022 Ghost Foundation - Released under the [MIT license](LICENSE). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
/* Buttons | ||
/* ---------------------------------------------------------- */ | ||
|
||
.gh-button { | ||
display: inline-block; | ||
min-width: 75px; | ||
height: var(--height); | ||
padding: 0 2rem; | ||
border: 0; | ||
border-radius: var(--radius); | ||
cursor: pointer; | ||
font-family: var(--font-sans-serif); | ||
font-size: 1.4rem; | ||
font-weight: var(--font-normal); | ||
line-height: var(--height); | ||
text-align: center; | ||
text-decoration: none; | ||
white-space: nowrap; | ||
appearance: none; | ||
transition: 0.4s ease; | ||
} | ||
|
||
.gh-button.gh-button-fit { | ||
width: 100%; | ||
} | ||
|
||
.gh-button.gh-button-small { | ||
height: calc(var(--height) * 0.9); | ||
line-height: calc(var(--height) * 0.9); | ||
padding: 0 1.5rem; | ||
font-size: 1.2rem; | ||
} | ||
|
||
.gh-button.gh-button-large { | ||
height: calc(var(--height) * 1.2); | ||
line-height: calc(var(--height) * 1.2); | ||
padding: 0 2.5rem; | ||
font-size: 1.7rem; | ||
} | ||
|
||
.gh-button.gh-button-disabled, | ||
.gh-button:disabled { | ||
pointer-events: none; | ||
opacity: 0.4; | ||
} | ||
|
||
.gh-button { | ||
color: var(--color-primary) !important; | ||
background-color: transparent; | ||
box-shadow: inset 0 0 0 2px var(--color-primary); | ||
} | ||
|
||
.gh-button:hover { | ||
text-decoration: none; | ||
color: var(--color-primary) !important; | ||
box-shadow: inset 0 0 0 2px var(--color-primary); | ||
transition: 0.2s ease; | ||
} | ||
|
||
.gh-button.gh-button-primary { | ||
color: #fff !important; | ||
background-color: var(--color-primary); | ||
box-shadow: none; | ||
} | ||
|
||
.gh-button.gh-button-primary:hover { | ||
background-color: var(--color-primary); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
/* Forms | ||
/* ---------------------------------------------------------- */ | ||
|
||
.gh-input, | ||
.gh-textarea { | ||
background: var(--color-bg); | ||
border-radius: var(--radius); | ||
border: none; | ||
border: solid 1px var(--color-border); | ||
color: inherit; | ||
display: block; | ||
outline: 0; | ||
padding: 0 0.6em; | ||
text-decoration: none; | ||
width: 100%; | ||
} | ||
|
||
.gh-input:focus { | ||
border-color: var(--color-primary); | ||
} | ||
|
||
.gh-select { | ||
height: var(--height); | ||
padding-right: var(--height); | ||
text-overflow: ellipsis; | ||
} | ||
|
||
.gh-select option { | ||
color: var(--color-primary); | ||
background: var(--color-bg); | ||
} | ||
|
||
.gh-select:focus::-ms-value { | ||
background-color: transparent; | ||
} | ||
|
||
.gh-select::-ms-expand { | ||
display: none; | ||
} | ||
|
||
.gh-input, | ||
.gh-select { | ||
height: var(--height); | ||
} | ||
|
||
.gh-textarea { | ||
padding: 0.3em 0.6em; | ||
resize: vertical; | ||
} | ||
|
||
.gh-check { | ||
display: block; | ||
margin-right: -2em; | ||
opacity: 0; | ||
width: 1em; | ||
z-index: -1; | ||
} | ||
|
||
.gh-check + label, | ||
.gh-check + label { | ||
display: flex; | ||
align-items: center; | ||
color: var(--color-base); | ||
cursor: pointer; | ||
font-size: 1em; | ||
font-weight: var(--font-normal); | ||
padding-left: calc((var(--height) * 0.6) + 0.75em); | ||
padding-right: 2rem; | ||
position: relative; | ||
user-select: none; | ||
} | ||
|
||
.gh-check + label:before, | ||
.gh-check + label:before { | ||
background: var(--color-bg); | ||
border-radius: var(--radius); | ||
border: solid 1px var(--color-border); | ||
content: ''; | ||
display: inline-block; | ||
height: calc(var(--height) * 0.6); | ||
line-height: calc(var(--height) * 0.56); | ||
text-align: center; | ||
width: calc(var(--height) * 0.6); | ||
margin-right: 1rem; | ||
} | ||
|
||
.gh-check:checked + label:before, | ||
.gh-check:checked + label:before { | ||
background: var(--color-primary); | ||
border-color: var(--color-primary); | ||
color: var(--color-bg); | ||
content: '✓'; | ||
} | ||
|
||
.gh-check:focus + label:before, | ||
.gh-check:focus + label:before { | ||
border-color: var(--color-primary); | ||
box-shadow: 0 0 0 1px var(--color-primary); | ||
} | ||
|
||
|
||
.gh-check + label:before { | ||
border-radius: var(--radius); | ||
} | ||
|
||
.gh-check + label:before { | ||
border-radius: 100%; | ||
} |
Oops, something went wrong.