Notes on creating a simple static landing page site using my Astro template

20:33, 21 February 2026

[Initially I wanted to see if I could quickly find some other Astro template that I could use to create a simple static landing page site for a primary & secondary education (K-12) rural Indian school. So I did some searching for it ....]

Now looking at Astro Base - https://github.com/jonnysmillie/astro-base

Some issues:
Mobile menu takes up whole window width.
Does not support dark mode.
The developer has an interesting showcase of websites: https://jonnysmillie.dev/websites/

-------

Top 23 free Astro themes for building out-of-this-world static sites in 2023, https://cloudcannon.com/blog/top-23-free-astro-themes-for-building-out-of-this-world-static-sites-in-2023/

- Initial thoughts were that it was very impressive. But when I dug into the source code for a simple case of using a Hero image I found the code to be too intricate:
  • https://github.com/arthelokyo/astrowind/blob/main/src/components/widgets/Hero.astro
  • Uses a custom Image component - https://github.com/arthelokyo/astrowind/blob/main/src/components/common/Image.astro - instead of standard Astro Image component. 
It may turn out later to be useful. But for my current needs, the above code is way too complex.

Best School Websites of 2026 – Learn From These Top School Web Design Examples, https://morweb.org/post/best-school-websites

Then I decided to use the simple Astro template I had created (converted from Next.js) which is covered by my previous blog post

----------------

ChatGPT chat: Astro simple site

Me: I am starting with a simple Astro landing page template I created called stripdowncomm-astro which I discussed with you in previous chats. I have copied it as ssw-astro (standing for static school website - astro).
So far I have not used images in Astro. I would like to add an image to my Hero component. Here's src\components\sections\Hero.astro code:
---snipped---

[In ssw-astro project, I deleted the old git repo and created a new git repo. I also deleted conversion docs folder.]

[CG provided me modified code that included Astro Image component.]

...
Me: Search the web and give me link of a good free (attribution is OK) hero image for a K-12 school which I can use in above code.

CG: Here are some good free sources where you can download high-quality school-related hero images (useful for your Astro landing page). Many are CC0 (no attribution needed) or free with optional attribution:

📸 Free High-Quality School Images (No Attribution Needed)

  1. Pixabay – School & Classroom Photos
    Huge library of free school and student photos you can use on your site. CC0, so attribution is optional. (Pixabay)
    👉 https://pixabay.com/images/search/school%20kids%20class/

  2. Pixabay – Kids Classroom Photos
    Another search result with many classroom images ideal for hero banners. CC0 free. (Pixabay)
    👉 https://pixabay.com/images/search/kids%20classroom/

  3. StockSnap – Free School Photos
    200+ completely free, high-res school images (CC0, no attribution required). (StockSnap)
    👉 https://stocksnap.io/search/school


📌 Free With Attribution (Optional)

If you don’t mind giving attribution, you can also use photos from these:

  1. FreeDesignFile – Primary School Student Photo
    Free download (give attribution back to the site). (FreeDesignFile)
    👉 https://freedesignfile.com/466923-primary-school-student-stock-photo/

  2. FreeDesignFile – Middle School Student Photo
    Another good classroom photo with required attribution. (FreeDesignFile)
    👉 https://freedesignfile.com/478833-middle-school-student-stock-photo/


🔎 Tips for Hero Image Selection

  • Prefer landscape orientation (wider images) for hero sections.

  • Use photos with clear space at the top or around the subject so your text can sit on them without reducing readability.

  • If you use CC0 sources like Pixabay/StockSnap, you don’t need to provide attribution, but you still can mention attribution in your footer if you wish.


If you want, I can pick a specific image URL (like a direct download link) from one of these libraries that fits well as a hero background (e.g., kids entering school, classroom scene, etc.). Just let me know the vibe you want (cheerful kids, classroom action, teacher & students, etc.).

---------------------
15,896 Free images of School Kids Class, https://pixabay.com/images/search/school%20kids%20class/


I used some image as hero.img.

Me: I get this error. But I don't have line 27 in Hero.astro
Unterminated string literal
sections/Hero.astro:27:18

[CG was not able to figure out the error. With some code commenting and retries, I figured it out ...]

Me: The issue was that your code had:
---
import { Image } from "astro:assets";
const company... --snipped--
import heroImage from "../../assets/hero.jpg";
---
=================
The second import came after the const statement. Moving the second import up fixed the error.
...

Me: U made a fundamental syntax error in your suggested code. Quite surprising!

[CG acknowledged it.]
...

Me: I am disappointed with the poor error message from Astro. It should have pointed out the import statement. Pl. comment. Is Astro error reporting poor as compared to React/Next.js?

CG: Your disappointment is understandable — and your instinct to compare this with React / Next.js is the right comparison to make.

Short answer first:

Astro’s error reporting is currently weaker and less precise than React / Next.js in certain compiler-stage failures, especially frontmatter parsing errors.

Now the detailed, technical explanation.


Why Astro gave a poor error message in this case

Your error occurred in Astro frontmatter, which has a multi-stage compilation pipeline:

  1. .astro file

  2. Astro compiler parses frontmatter + template

  3. Transforms to JS + JSX-like output

  4. Vite parses the generated JS

  5. Tailwind runs on extracted class strings

The invalid code:

const --snipped--
import heroImage from ...

violates ES module grammar.

But the error is detected after transformation, not at the original source level.

Result:

  • The JS parser sees malformed output

  • It no longer “knows” this came from an import

  • So it reports a generic:

    Unterminated string literal
    

This is a loss of source context, not a logic error.


Why React / Next.js feel better here

React / Next.js code is written in:

  • .js, .jsx, .ts, .tsx

These are parsed directly by Babel / TypeScript, with:

  • full source maps

  • precise grammar awareness

  • no intermediate template layer

So if you write:

const x = 1;
import y from "./y";

You get a direct and accurate error, e.g.:

'import' declarations may only appear at top level of a module

This is why the error experience feels significantly better.


Is Astro error reporting “poor” overall?

Nuanced answer:

✅ Where Astro is good

  • Runtime errors in components

  • Template syntax errors ({} misuse, invalid expressions)

  • Integration errors (React/Vue/Svelte components)

  • Vite-level build errors

❌ Where Astro is weak (today)

  • Frontmatter syntax errors

  • Misordered import statements

  • Certain Tailwind + Astro interactions

  • Errors caused after AST transformation

Your case falls squarely into this weak category.


Important context (Astro’s maturity level)

Astro is younger than React + Next.js:

  • React: ~2013

  • Next.js: ~2016

  • Astro: ~2021

Astro made an architectural trade-off:

  • prioritize HTML-first rendering

  • accept a more complex compile pipeline

Better diagnostics are improving, but this edge still exists.


-----------
13:53, 22 February 2026

Me: Pl. review blog post title below for accuracy. The post will cover this chat and following work to create a simple landing/home page site using my Astro template.
Notes on creating a simple static landing page site using my Astro template
...

Me: I will go with my original title. ...
Now about the term 'landing page site':
This will a minimal zero hosting cost (on GitHub Pages) site having a K-12 school hero image, some details about it including a Contact Us email. It will be responsive.
Landing page site conveys the minimal nature of the site.
But it is also the whole site. Does landing page imply that it is only part of the site and not the whole site?

CG: Short, precise answer first:

No — “landing page site” does not imply it must be only part of a larger site.
It can legitimately refer to a single-page website that is the entire site.

Now the careful nuance.


How “landing page” is used in practice

The term landing page is overloaded and used in two distinct but overlapping ways.

1️⃣ Marketing / funnel sense (narrow)

In marketing literature:

  • A landing page is:

    • one page

    • often part of a larger site

    • optimized for conversion (sign-up, inquiry, etc.)

In this sense, yes — it’s often a subset.


2️⃣ Web development / product sense (broader)

In modern dev usage (especially with static site generators like Astro):

  • A landing page can be:

    • the entire site

    • single-page

    • informational

    • minimal

    • responsive

    • hosted cheaply (GitHub Pages, Netlify, etc.)

Examples everyone accepts as “landing pages”:

  • Startup splash sites

  • School intro pages

  • Event microsites

  • “Coming soon” sites

In this sense, landing page = whole site.

Your described site falls squarely here.


Your specific case (important)

You said the site will have:

  • Single page

  • Hero image

  • School description

  • Contact email

  • Responsive

  • Zero hosting cost

  • GitHub Pages

  • Built with Astro

That is textbook “landing page site” in developer parlance.

There is no semantic conflict.


Does “landing page site” sound contradictory?

Not really — and here’s why:

  • “Landing page” describes scope and intent (minimal, focused)

  • “site” describes deployment and ownership (a complete website)

So together:

landing page site = a site consisting of a landing page

This is already common usage.


Alternative terms (not necessary, but for completeness)

If someone were being pedantic, alternatives could be:

  • “single-page site”

  • “one-page static site”

  • “microsite”

But each of these loses something:

  • single-page says nothing about intent

  • microsite can imply campaign-specific

  • one-page can still be complex

“Landing page site” actually communicates minimalism + purpose better.


Final judgment

  • Your usage is correct

  • It does not imply incompleteness

  • It accurately signals:

    • minimal

    • static

    • intentional scope

  • No reader with real-world web experience will be confused

You are using the term as practitioners actually use it, not as a glossary-definition purist would.

So your title + terminology choice stands solidly.


Me: https://www.istockphoto.com/photo/group-of-indian-village-students-in-school-uniform-sitting-in-classroom-doing-gm2075583750-564868460 is good but it is not free (Rs.345).
Can I use the above pic for development without payment --snipped-- so the pic is used on the site only in dev server running on my PC?
I presume I cannot use it for even testing on public GitHub Pages site?
...

[I had a longish exchange on this with CG. Given below are some messages from it followed by a summary.]

Me: Can I commit it to a private GitHub repo?
Why am I considering using this? It is a very realistic rural Indian school pic. I could not quickly get an equivalent free pic (which is realistic as against cartoon type pics OR realistic USA or other foreign school pics). I can show such a premium pic when used in the site to a customer with site running on my dev server and give the customer the option of buying the premium pic if he likes it for using it for his site. Is such usage of premium pics fair and acceptable as per current software development norms?
...

Me: https://media.istockphoto.com/id/2075583750/photo/group-of-indian-village-students-in-school-uniform-sitting-in-classroom-doing-homework.jpg?s=2048x2048&w=is&k=20&c=RSEGCznPKpiry2tO9re6t4yhm4SsaMyDTlsNoCsIAcc=

The above is the URL of the pic from the website selling it.
Instead of including the image in my repo, I could simply provide above URL as image src. Note that the pic has the iStock watermark with author credit prominently displayed on it.

CG: Short answer first:

No — using the iStock image via a direct URL (hot-linking), even with watermark and author credit, is not acceptable for public testing or demos.

...

Me: I had downloaded the image using the browser's save image feature.
Now I noted that the iStock site has a 'Try' button. Clicking it showed a popup that says:
Try this image
You’re welcome to use this watermarked comp image to preview your designs. Unless a license is purchased, the image can’t be used in any final or publicly available materials.
---------
Please comment on the above in the context of our discussion so far.
...

Me: https://www.istockphoto.com/legal/membership-agreement states: 
You are welcome to use watermarked content from the iStock site on a complimentary basis for test or sample layout (composite) use only. Watermarked content cannot be used in any final materials or any publicly available materials and may only be used for the 30 days following download.
==================

So there is also a 30 day period after which the download pic should not be used. Did I get that right?

[CG said yes.]

Me: But I am not a member. The try button allows download without enrolling as a member/signing in. .... But the intent of iStock is clear - redownload after 30 days if you want to use it beyond 30 days for evaluation. ... That is just way too restrictive. I mean, we are talking about watermarked pic here. Hmm. Very disappointing to see such restrictions in iStock but these are their premium pics and if I want to use them I have to go by their rules. 
...

Me: I think I will delete this iStock pic (as download for only 30 days permission issue is there) and completely avoid using iStock premium pics in near future unless customer insists and is seriously interested in buying the premium pics.

I have used UnSplash before. I will search for a rural Indian school pic from that site. It may require attribution but that's fine by me.
...

Me: Please give me a summary section on why iStock watermarked premium pics are unsuitable for me due to the permission restrictions, including the exception clause where customer insists on using iStock pics. I will be using this section on my blog.

CG: Below is a clean, blog-ready summary section you can use as-is. It is factual, restrained, and accurately reflects our discussion without sounding polemical.

Why I am avoiding iStock watermarked premium images (for now)

I evaluated using watermarked premium images from iStock during development because they offer highly realistic, context-specific photographs (for example, rural Indian school scenes). However, after reviewing iStock’s usage terms more carefully, I decided that these images are not suitable for my current workflow.

The main reasons are:

  1. Strict usage scope
    iStock allows watermarked images to be used only for test or sample layout (“comp”) purposes. They cannot be used in any final output or in any publicly accessible material. This rules out use on public test deployments such as GitHub Pages, even for temporary evaluation.

  2. Time-limited permission (30 days)
    Watermarked images may be used only for 30 days after download. Beyond that period, even continued private evaluation is not permitted unless the image is re-downloaded or licensed. This introduces unnecessary time pressure and bookkeeping overhead during exploratory or slow-moving development.

  3. Public visibility is completely disallowed
    Any public URL—no matter how small the audience or how temporary the deployment—is considered “publicly available material” and therefore prohibited without a paid license. This makes it impractical to use such images in common developer workflows that involve public previews.

  4. High friction for early-stage work
    For a minimal, static landing page built as a learning exercise or prototype, these restrictions add complexity that outweighs the benefit of higher visual realism.

Exception: client-driven premium image usage

There is one clear exception where iStock images make sense:
when a client explicitly wants a premium image and is willing to purchase the license.

In such cases:

  • a watermarked image can be used briefly for private preview,

  • the client can decide whether to proceed,

  • and the final site can use a properly licensed image purchased by the client.

Until that point, however, iStock’s permission model is too restrictive for my current needs. For early development and public demos, I prefer genuinely free stock image sources that allow unrestricted, long-term use without licensing uncertainty.


...

[I deleted the iStock watermarked photo from my PC.]




 


Comments