Compare commits

...

12 Commits

Author SHA1 Message Date
ebb2538215 v5.4.3 2022-12-15 10:12:38 +08:00
3767e3d994 Adjusted the pagination to dark mode 2022-12-15 10:00:58 +08:00
6d290485dc Fixed account button background 2022-12-15 09:55:41 +08:00
7da41d344f Added sign in link to the navbar 2022-12-14 16:42:46 +08:00
55a90a9252 v5.4.2 2022-12-12 14:55:31 +08:00
b20dceae22 Rebuilt assets 2022-12-12 14:55:02 +08:00
88ca182a58 Added regular pagination option
Casper comes with infinite scrolling by default. This update makes it possible to go with the default pagination style when the <html> element has a class no-infinite-scroll.
2022-12-08 12:50:24 +08:00
140632b885 fixes #910
When the publication cover is turned off and the header style is set to hidden, the header section shouldn't be taking much space like it does regularly.
2022-12-07 15:29:23 +08:00
8f2b806673 v5.4.1 2022-11-14 11:05:28 +08:00
4af198a19f Fixed dropdown menu width 2022-11-14 10:42:10 +08:00
f846ceb7ed Fixed minor spacing issues on the header 2022-11-14 10:37:50 +08:00
7390c17a26 Fix for intended location of search icon 2022-11-14 10:31:51 +08:00
12 changed files with 148 additions and 79 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -136,6 +136,7 @@ production stylesheet in assets/built/screen.css
.site-header-content.no-content {
padding-top: 0;
padding-bottom: 2vmin;
}
.site-header-inner {
@ -192,9 +193,11 @@ production stylesheet in assets/built/screen.css
}
:is(.site-logo, .site-title) + .site-description {
max-width: 640px;
margin-top: 16px;
font-size: 2.4rem;
font-weight: 400;
line-height: 1.4;
}
.site-logo + .site-description {
@ -270,7 +273,7 @@ production stylesheet in assets/built/screen.css
color: #fff;
}
.home-template.has-cover .gh-head {
:is(.home-template, .paged:not(.tag-template):not(.author-template)).has-cover .gh-head {
position: absolute;
top: 0;
right: 0;
@ -310,7 +313,7 @@ production stylesheet in assets/built/screen.css
@media (min-width: 992px) {
.is-head-left-logo .gh-head-menu {
margin-right: 32px;
margin-right: 64px;
margin-left: 16px;
}
}
@ -323,10 +326,6 @@ production stylesheet in assets/built/screen.css
grid-column-start: 2;
}
.is-head-middle-logo .gh-head-actions {
gap: 28px;
}
@media (min-width: 992px) {
.is-head-middle-logo .gh-head-menu {
margin-right: 64px;
@ -514,7 +513,7 @@ production stylesheet in assets/built/screen.css
grid-template-columns: 1fr 1fr;
grid-auto-flow: column;
column-gap: 40px;
width: auto;
min-width: 320px;
padding: 20px 32px;
}
@ -567,6 +566,17 @@ production stylesheet in assets/built/screen.css
text-align: right;
}
.gh-head-members {
display: flex;
gap: 20px;
align-items: center;
}
.gh-head-link {
font-weight: 500;
color: inherit;
}
.gh-head-button {
display: inline-flex;
justify-content: center;
@ -615,13 +625,13 @@ production stylesheet in assets/built/screen.css
margin-right: -4px;
}
@media (max-width: 991px) {
@media (max-width: 767px) {
.gh-head-actions .gh-search {
display: none;
}
}
@media (min-width: 992px) {
@media (min-width: 768px) {
.gh-head-brand .gh-search {
display: none;
}
@ -683,7 +693,7 @@ production stylesheet in assets/built/screen.css
/* ---------------------------------------------------------- */
/* IDs needed to ensure sufficient specificity */
@media (max-width: 991px) {
@media (max-width: 767px) {
#gh-head {
height: 64px;
}
@ -1146,6 +1156,41 @@ make sure this only happens on large viewports / desktop-ish devices.
}
}
/* Pagination
/* ---------------------------------------------------------- */
.pagination {
display: none;
grid-template-columns: 1fr auto 1fr;
align-items: center;
margin-top: 8vmin;
}
html.no-infinite-scroll .pagination {
display: grid;
}
.pagination a {
font-size: 1.7rem;
font-weight: 600;
}
.pagination .page-number {
grid-column-start: 2;
color: var(--color-secondary-text);
}
.pagination .older-posts {
grid-column-start: 3;
text-align: right;
}
@media (max-width: 767px) {
.pagination .page-number {
display: none;
}
}
/* 7. Single Post
/* ---------------------------------------------------------- */
@ -2074,7 +2119,7 @@ html.dark-mode .post-card-image {
background: var(--color-darkmode);
}
html.dark-mode :is(.post-card-tags, .post-card-meta, .article-tag a, .byline-meta-content) {
html.dark-mode :is(.post-card-tags, .post-card-meta, .article-tag a, .byline-meta-content, .pagination .page-number) {
color: color-mod(var(--color-secondary-text) l(-22%));
}
@ -2090,6 +2135,10 @@ html.dark-mode .post-card-excerpt {
color: var(--color-secondary-text);
}
html.dark-mode .pagination a {
color: #fff;
}
html.dark-mode .author-profile-location {
color: #fff;
}
@ -2254,7 +2303,7 @@ html.dark-mode .footer-cta-title {
background: var(--color-darkmode);
}
html.auto-color :is(.post-card-tags, .post-card-meta, .article-tag a, .byline-meta-content) {
html.auto-color :is(.post-card-tags, .post-card-meta, .article-tag a, .byline-meta-content, .pagination .page-number) {
color: color-mod(var(--color-secondary-text) l(-22%));
}
@ -2270,6 +2319,10 @@ html.dark-mode .footer-cta-title {
color: var(--color-secondary-text);
}
html.auto-color .pagination a {
color: #fff;
}
html.auto-color .author-profile-location {
color: #fff;
}

View File

@ -1,5 +1,5 @@
(function () {
const mediaQuery = window.matchMedia('(max-width: 991px)');
const mediaQuery = window.matchMedia('(max-width: 767px)');
const menu = document.querySelector('.gh-head-menu');
const nav = menu.querySelector('.nav');

View File

@ -14,6 +14,8 @@
*/
(function (window, document) {
if (document.documentElement.classList.contains('no-infinite-scroll')) return;
// next link element
var nextElement = document.querySelector('link[rel=next]');
if (!nextElement) {

View File

@ -2,69 +2,75 @@
{{!-- The tag above means - insert everything in this file into the {body} of the default.hbs template --}}
<main id="site-main" class="site-main outer">
<div class="post-feed inner">
<div class="inner posts">
{{#author}}
<section class="post-card post-card-large">
<div class="post-feed">
{{#if feature_image}}
<div class="post-card-image-link">
{{!-- This is a responsive image, it loads different sizes depending on device
https://medium.freecodecamp.org/a-guide-to-responsive-images-with-ready-to-use-templates-c400bd65c433 --}}
<img class="post-card-image"
srcset="{{img_url feature_image size="s"}} 300w,
{{img_url feature_image size="m"}} 600w,
{{img_url feature_image size="l"}} 1000w,
{{img_url feature_image size="xl"}} 2000w"
sizes="(max-width: 1000px) 400px, 800px"
src="{{img_url feature_image size="m"}}"
alt="{{title}}"
/>
</div>
{{/if}}
{{#author}}
<section class="post-card post-card-large">
<div class="post-card-content">
<div class="post-card-content-link">
{{#if profile_image}}
<img class="author-profile-pic" src="{{profile_image}}" alt="{{name}}" />
{{#if feature_image}}
<div class="post-card-image-link">
{{!-- This is a responsive image, it loads different sizes depending on device
https://medium.freecodecamp.org/a-guide-to-responsive-images-with-ready-to-use-templates-c400bd65c433 --}}
<img class="post-card-image"
srcset="{{img_url feature_image size="s"}} 300w,
{{img_url feature_image size="m"}} 600w,
{{img_url feature_image size="l"}} 1000w,
{{img_url feature_image size="xl"}} 2000w"
sizes="(max-width: 1000px) 400px, 800px"
src="{{img_url feature_image size="m"}}"
alt="{{title}}"
/>
</div>
{{/if}}
<header class="post-card-header">
<h2 class="post-card-title">{{name}}</h2>
</header>
<div class="post-card-content">
<div class="post-card-content-link">
{{#if bio}}
<div class="post-card-excerpt">{{bio}}</div>
{{/if}}
<footer class="author-profile-footer">
{{#if location}}
<div class="author-profile-location">{{location}}</div>
{{#if profile_image}}
<img class="author-profile-pic" src="{{profile_image}}" alt="{{name}}" />
{{/if}}
<div class="author-profile-meta">
{{#if website}}
<a class="author-profile-social-link" href="{{website}}" target="_blank" rel="noopener">{{website}}</a>
<header class="post-card-header">
<h2 class="post-card-title">{{name}}</h2>
</header>
{{#if bio}}
<div class="post-card-excerpt">{{bio}}</div>
{{/if}}
<footer class="author-profile-footer">
{{#if location}}
<div class="author-profile-location">{{location}}</div>
{{/if}}
{{#if twitter}}
<a class="author-profile-social-link" href="{{twitter_url}}" target="_blank" rel="noopener">{{> "icons/twitter"}}</a>
{{/if}}
{{#if facebook}}
<a class="author-profile-social-link" href="{{facebook_url}}" target="_blank" rel="noopener">{{> "icons/facebook"}}</a>
{{/if}}
</div>
</footer>
<div class="author-profile-meta">
{{#if website}}
<a class="author-profile-social-link" href="{{website}}" target="_blank" rel="noopener">{{website}}</a>
{{/if}}
{{#if twitter}}
<a class="author-profile-social-link" href="{{twitter_url}}" target="_blank" rel="noopener">{{> "icons/twitter"}}</a>
{{/if}}
{{#if facebook}}
<a class="author-profile-social-link" href="{{facebook_url}}" target="_blank" rel="noopener">{{> "icons/facebook"}}</a>
{{/if}}
</div>
</footer>
</div>
</div>
</div>
</div>
</section>
{{/author}}
</section>
{{/author}}
{{#foreach posts}}
{{!-- The tag below includes the markup for each post - partials/post-card.hbs --}}
{{> "post-card"}}
{{/foreach}}
{{#foreach posts}}
{{!-- The tag below includes the markup for each post - partials/post-card.hbs --}}
{{> "post-card"}}
{{/foreach}}
</div>
{{pagination}}
</div>
</main>

View File

@ -38,7 +38,7 @@
<nav class="gh-head-menu">
{{navigation}}
{{#unless @site.members_enabled}}
{{#match @custom.header_style "Stacked"}}
{{#match @custom.navigation_layout "Stacked"}}
<button class="gh-search gh-icon-btn" data-ghost-search>{{> "icons/search"}}</button>
{{/match}}
{{/unless}}
@ -46,20 +46,23 @@
<div class="gh-head-actions">
{{#unless @site.members_enabled}}
{{^match @custom.header_style "Stacked"}}
{{^match @custom.navigation_layout "Stacked"}}
<button class="gh-search gh-icon-btn" data-ghost-search>{{> "icons/search"}}</button>
{{/match}}
{{else}}
<button class="gh-search gh-icon-btn" data-ghost-search>{{> "icons/search"}}</button>
{{#unless @member}}
{{#unless @site.members_invite_only}}
<a class="gh-head-button" href="#/portal/signup" data-portal="signup">Subscribe</a>
<div class="gh-head-members">
{{#unless @member}}
{{#unless @site.members_invite_only}}
<a class="gh-head-link" href="#/portal/signin" data-portal="signin">Sign in</a>
<a class="gh-head-button" href="#/portal/signup" data-portal="signup">Subscribe</a>
{{else}}
<a class="gh-head-button" href="#/portal/signin" data-portal="signin">Sign in</a>
{{/unless}}
{{else}}
<a class="gh-head-button" href="#/portal/signin" data-portal="signin">Login</a>
<a class="gh-head-button" href="#/portal/account" data-portal="account">Account</a>
{{/unless}}
{{else}}
<a class="gh-head-button" href="#/portal/account" data-portal="account">Account</a>
{{/unless}}
</div>
{{/unless}}
</div>
</div>

View File

@ -48,5 +48,7 @@ into the {body} of the default.hbs template --}}
{{/foreach}}
</div>
{{pagination}}
</div>
</main>

View File

@ -2,7 +2,7 @@
"name": "casper",
"description": "A clean, minimal default theme for the Ghost publishing platform",
"demo": "https://demo.ghost.io",
"version": "5.4.0",
"version": "5.4.3",
"engines": {
"ghost": ">=5.0.0"
},

View File

@ -48,5 +48,8 @@
{{/foreach}}
</div>
{{pagination}}
</div>
</main>