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

header image example #128

Open
diomed opened this issue Sep 27, 2023 · 10 comments
Open

header image example #128

diomed opened this issue Sep 27, 2023 · 10 comments

Comments

@diomed
Copy link
Contributor

diomed commented Sep 27, 2023

please make page with header image example

@satnaing
Copy link
Owner

satnaing commented Oct 6, 2023

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

@tanishqmanuja
Copy link
Contributor

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

@Because789
Copy link

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?

@diomed
Copy link
Contributor Author

diomed commented Dec 7, 2023

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

@satnaing
Copy link
Owner

@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
Copy link
Owner

@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?

@diomed
Copy link
Contributor Author

diomed commented Dec 11, 2023

@Because789
Copy link

@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!

@satnaing
Copy link
Owner

@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.

@fazi-gondal
Copy link

@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

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

5 participants