Skip to content

zolika42/godisittes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🧠 How It Works – Simple, Yet Powerful

The GodiSittes website is built as a static site, enhanced with dynamic language support through JavaScript and pre-rendered localized HTML files.

Key Concepts

  • No CMS, no server-side logic.
    Everything is processed at build time – the result is a fast, SEO-friendly, 100% static site.

  • One source HTML per page.
    The source HTML is written in Hungarian, with all translatable text marked using data-i18n attributes.

  • One translations.js file
    This flat object contains key-value pairs for each language. During build, the keys are injected based on data-i18n attributes and metadata (title, meta description, etc.).

  • Language-specific folders (/hu, /en, /de)
    The deploy script creates a localized version of each page under each language folder, maintaining clean URLs and proper <html lang=""> attributes.

  • SEO-friendly routing
    Canonical URLs, hreflang tags, and translated meta content are generated automatically for each language version.

  • Blog support
    Blog posts are treated like static HTML pages, but translated using the same data-i18n system. Simple, yet scalable.

  • Easy to maintain
    You write content once, mark it properly, and the deploy script does the rest. No complex frameworks, no build chains from hell.

Why This Approach?

Because sometimes… simple is smart.
This setup gives you:

  • Fast page loads
  • Full control over every byte
  • Great SEO out of the box
  • Easy versioning and deployment
  • Peace of mind (no runtime errors or dependencies)

No database. No backend. Just pure HTML, JS, and love.
– Zsákos Dzsoni ❤️

GodiSittes Deploy Script

This project uses the deploy.js script to automate the entire build and internationalization pipeline for the static site. It processes translations, minifies assets, builds multilingual HTML files, and generates sitemap and robots.txt.

🚀 What It Automates

  1. Builds translations.node.js for internal JS usage.
  2. Minifies translation filestranslations.min.js
  3. Minifies JavaScriptscript.min.js
  4. Minifies CSSstyle.min.css
  5. Copies all minified assets to the /dist directory.
  6. Processes HTML files (including blog posts):
    • Injects correct translations from translations.js
    • Rewrites titles, meta tags, and canonical URLs
    • Handles language-specific link rewrites and text replacements
    • Supports fallback translation mapping based on original HU strings
  7. Generates localized versions of every HTML file in hu, en, and de subfolders.
  8. Copies static assets, including:
    • The /images folder
    • Optional site.webmanifest
    • Everything inside /favicons/ → copied flat to /dist
  9. Generates sitemap.xml with entries for every language and page
  10. Generates robots.txt
  11. Logs missing translation keys per file and language
  12. Logs unused translation keys to help clean up translations.js
  13. Updates language dropdowns dynamically

ℹ️ The contents of /favicons/ (such as favicon.ico, apple-touch-icon.png, etc.) are copied directly to the root of the /dist folder.
This ensures proper referencing by browsers and social platforms.

📁 Folder Structure

godisittes/
├── .ddev/                         # DDEV config (optional)
├── blog/                          # Source blog articles (HTML)
├── dist/                          # Final output generated by deploy.js
├── favicons/                      # Favicons to be copied into dist/
├── images/                        # Static image assets
├── node_modules/                  # Installed dependencies
├── .htaccess.template             # Apache config (template)
├── 404.html                       # Custom 404 page
├── blog.html                      # Blog post listing page
├── deploy.js                      # Deployment script (magic happens here)
├── index.html                     # Main entry point
├── koszonjuk.html                 # Thank-you/confirmation page
├── package.json                   # Project config & dependencies
├── package-lock.json              # Dependency lock file
├── README.md                      # This file
├── robots.txt                     # Basic robots rules (generated too)
├── script.js                      # Raw JavaScript
├── speechtexts.js                 # Voice message strings
├── style.css                      # Raw CSS
├── translations.js                # Translations (editable)
├── translations.node.js           # Auto-generated version for node usage
├── watch.js                       # Local dev watcher (optional)

💡 The system prioritizes simplicity. There’s no build framework, no bundlers – just vanilla HTML + CSS + JS + a powerful Node.js deploy script.
This keeps deployment blazing fast and ultra-portable (great for shared hosting or basic Apache setups).

📦 Required Modules

Before getting started, make sure Node.js is installed on your system.

Then, install the necessary modules by running:

npm install

To deploy, run:

node deploy.js

⚙️ Apache Configuration – .htaccess and VirtualHost

To serve the GodiSittes static website correctly with language fallback, proper routing, and cache headers, you'll need some custom Apache configuration.

.htaccess Overview

The generated .htaccess file (copied automatically to /dist) enables:

  • Pretty URLs (e.g. /hu/blog.html loads cleanly)
  • Language fallback using /hu, /en, /de folders
  • Static file cache headers
  • 404 fallback to a custom page (/404.html)

Example logic in .htaccess:

# Redirect trailing slash to index.html
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)/$ /$1/index.html [L]

# Fallback to 404.html for missing files
ErrorDocument 404 /404.html

This is generated by the deploy.js script – you don’t need to write it manually.


Apache VirtualHost Example

Here is a basic VirtualHost setup that works well with the /dist output:

<VirtualHost *:443>
ServerName godisittes.hu
DocumentRoot /var/www/godisittes/dist

    SSLEngine on
    SSLCertificateFile      /etc/letsencrypt/live/godisittes.hu/fullchain.pem
    SSLCertificateKeyFile   /etc/letsencrypt/live/godisittes.hu/privkey.pem
    Include                 /etc/letsencrypt/options-ssl-apache.conf

    <Directory /var/www/godisittes/dist>
        Options -Indexes +FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>

    # Compression
    <IfModule mod_deflate.c>
        AddOutputFilterByType DEFLATE text/html text/plain text/css application/javascript
    </IfModule>

    # Cache control
    <IfModule mod_expires.c>
        ExpiresActive on
        ExpiresDefault "access plus 5 days"
        ExpiresByType text/css "access plus 1 year"
        ExpiresByType application/javascript "access plus 1 year"
        ExpiresByType image/webp "access plus 1 year"
        ExpiresByType image/png "access plus 1 year"
    </IfModule>

    # Security headers
    Header always set Strict-Transport-Security "max-age=63072000; includeSubDomains; preload"
    Header always set X-Content-Type-Options "nosniff"
    Header always set X-Frame-Options "SAMEORIGIN"
    Header always set X-XSS-Protection "1; mode=block"
    Header always set Referrer-Policy "strict-origin-when-cross-origin"
</VirtualHost>

Tip: For full redirect logic (e.g. from www. and http to https://godisittes.hu), check out the included vhost.conf in the project.

The deploy script expects /dist to be the document root. Make sure Apache points there.


And that’s it! 🎉 You now have a fully internationalized, ultra-fast static website with server-side support – no framework bloat required.

🎨 Design Inspiration

These two pages inspired the visual style:

🙏 Eternal Thanks

Special thanks to:


📝 License

This project is released under a permissive open license.

You are free to:

  • Use it
  • Modify it
  • Distribute it
  • Integrate it into your own projects

…as long as you credit the original author.
Please include the following attribution somewhere in your project or documentation:

Created by Zoltán Horváth – https://beyondstart.solutions/

Let’s keep the web simple, fast, and clean – together.