Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Silarhi theme #1

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
2 changes: 1 addition & 1 deletion assets/built/screen.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/built/screen.css.map

Large diffs are not rendered by default.

60 changes: 44 additions & 16 deletions assets/css/screen.css
Original file line number Diff line number Diff line change
Expand Up @@ -2170,6 +2170,10 @@ html.dark-mode .site-header-content {
color: #fff;
}

html.dark-mode .site-header-cover {
opacity: 1;
}

html.dark-mode .post-card-image {
background: var(--color-darkmode);
}
Expand Down Expand Up @@ -2253,14 +2257,6 @@ html.dark-mode .gh-content :not(pre) > code {
color: #fff;
}

html.dark-mode .gh-content strong {
color: #fff;
}

html.dark-mode .gh-content em {
color: #fff;
}

html.dark-mode .gh-content code {
color: #fff;
background: #000;
Expand Down Expand Up @@ -2319,6 +2315,12 @@ html.dark-mode .kg-header-card h3.kg-header-card-subheader {
color: #fff;
}

html.dark-mode .kg-bookmark-card a.kg-bookmark-container,
html.dark-mode .kg-bookmark-card a.kg-bookmark-container:hover {
background: var(--color-darkmode) !important;
color: #fff !important;
}

html.dark-mode .footer-cta-title {
color: #fff;
}
Expand Down Expand Up @@ -2362,6 +2364,10 @@ html.dark-mode .footer-cta-title {
color: #fff;
}

html.auto-color .site-header-cover {
opacity: 1;
}

html.auto-color .post-card-image {
background: var(--color-darkmode);
}
Expand Down Expand Up @@ -2445,14 +2451,6 @@ html.dark-mode .footer-cta-title {
color: #fff;
}

html.auto-color .gh-content strong {
color: #fff;
}

html.auto-color .gh-content em {
color: #fff;
}

html.auto-color .gh-content code {
color: #fff;
background: #000;
Expand Down Expand Up @@ -2511,6 +2509,12 @@ html.dark-mode .footer-cta-title {
color: #fff;
}

html.auto-color .kg-bookmark-card a.kg-bookmark-container,
html.auto-color .kg-bookmark-card a.kg-bookmark-container:hover {
background: var(--color-darkmode) !important;
color: #fff !important;
}

html.auto-color .footer-cta-title {
color: #fff;
}
Expand Down Expand Up @@ -3034,3 +3038,27 @@ file to add some of your own styles. Well, you've come to
the right place. Onward!

*/
.has-cover:not(.home-template) .gh-head {
background-color: #fff;
color: #15171a;
}

html.dark-mode .has-cover:not(.home-template) .gh-head {
background: var(--color-darkmode);
}

.site-nav-logo {
padding: 0;
}

.gh-head-logo img {
max-height: 44px;
}

.site-logo {
max-height: 100px;
}

.article pre {
font-size: 1.4rem;
}
12 changes: 6 additions & 6 deletions author.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
{{!-- 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 cover_image size="s"}} 300w,
{{img_url cover_image size="m"}} 600w,
{{img_url cover_image size="l"}} 1000w,
{{img_url cover_image size="xl"}} 2000w"
srcset="https://res.cloudinary.com/silarhi/image/fetch/c_limit,f_auto,q_auto,w_300/{{img_url cover_image absolute=true}} 300w,
https://res.cloudinary.com/silarhi/image/fetch/c_limit,f_auto,q_auto,w_600/{{img_url cover_image absolute=true}} 600w,
https://res.cloudinary.com/silarhi/image/fetch/c_limit,f_auto,q_auto,w_1000/{{img_url cover_image absolute=true}} 1000w,
https://res.cloudinary.com/silarhi/image/fetch/c_limit,f_auto,q_auto,w_2000/{{img_url cover_image absolute=true}} 2000w"
sizes="(max-width: 1000px) 400px, 800px"
src="{{img_url cover_image size="m"}}"
src="https://res.cloudinary.com/silarhi/image/fetch/c_limit,f_auto,q_auto,w_1000/{{img_url cover_image absolute=true}}"
alt="{{title}}"
/>
</div>
Expand All @@ -29,7 +29,7 @@
<div class="post-card-content-link">

{{#if profile_image}}
<img class="author-profile-pic" src="{{profile_image}}" alt="{{name}}" />
<img class="author-profile-pic" width="80" height="80" src="https://res.cloudinary.com/silarhi/image/fetch/c_limit,f_auto,q_auto,w_80/{{profile_image}}" alt="{{name}}" />
{{/if}}

<header class="post-card-header">
Expand Down
72 changes: 69 additions & 3 deletions default.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<div class="gh-head-brand">
<a class="gh-head-logo{{#unless @site.logo}} no-image{{/unless}}" href="{{@site.url}}">
{{#if @site.logo}}
<img src="{{@site.logo}}" alt="{{@site.title}}">
<img width="118" height="44" src="https://res.cloudinary.com/silarhi/image/fetch/c_limit,f_auto,q_auto,w_118,h_44/{{img_url @site.logo absolute=true}}" srcset="https://res.cloudinary.com/silarhi/image/fetch/c_limit,f_auto,q_auto,dpr_2.0,w_118,h_44/{{img_url @site.logo absolute=true}} 2x" alt="{{@site.title}}" />
{{else}}
{{@site.title}}
{{/if}}
Expand Down Expand Up @@ -84,7 +84,7 @@
<nav class="site-footer-nav">
{{navigation type="secondary"}}
</nav>
<div class="gh-powered-by"><a href="https://ghost.org/" target="_blank" rel="noopener">Powered by Ghost</a></div>
<div class="gh-powered-by"><a href="https://sainthillier.fr">Développeur Web PHP Freelance à Toulouse</a></div>
</div>
</footer>

Expand Down Expand Up @@ -112,7 +112,73 @@ $(document).ready(function () {
$(".gh-content").fitVids();
});
</script>

<script>
;( function( $, window, document, undefined )
{
'use strict';
var $win = $( window ),
throttle = function(a,b){var c,d;return function(){var e=this,f=arguments,g=+new Date;c&&g<c+a?(clearTimeout(d),d=setTimeout(function(){c=g,b.apply(e,f)},a)):(c=g,b.apply(e,f))}},
throttleTO = false,
laziness = false,
disqusConfig = false,
scriptUrl = false,
scriptStatus = 'unloaded',
$instance = $(),
init = function()
{
if( !$instance.length || $instance.data( 'disqusLoaderStatus' ) == 'loaded' )
return true;
var winST = $win.scrollTop();
// if the element is too far below || too far above
if( $instance.offset().top - winST > $win.height() * laziness || winST - $instance.offset().top - $instance.outerHeight() - ( $win.height() * laziness ) > 0 )
return true;
$( '#disqus_thread' ).removeAttr( 'id' );
$instance.attr( 'id', 'disqus_thread' ).data( 'disqusLoaderStatus', 'loaded' );
if( scriptStatus == 'loaded' )
{
DISQUS.reset({ reload: true, config: disqusConfig });
}
else // unloaded | loading
{
window.disqus_config = disqusConfig;
if( scriptStatus == 'unloaded' )
{
scriptStatus = 'loading';
$.ajax(
{
url: scriptUrl,
async: true,
cache: true,
dataType: 'script',
success: function()
{
scriptStatus = 'loaded';
}
});
}
}
};
$win.on( 'scroll resize', throttle( throttleTO, init ));
$.disqusLoader = function( element, options )
{
options = $.extend({},
{
laziness: 1,
throttle: 250,
scriptUrl: false,
disqusConfig: false,
}, options );
laziness = options.laziness + 1;
throttleTO = options.throttle;
disqusConfig = options.disqusConfig;
scriptUrl = scriptUrl === false ? options.scriptUrl : scriptUrl; // set it only once
$instance = ( typeof element == 'string' ? $( element ) : element ).eq( 0 );
$instance.data( 'disqusLoaderStatus', 'unloaded' );
init();
};
})( jQuery, window, document );
$('#disqus').length && $.disqusLoader( '#disqus', { scriptUrl: '//silarhi.disqus.com/embed.js' });
</script>
{{!-- Ghost outputs required functional scripts with this tag - it should always be the last thing before the closing body tag --}}
{{ghost_foot}}

Expand Down
2 changes: 1 addition & 1 deletion error.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Keep this template as lightweight as you can!
<div class="inner">
<nav class="site-nav-center">
{{#if @site.logo}}
<a class="site-nav-logo" href="{{@site.url}}"><img src="{{img_url @site.logo size="xs"}}"
<a class="site-nav-logo" href="{{@site.url}}"><img src="https://res.cloudinary.com/silarhi/image/fetch/c_limit,f_auto,q_auto,w_100/{{img_url @site.logo absolute=true}}"
alt="{{@site.title}}" /></a>
{{else}}
<a class="site-nav-logo" href="{{@site.url}}">{{@site.title}}</a>
Expand Down
12 changes: 6 additions & 6 deletions index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ into the {body} of the default.hbs template --}}
{{!-- 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="site-header-cover"
srcset="{{img_url @site.cover_image size="s"}} 300w,
{{img_url @site.cover_image size="m"}} 600w,
{{img_url @site.cover_image size="l"}} 1000w,
{{img_url @site.cover_image size="xl"}} 2000w"
srcset="https://res.cloudinary.com/silarhi/image/fetch/c_limit,f_auto,q_auto,w_300/{{img_url @site.cover_image absolute=true}} 300w,
https://res.cloudinary.com/silarhi/image/fetch/c_limit,f_auto,q_auto,w_600/{{img_url @site.cover_image absolute=true}} 600w,
https://res.cloudinary.com/silarhi/image/fetch/c_limit,f_auto,q_auto,w_1000/{{img_url @site.cover_image absolute=true}} 1000w,
https://res.cloudinary.com/silarhi/image/fetch/c_limit,f_auto,q_auto,w_2000/{{img_url @site.cover_image absolute=true}} 2000w"
sizes="100vw"
src="{{img_url @site.cover_image size="xl"}}"
src="https://res.cloudinary.com/silarhi/image/fetch/c_limit,f_auto,q_auto,w_1000/{{img_url @site.cover_image absolute=true}}"
alt="{{@site.title}}"
/>
{{/if}}
Expand All @@ -24,7 +24,7 @@ into the {body} of the default.hbs template --}}
<div class="site-header-inner inner">
{{#match @custom.navigation_layout "Logo on cover"}}
{{#if @site.logo}}
<img class="site-logo" src="{{@site.logo}}" alt="{{@site.title}}">
<img width="288" height="100" class="site-logo" src="https://res.cloudinary.com/silarhi/image/fetch/c_limit,f_auto,q_auto,w_1000/{{img_url @site.logo absolute=true}}" alt="{{@site.title}}" />
{{else}}
<h1 class="site-title">{{@site.title}}</h1>
{{/if}}
Expand Down
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "casper",
"name": "silarhi",
"description": "A clean, minimal default theme for the Ghost publishing platform",
"demo": "https://demo.ghost.io",
"version": "5.7.0",
"version": "5.7.5",
"engines": {
"ghost": ">=5.0.0"
},
Expand Down Expand Up @@ -49,7 +49,7 @@
"autoprefixer": "10.4.7",
"beeper": "2.1.0",
"cssnano": "5.1.12",
"gscan": "4.36.1",
"gscan": "4.43.1",
"gulp": "4.0.2",
"gulp-concat": "2.6.1",
"gulp-livereload": "4.0.2",
Expand Down Expand Up @@ -175,5 +175,6 @@
"extends": [
"@tryghost:theme"
]
}
},
"dependencies": {}
}
10 changes: 5 additions & 5 deletions page.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ into the {body} tag of the default.hbs template --}}
{{!-- 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
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"
srcset="https://res.cloudinary.com/silarhi/image/fetch/c_limit,f_auto,q_auto,w_300/{{img_url feature_image absolute=true}} 300w,
https://res.cloudinary.com/silarhi/image/fetch/c_limit,f_auto,q_auto,w_600/{{img_url feature_image absolute=true}} 600w,
https://res.cloudinary.com/silarhi/image/fetch/c_limit,f_auto,q_auto,w_1000/{{img_url feature_image absolute=true}} 1000w,
https://res.cloudinary.com/silarhi/image/fetch/c_limit,f_auto,q_auto,w_2000/{{img_url feature_image absolute=true}}" 2000w
sizes="(min-width: 1400px) 1400px, 92vw"
src="{{img_url feature_image size="xl"}}"
src="https://res.cloudinary.com/silarhi/image/fetch/c_limit,f_auto,q_auto,w_2000/{{img_url feature_imageabsolute=true}}"
alt="{{#if feature_image_alt}}{{feature_image_alt}}{{else}}{{title}}{{/if}}"
/>
{{#if feature_image_caption}}
Expand Down
14 changes: 7 additions & 7 deletions partials/post-card.hbs
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
{{!-- This is a partial file used to generate a post "card"
which templates loop over to generate a list of posts. --}}

<article class="post-card {{post_class}}{{#match @custom.feed_layout "Classic"}}{{#is "home"}}{{#has index="0"}} post-card-large{{/has}}{{#has index="1,2"}} dynamic{{/has}}{{/is}}{{/match}}{{#match @custom.feed_layout "Grid"}} keep-ratio{{/match}}{{#match @custom.feed_layout "List"}}{{#is "home, paged"}} post-card-large{{/is}}{{/match}}{{#unless access}} post-access-{{visibility}}{{/unless}}">
<article class="post-card {{post_class}}{{#match @custom.feed_layout "Classic"}}{{#is "home"}}{{#has index="0"}} post-card-large{{/has}}{{#has index="1,2"}} dynamic{{/has}}{{/is}}{{/match}}{{#match @custom.feed_layout "Grid"}} keep-ratio{{/match}}{{#match @custom.feed_layout "List"}}{{^is "tag, author"}} post-card-large{{/is}}{{/match}}{{#unless access}} post-access-{{visibility}}{{/unless}}">

{{#if feature_image}}
<a class="post-card-image-link" href="{{url}}">

{{!-- 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"
srcset="https://res.cloudinary.com/silarhi/image/fetch/c_limit,f_auto,q_50,w_300/{{img_url feature_image absolute=true}} 300w,
https://res.cloudinary.com/silarhi/image/fetch/c_limit,f_auto,q_50,w_600/{{img_url feature_image absolute=true}} 600w,
https://res.cloudinary.com/silarhi/image/fetch/c_limit,f_auto,q_30,w_1000/{{img_url feature_image absolute=true}} 1000w,
https://res.cloudinary.com/silarhi/image/fetch/c_limit,f_auto,q_30,w_2000/{{img_url feature_image absolute=true}} 2000w"
sizes="(max-width: 1000px) 400px, 800px"
src="{{img_url feature_image size="m"}}"
src="https://res.cloudinary.com/silarhi/image/fetch/c_limit,f_auto,q_auto,w_600/{{img_url feature_image absolute=true}}"
alt="{{#if feature_image_alt}}{{feature_image_alt}}{{else}}{{title}}{{/if}}"
loading="lazy"
/>
Expand Down Expand Up @@ -64,7 +64,7 @@ which templates loop over to generate a list of posts. --}}
</a>

<footer class="post-card-meta">
<time class="post-card-meta-date" datetime="{{date format="YYYY-MM-DD"}}">{{date}}</time>
<time class="post-card-meta-date" datetime="{{date format="YYYY-MM-DD"}}">{{date updated_at format='DD MMMM YYYY'}}</time>
{{#if reading_time}}
<span class="post-card-meta-length">{{reading_time}}</span>
{{/if}}
Expand Down
Loading