From 5b9fa7e7e0d017d8607262b705317da3fc8f462e Mon Sep 17 00:00:00 2001 From: Ahmad Ajmi Date: Wed, 6 Sep 2023 20:27:17 +0400 Subject: [PATCH] Init --- .editorconfig | 10 +++++ .github/workflows/deploy-theme.yml | 16 ++++++++ .gitignore | 3 ++ README.md | 1 + assets/css/style.css | 65 ++++++++++++++++++++++++++++++ author.hbs | 23 +++++++++++ default.hbs | 17 ++++++++ error.hbs | 6 +++ index.hbs | 14 +++++++ locales/en.json | 3 ++ package.json | 22 ++++++++++ page.hbs | 11 +++++ partials/loop.hbs | 7 ++++ partials/navigation.hbs | 3 ++ partials/page-header.hbs | 13 ++++++ partials/social-links.hbs | 15 +++++++ partials/structure/footer.hbs | 16 ++++++++ partials/structure/head.hbs | 9 +++++ partials/structure/header.hbs | 5 +++ post.hbs | 20 +++++++++ routes.yaml | 8 ++++ tag.hbs | 17 ++++++++ 22 files changed, 304 insertions(+) create mode 100644 .editorconfig create mode 100644 .github/workflows/deploy-theme.yml create mode 100644 .gitignore create mode 100644 README.md create mode 100644 assets/css/style.css create mode 100644 author.hbs create mode 100644 default.hbs create mode 100644 error.hbs create mode 100644 index.hbs create mode 100644 locales/en.json create mode 100644 package.json create mode 100644 page.hbs create mode 100644 partials/loop.hbs create mode 100644 partials/navigation.hbs create mode 100644 partials/page-header.hbs create mode 100644 partials/social-links.hbs create mode 100644 partials/structure/footer.hbs create mode 100644 partials/structure/head.hbs create mode 100644 partials/structure/header.hbs create mode 100644 post.hbs create mode 100644 routes.yaml create mode 100644 tag.hbs diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..82520fe --- /dev/null +++ b/.editorconfig @@ -0,0 +1,10 @@ +# editorconfig.org +root = true + +[*] +indent_style = space +indent_size = 2 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = false \ No newline at end of file diff --git a/.github/workflows/deploy-theme.yml b/.github/workflows/deploy-theme.yml new file mode 100644 index 0000000..68a356f --- /dev/null +++ b/.github/workflows/deploy-theme.yml @@ -0,0 +1,16 @@ +name: Plain Theme Deploy +on: + push: + branches: + - master + - main +jobs: + deploy: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + - name: Deploy to Plain Demo + uses: TryGhost/action-deploy-theme@v1.6.4 + with: + api-url: ${{ secrets.GHOST_ADMIN_API_URL }} + api-key: ${{ secrets.GHOST_ADMIN_API_KEY }} \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3081d21 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +.DS_Store +node_modules +bower_components \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..d96d63d --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +### Plain — Ghost Theme \ No newline at end of file diff --git a/assets/css/style.css b/assets/css/style.css new file mode 100644 index 0000000..efd4e1b --- /dev/null +++ b/assets/css/style.css @@ -0,0 +1,65 @@ +:root { + --font-size: 18px; + --line-height: 1.6; + --line-height-headings: 1.2; + --body-width: 650px; +} + +body { + margin: 32px auto; + padding: 0 16px; + font-size: var(--font-size); + line-height: var(--line-height); + max-width: var(--body-width); +} + +h1, +h2, +h3 { + line-height: var(--line-height-headings); +} + +nav ul { + display: flex; + gap: 16px; + padding: 0; + list-style: none; +} + +/* + Cards +*/ + +.kg-card { + margin: 0; +} + +/* Responsive embeds (Video) */ + +.kg-embed-card { + width: 100%; + display: flex; + align-items: center; + flex-direction: column; +} + +.kg-embed-card iframe { + width: 100%; + height: 100%; + aspect-ratio: 16 / 9; +} + +/* kg-image */ + +.kg-image { + max-width: 100%; + height: auto; +} + +.kg-width-wide { + width: calc(100vw - calc(var(--body-width))); +} + +.kg-width-full { + width: 100vw; +} \ No newline at end of file diff --git a/author.hbs b/author.hbs new file mode 100644 index 0000000..a76342e --- /dev/null +++ b/author.hbs @@ -0,0 +1,23 @@ +{{!< default}} + +{{#author}} +
+

{{ name }}

+ + {{#if twitter}} + Twitter + {{/if}} + + {{#if facebook}} + Facebook + {{/if}} + + {{#if bio}} +

{{ bio }}

+ {{/if}} +
+{{/author}} + +{{> loop }} + +{{ pagination }} \ No newline at end of file diff --git a/default.hbs b/default.hbs new file mode 100644 index 0000000..bcec8f7 --- /dev/null +++ b/default.hbs @@ -0,0 +1,17 @@ + + + + {{> structure/head }} + + + {{> structure/header }} + +
+ {{{ body }}} +
+ + {{> structure/footer }} + + {{ ghost_foot }} + + \ No newline at end of file diff --git a/error.hbs b/error.hbs new file mode 100644 index 0000000..f180723 --- /dev/null +++ b/error.hbs @@ -0,0 +1,6 @@ +{{!< default}} + +
+

404

+

{{t 'Page Not Found' }}

+
\ No newline at end of file diff --git a/index.hbs b/index.hbs new file mode 100644 index 0000000..dccd351 --- /dev/null +++ b/index.hbs @@ -0,0 +1,14 @@ +{{!< default}} + +{{#if @site.description}} +

{{ @site.description }}

+{{/if}} + +

{{t 'Posts' }}

+ +{{> loop }} + +{{#if next}} +
+ {{ pagination }} +{{/if}} \ No newline at end of file diff --git a/locales/en.json b/locales/en.json new file mode 100644 index 0000000..f5f6f04 --- /dev/null +++ b/locales/en.json @@ -0,0 +1,3 @@ +{ + "Published with {ghostLink} & {themeLink}": "Published with {ghostLink} & {themeLink}" +} \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 0000000..4f9172e --- /dev/null +++ b/package.json @@ -0,0 +1,22 @@ +{ + "name": "plain", + "description": "Ghost CMS Theme", + "demo": "https://plain.aspirethemes.com/", + "version": "1.0.0", + "engines": { + "ghost": ">=5.0.0" + }, + "keywords": [ + "ghost-theme" + ], + "author": { + "name": "Aspire Themes", + "email": "ahmad@aspirethemes.com", + "url": "https://aspirethemes.com/" + }, + "config": { + "custom": {}, + "card_assets": true, + "posts_per_page": 15 + } +} \ No newline at end of file diff --git a/page.hbs b/page.hbs new file mode 100644 index 0000000..12065ef --- /dev/null +++ b/page.hbs @@ -0,0 +1,11 @@ +{{!< default}} + +{{#post}} + {{#match @page.show_title_and_feature_image}} + {{> page-header }} + {{/match}} + +
+ {{ content }} +
+{{/post}} \ No newline at end of file diff --git a/partials/loop.hbs b/partials/loop.hbs new file mode 100644 index 0000000..b6a6c5c --- /dev/null +++ b/partials/loop.hbs @@ -0,0 +1,7 @@ +{{#foreach posts}} +
+ {{ title }} + + +
+{{/foreach}} \ No newline at end of file diff --git a/partials/navigation.hbs b/partials/navigation.hbs new file mode 100644 index 0000000..7eaf994 --- /dev/null +++ b/partials/navigation.hbs @@ -0,0 +1,3 @@ +{{#foreach navigation}} +
  • {{ label }}
  • +{{/foreach}} \ No newline at end of file diff --git a/partials/page-header.hbs b/partials/page-header.hbs new file mode 100644 index 0000000..e81a439 --- /dev/null +++ b/partials/page-header.hbs @@ -0,0 +1,13 @@ +{{!-- + Used in the post.hbs & page.hbs file +--}} + +
    +

    {{ title }}

    + + {{#if custom_excerpt}} +

    {{ custom_excerpt }}

    + {{/if}} + + +
    \ No newline at end of file diff --git a/partials/social-links.hbs b/partials/social-links.hbs new file mode 100644 index 0000000..2f2aa62 --- /dev/null +++ b/partials/social-links.hbs @@ -0,0 +1,15 @@ + \ No newline at end of file diff --git a/partials/structure/footer.hbs b/partials/structure/footer.hbs new file mode 100644 index 0000000..0c7fb31 --- /dev/null +++ b/partials/structure/footer.hbs @@ -0,0 +1,16 @@ + \ No newline at end of file diff --git a/partials/structure/head.hbs b/partials/structure/head.hbs new file mode 100644 index 0000000..e0b0922 --- /dev/null +++ b/partials/structure/head.hbs @@ -0,0 +1,9 @@ + + + {{ meta_title }} + + + + + {{ ghost_head }} + \ No newline at end of file diff --git a/partials/structure/header.hbs b/partials/structure/header.hbs new file mode 100644 index 0000000..e949a0b --- /dev/null +++ b/partials/structure/header.hbs @@ -0,0 +1,5 @@ +
    + +
    \ No newline at end of file diff --git a/post.hbs b/post.hbs new file mode 100644 index 0000000..8f7bea5 --- /dev/null +++ b/post.hbs @@ -0,0 +1,20 @@ +{{!< default}} + +{{#post}} + {{> page-header }} + +
    + +
    + {{ content }} +
    + + {{comments title="Join the club" + count=false + mode="auto" + saturation=80}} + + {{#if tags}} + {{ tags separator=', ' }} + {{/if}} +{{/post}} \ No newline at end of file diff --git a/routes.yaml b/routes.yaml new file mode 100644 index 0000000..9b991b3 --- /dev/null +++ b/routes.yaml @@ -0,0 +1,8 @@ +collections: + /: + permalink: /{slug}/ + template: index + +taxonomies: + tag: /tag/{slug}/ + author: /author/{slug}/ \ No newline at end of file diff --git a/tag.hbs b/tag.hbs new file mode 100644 index 0000000..f2e6d7b --- /dev/null +++ b/tag.hbs @@ -0,0 +1,17 @@ +{{!< default}} + +{{#tag}} +
    +

    {{ name }}

    + + {{#if description}} +

    {{ description }}

    + {{/if}} +
    +{{/tag}} + +{{> loop }} + +
    + +{{ pagination }} \ No newline at end of file