astro-paper icon indicating copy to clipboard operation
astro-paper copied to clipboard

header image example

Open diomed opened this issue 1 year ago • 10 comments

please make page with header image example

diomed avatar Sep 27 '23 06:09 diomed

Hello, I don't quite get what you mean. Maybe you can check this blog post.

satnaing avatar Oct 06 '23 05:10 satnaing

I think the header image page might refer to a layout where you can put an image before the post title/h1 tag.

tanishqmanuja avatar Oct 06 '23 07:10 tanishqmanuja

This is pure speculation since OP isn't clear, but they might be referring to this: https://astro-paper.pages.dev/posts/how-to-configure-astropaper-theme/#configuring-logo-or-title

I was playing around with "LOGO_IMAGE.enable => true" the other day and ran into some trouble myself. The main problem is, that there is one fixed size for the LOGO_IMAGE, but there are, as far as I understand it, two possible screen sizes, below 640px and above. If I adjust the image size for above 640px, it's too big for smaller screens, and vice versa. It would be nice, if there was an option to dynamically adjust the image size. Or maybe there is one and I just missed it?

Because789 avatar Dec 07 '23 17:12 Because789

it's actually cover image in a blog that I want example of

diomed avatar Dec 07 '23 17:12 diomed

@Because789 You can adjust the logo for different screen sizes using max-width. configure LOGO_IMAGE inside config.ts according to your needs; but aim for large screen sizes.

Then inside Header.astro, adjust the css for the logo.

/* Header.astro */

<style>
  /* other styles */
    .logo {
      @apply absolute py-1 text-xl font-semibold sm:static sm:text-2xl
      mt-1 flex max-w-[110px] sm:mt-0 sm:max-w-none; /* add this line */
    }
</style>

Make sure to adjust max-w-[110px] andmt-1 according to your logo. Definitely there will be alternative ways to achieve this. If you're familiar with CSS, you can also use media-query for responsive styles.

satnaing avatar Dec 11 '23 04:12 satnaing

@diomed

You mean this? image

If so, it can be configured inside the frontmatter property ogImage

---
ogImage: https://github.com/satnaing/astro-paper/assets/53733092/1ef0cf03-8137-4d67-ac81-84a032119e3a
---

Or do you want an example of adding an image inside the blog post?

satnaing avatar Dec 11 '23 04:12 satnaing

@satnaing

I was thinking of something like this:

https://tailwindflex.com/@anonymous/blog-article-template/fullscreen-preview

diomed avatar Dec 11 '23 11:12 diomed

@satnaing Thanks so much for coming back to me! You have no idea how many hours I struggled with this (I guess that I've never heard of Astro or Tailwind like a week ago, only had a vague understanding of CSS and never worked with JS ever, wasn't helpful at all :)).

Sadly, your solution didn't work for me. Maybe because I use a png image? Anyway, with your hints I finally found a way I'm satisfied with. For that I had to change the wrapper as well:

<style>
  .top-nav-wrap {
    /* @apply relative flex w-full items-start justify-between p-4 sm:items-center sm:py-8; */
    @apply flex w-full items-start justify-between p-4 sm:items-center;
    }
  .logo {
    /* @apply absolute py-1 text-xl font-semibold sm:static sm:text-2xl; */
    @apply flex max-w-[60px] sm:max-w-none;
  }
</style>

This probably breaks the template if you use a text based logo, since I removed the text-classes for readability. Considering I'm only using the logo, I'm happy with that.

Thanks so much for your work here, it's an amazing template and I already learned so much digging into it!

Because789 avatar Dec 11 '23 11:12 Because789

@satnaing

I was thinking of something like this:

https://tailwindflex.com/@anonymous/blog-article-template/fullscreen-preview

Oh! For that, we have to deal with CSS for customization. Currently, AstroPaper doesn't support that style of cover image out of the box. But, if you wish, you can customize ogImage style with CSS.

satnaing avatar Dec 12 '23 03:12 satnaing

@satnaing I was thinking of something like this: https://tailwindflex.com/@anonymous/blog-article-template/fullscreen-preview

Oh! For that, we have to deal with CSS for customization. Currently, AstroPaper doesn't support that style of cover image out of the box. But, if you wish, you can customize ogImage style with CSS.

Sir please tell me how can we do this and please add this feature in theme

fazi-gondal avatar Jun 05 '24 05:06 fazi-gondal