/astro-tailwind-site

Astro framework used with Tailwind styling to create SEO and Pagespeed-optimised website

Primary LanguageAstroMIT LicenseMIT

⚑ Astro Tailwind Site

  • Astro Tailwind CSS static website to market a holiday home with excellent SEO & lighthouse score
  • Note: to open web links in a new window use: ctrl+click on link

GitHub repo size GitHub pull requests GitHub Repo stars GitHub last commit

πŸ“„ Table of contents

πŸ“š General info

  • Built with Astro framework, CSS and JavaScript with Bootstrap 5 CSS and Javascript
  • Server-Side Rendering for very fast content rendering, minimal javascript and no need for a backend server
  • TBA...Perfect performance, Perfect scores on accessibility, best practices and SEO.
  • Image Optimization (using new Astro Assets and Unpic for Universal image CDN).
  • Generation of project sitemap based on your routes.
  • Analytics built-in Google Analytics, and Splitbee integration.
  • CSS and Javascript are minimised to reduce initial render/First Contentful Paint time.

πŸ“· Screenshots

Example screenshot.

πŸ“Ά Technology

πŸ’Ύ Setup

Command Action
npm install Installs dependencies
npm run dev Starts local dev server at localhost:3000
npm run build Build your production site to ./dist/
npm run preview Preview your build locally, before deploying
npm run format Format codes with Prettier
npm run lint:eslint Run Eslint
npm run astro ... Run CLI commands like astro add, astro preview

πŸ’» Code Examples

  • tba
          <div class="carousel-item active">
            <picture>
              <source
                type="image/webp"
                class="d-block w-100"
                srcset="./images/bg/house-front.webp"
                alt="house front view"
              />
              <source
                type="image/jpeg"
                class="d-block w-100"
                srcset="/images/bg/house-front.jpg"
                alt="house front view"
              />
              <img
                src="/images/bg/house-front.jpg"
                class="d-block w-100"
                alt="house front view"
              />
            </picture>
            <div class="carousel-caption col-md-6 col-10 col-offset-md-6">
              <h1>Terracota</h1>
              <p class="carousel-image-text">
                Una vivienda moderna, muy bien equipada y muy confortable. En
                este alojamiento se respira tranquilidad: Β‘relΓ‘jate con toda la
                familia!
              </p>
            </div>
          </div>

Project structure

/
β”œβ”€β”€ public/
β”‚   β”œβ”€β”€ _headers
β”‚   └── robots.txt
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ assets/
β”‚   β”‚   β”œβ”€β”€ favicons/
β”‚   β”‚   β”œβ”€β”€ images/
β”‚   β”‚   └── styles/
β”‚   β”‚       └── tailwind.css
β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”œβ”€β”€ blog/
β”‚   β”‚   β”œβ”€β”€ common/
β”‚   β”‚   β”œβ”€β”€ ui/
β”‚   β”‚   β”œβ”€β”€ widgets/
β”‚   β”‚   β”‚   β”œβ”€β”€ Header.astro
β”‚   β”‚   β”‚   └── ...
β”‚   β”‚   β”œβ”€β”€ CustomStyles.astro
β”‚   β”‚   β”œβ”€β”€ Favicons.astro
β”‚   β”‚   └── Logo.astro
β”‚   β”œβ”€β”€ content/
β”‚   β”‚   β”œβ”€β”€ post/
β”‚   β”‚   β”‚   β”œβ”€β”€ post-slug-1.md
β”‚   β”‚   β”‚   β”œβ”€β”€ post-slug-2.mdx
β”‚   β”‚   β”‚   └── ...
β”‚   β”‚   β””-- config.ts
β”‚   β”œβ”€β”€ layouts/
β”‚   β”‚   β”œβ”€β”€ Layout.astro
β”‚   β”‚   β”œβ”€β”€ MarkdownLayout.astro
β”‚   β”‚   └── PageLayout.astro
β”‚   β”œβ”€β”€ pages/
β”‚   β”‚   β”œβ”€β”€ [...blog]/
β”‚   β”‚   β”‚   β”œβ”€β”€ [category]/
β”‚   β”‚   β”‚   β”œβ”€β”€ [tag]/
β”‚   β”‚   β”‚   β”œβ”€β”€ [...page].astro
β”‚   β”‚   β”‚   └── index.astro
β”‚   β”‚   β”œβ”€β”€ index.astro
β”‚   β”‚   β”œβ”€β”€ 404.astro
β”‚   β”‚   β”œ-- rss.xml.ts
β”‚   β”‚   └── ...
β”‚   β”œβ”€β”€ utils/
β”‚   β”œβ”€β”€ config.yaml
β”‚   └── navigation.js
β”œβ”€β”€ package.json
β”œβ”€β”€ astro.config.mjs
└── ...

πŸ†’ Features

  • Lighthouse score & pagespeed perfect
  • Simple routing..Astro looks for .astro or .md files in the src/pages/ directory. Each page is exposed as a route based on its file name.

πŸ“‹ Status & To-Do List

  • Status: In work
  • To-Do: Add sections: header, footer, inicio, acerca, fotos, ubicacion, zona, contacto.

πŸ‘ Inspiration

πŸ“ License

  • This project is licensed under the MIT License - see the LICENSE file for details.

βœ‰οΈ Contact

  • Repo created by ABateman, email: gomezbateman@yahoo.com
  • Connect with me on LinkedIn, Twitter or GitHub
  • Open issues for feedback and suggestions or to report any bugs or errors. Contributions are welcome!