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

{{@page}} error after installation #269

Closed
alexander-potemkin opened this issue Mar 7, 2024 · 3 comments
Closed

{{@page}} error after installation #269

alexander-potemkin opened this issue Mar 7, 2024 · 3 comments

Comments

@alexander-potemkin
Copy link

Please, see screenshot attached.

Screenshot 2024-03-07 at 23 26 08
@decisivedevops
Copy link

+1

@decisivedevops
Copy link

hey @alexander-potemkin

I managed to solve this error by wrapping page.hbs header in {{#if @page.show_title_and_feature_image}} condition.

Download the theme zip. v3.7.0
Unzip it.
from the root folder, open page.hbs file
Put below code and save.
Zip it and upload on Ghost.

{{!< default}}

{{!-- Everything inside the #post tags pulls data from the post --}}
{{#post}}

{{#if @page.show_title_and_feature_image}}
<header class="post-header {{#if feature_image}} has-cover {{/if}}">
	<div class="inner">
		<h1 class="post-title">{{{title}}}</h1>
		{{#if feature_image}}
		<div class="post-cover cover">
			<img
			srcset="{{img_url feature_image size="s"}} 320w,
							{{img_url feature_image size="m"}} 640w,
							{{img_url feature_image size="l"}} 960w,
							{{img_url feature_image size="xl"}} 1920w"
			src="{{img_url feature_image size="xl"}}"
			alt="{{title}}" />
		</div>
		{{/if}}
	</div>
</header>
{{/if}}

<main class="content" role="main">
	<article class="{{post_class}}">
		<div class="inner">

			<section class="post-content">
				{{content}}
			</section>

		</div>
	</article>
</main>

{{/post}}

{{!-- The #contentFor helper here will send everything inside it up to the matching #block helper found in default.hbs --}}
{{#contentFor "scripts"}}
<script>
  $(document).ready(function () {
		var post = $('.post-content');
		// Responsive videos with fitVids
    post.fitVids();
		// Format code blocks and add line numbers
		function codestyling() {
	    $('pre code').each(function(i, e) {
				// Code highlight
	      hljs.highlightElement(e);
	      // No lines for plain text blocks
	      if (!$(this).hasClass('language-text')) {
	        var code = $(this);
					// Calculate amount of lines
	        var lines = code.html().split(/\n(?!$)/g).length;
	        var numbers = [];
	        if (lines > 1) {
	          lines++;
	        }
	        for (i = 1; i < lines; i++) {
	          numbers += '<span class="line" aria-hidden="true">' + i + '</span>';
	        }
	        code.parent().append('<div class="lines">' + numbers + '</div>');
	      }
	    });
	  }
	  codestyling();
  });
</script>
{{/contentFor}}

@alexander-potemkin
Copy link
Author

hey, @decisivedevops ! Thank you! I hope this will get merged into the theme, meanwhile I've switched to another theme.
Thanks a lot for your help in any case!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants