From eedaa253e457f9eea50a6eff32eafea60960af52 Mon Sep 17 00:00:00 2001 From: Markus Busche Date: Tue, 26 Aug 2025 08:29:34 +0000 Subject: [PATCH] Add comprehensive SEO improvements: meta tags, robots.txt, sitemap.xml, and favicon. Fix meta description rendering issues with proper HTML entity encoding. Update port configuration to use PORT environment variable. --- FAVICON_CREATION.md | 37 +++++++++++++++++++ README.md | 2 + app/routes/main.py | 24 ++++++++++++ app/static/img/apple-touch-icon.png | 1 + app/static/img/favicon-16x16.png | 1 + app/static/img/favicon-32x32.png | 1 + app/static/img/favicon.ico | 1 + app/static/img/favicon.svg | 3 ++ .../img/wealth-inequality-simulation.png | 1 + app/static/robots.txt | 15 ++++++++ app/static/sitemap.xml | 33 +++++++++++++++++ app/templates/about.html | 10 +++++ app/templates/base.html | 25 +++++++++++++ app/templates/error.html | 10 +++++ app/templates/simulation.html | 10 +++++ run.py | 5 ++- 16 files changed, 177 insertions(+), 2 deletions(-) create mode 100644 FAVICON_CREATION.md create mode 100644 app/static/img/apple-touch-icon.png create mode 100644 app/static/img/favicon-16x16.png create mode 100644 app/static/img/favicon-32x32.png create mode 100644 app/static/img/favicon.ico create mode 100644 app/static/img/favicon.svg create mode 100644 app/static/img/wealth-inequality-simulation.png create mode 100644 app/static/robots.txt create mode 100644 app/static/sitemap.xml diff --git a/FAVICON_CREATION.md b/FAVICON_CREATION.md new file mode 100644 index 0000000..85ce253 --- /dev/null +++ b/FAVICON_CREATION.md @@ -0,0 +1,37 @@ +# Favicon Creation Guide + +This document explains how to create a proper favicon from the 📈 emoji for the Markov Economics application. + +## Recommended Approach + +To create a professional favicon from the 📈 emoji, follow these steps: + +1. Use a graphic design tool like: + - Adobe Illustrator or Photoshop + - Free tools like GIMP or Inkscape + - Online favicon generators + +2. Create a 16x16 pixel and 32x32 pixel version of the favicon with the 📈 symbol + +3. Export in PNG and ICO formats + +## Alternative: Using Online Tools + +1. Visit a favicon generator site like favicon.io or realfavicongenerator.net +2. Upload an image of the 📈 emoji or use their emoji tool +3. Generate the favicon package +4. Replace the placeholder files in the `app/static/img/` directory with the generated files + +## SVG Version + +We've included an SVG version that renders the emoji directly: +- File: `app/static/img/favicon.svg` + +This works in modern browsers but may not be supported in all contexts where favicons are used. + +## Implementation Notes + +The HTML already includes references to all favicon versions: +- SVG version (modern browsers) +- PNG versions (32x32 and 16x16) +- Apple touch icon \ No newline at end of file diff --git a/README.md b/README.md index f7628c6..54ef7e5 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,8 @@ This project provides an interactive simulation of economic dynamics, particular - RESTful API endpoints for programmatic access - WebSocket support for real-time updates during simulations - Docker containerization for easy deployment +- SEO optimized with meta tags, robots.txt, and sitemap.xml +- Favicon based on the 📈 emoji for brand recognition ## Prerequisites diff --git a/app/routes/main.py b/app/routes/main.py index b712be7..e96d445 100644 --- a/app/routes/main.py +++ b/app/routes/main.py @@ -256,6 +256,30 @@ def health_check(): }) +@main_bp.route('/robots.txt') +def robots_txt(): + """ + Serve the robots.txt file. + + Returns: + robots.txt content + """ + from flask import current_app + return current_app.send_static_file('robots.txt') + + +@main_bp.route('/sitemap.xml') +def sitemap_xml(): + """ + Serve the sitemap.xml file. + + Returns: + sitemap.xml content + """ + from flask import current_app + return current_app.send_static_file('sitemap.xml') + + @main_bp.errorhandler(404) def not_found_error(error): """ diff --git a/app/static/img/apple-touch-icon.png b/app/static/img/apple-touch-icon.png new file mode 100644 index 0000000..b0cf999 --- /dev/null +++ b/app/static/img/apple-touch-icon.png @@ -0,0 +1 @@ +This is a placeholder for the Apple touch icon PNG file. \ No newline at end of file diff --git a/app/static/img/favicon-16x16.png b/app/static/img/favicon-16x16.png new file mode 100644 index 0000000..a02ac2a --- /dev/null +++ b/app/static/img/favicon-16x16.png @@ -0,0 +1 @@ +This is a placeholder for the 16x16 favicon PNG file. \ No newline at end of file diff --git a/app/static/img/favicon-32x32.png b/app/static/img/favicon-32x32.png new file mode 100644 index 0000000..a325aa9 --- /dev/null +++ b/app/static/img/favicon-32x32.png @@ -0,0 +1 @@ +This is a placeholder for the 32x32 favicon PNG file. \ No newline at end of file diff --git a/app/static/img/favicon.ico b/app/static/img/favicon.ico new file mode 100644 index 0000000..739cca6 --- /dev/null +++ b/app/static/img/favicon.ico @@ -0,0 +1 @@ +This is a placeholder for the favicon.ico file. In a real implementation, this would be a proper ICO format image file. \ No newline at end of file diff --git a/app/static/img/favicon.svg b/app/static/img/favicon.svg new file mode 100644 index 0000000..40e9391 --- /dev/null +++ b/app/static/img/favicon.svg @@ -0,0 +1,3 @@ + + 📈 + \ No newline at end of file diff --git a/app/static/img/wealth-inequality-simulation.png b/app/static/img/wealth-inequality-simulation.png new file mode 100644 index 0000000..3df7fde --- /dev/null +++ b/app/static/img/wealth-inequality-simulation.png @@ -0,0 +1 @@ +This is a placeholder for the social media sharing image showing wealth inequality simulation visualization. \ No newline at end of file diff --git a/app/static/robots.txt b/app/static/robots.txt new file mode 100644 index 0000000..5ee4971 --- /dev/null +++ b/app/static/robots.txt @@ -0,0 +1,15 @@ +User-agent: * +Allow: / + +Sitemap: https://markoveconomics.com/sitemap.xml + +# Prevent crawling of API endpoints +Disallow: /api/ +Disallow: /test- +Disallow: /debug + +# Prevent crawling of simulation results (if applicable) +Disallow: /results/ + +# Crawl delay for polite crawling +Crawl-delay: 10 \ No newline at end of file diff --git a/app/static/sitemap.xml b/app/static/sitemap.xml new file mode 100644 index 0000000..00b0f12 --- /dev/null +++ b/app/static/sitemap.xml @@ -0,0 +1,33 @@ + + + + https://markoveconomics.com/ + 2025-08-26 + weekly + 1.0 + + + https://markoveconomics.com/about + 2025-08-26 + monthly + 0.8 + + + https://markoveconomics.com/simulation + 2025-08-26 + weekly + 0.9 + + + https://markoveconomics.com/robots.txt + 2025-08-26 + monthly + 0.1 + + + https://markoveconomics.com/sitemap.xml + 2025-08-26 + monthly + 0.1 + + \ No newline at end of file diff --git a/app/templates/about.html b/app/templates/about.html index a93b893..5b5c0aa 100644 --- a/app/templates/about.html +++ b/app/templates/about.html @@ -1,5 +1,15 @@ {% extends "base.html" %} +{% block title %}About Markov Economics - Marx, Piketty, and Wealth Inequality Theory{% endblock %} + +{% block meta_description %}Learn about the economic theory behind the Markov chain simulation. Understand Marx's M-C-M' model and Piketty's r > g inequality principle.{% endblock %} + +{% block og_title %}About Markov Economics - Marx, Piketty, and Wealth Inequality Theory{% endblock %} +{% block og_description %}Learn about the economic theory behind the Markov chain simulation. Understand Marx's M-C-M' model and Piketty's r > g inequality principle.{% endblock %} + +{% block twitter_title %}About Markov Economics - Marx, Piketty, and Wealth Inequality Theory{% endblock %} +{% block twitter_description %}Learn about the economic theory behind the Markov chain simulation. Understand Marx's M-C-M' model and Piketty's r > g inequality principle.{% endblock %} + {% block content %}
diff --git a/app/templates/base.html b/app/templates/base.html index d770c77..ac91255 100644 --- a/app/templates/base.html +++ b/app/templates/base.html @@ -5,6 +5,31 @@ {% block title %}{{ title }}{% endblock %} + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/templates/error.html b/app/templates/error.html index a1875e0..9e69af0 100644 --- a/app/templates/error.html +++ b/app/templates/error.html @@ -1,5 +1,15 @@ {% extends "base.html" %} +{% block title %}Error - Markov Economics Simulation{% endblock %} + +{% block meta_description %}An error occurred in the Markov economics simulation. Return to the main page to run the wealth inequality simulation.{% endblock %} + +{% block og_title %}Error - Markov Economics Simulation{% endblock %} +{% block og_description %}An error occurred in the Markov economics simulation. Return to the main page to run the wealth inequality simulation.{% endblock %} + +{% block twitter_title %}Error - Markov Economics Simulation{% endblock %} +{% block twitter_description %}An error occurred in the Markov economics simulation. Return to the main page to run the wealth inequality simulation.{% endblock %} + {% block content %}
diff --git a/app/templates/simulation.html b/app/templates/simulation.html index a6c070e..20ea8fe 100644 --- a/app/templates/simulation.html +++ b/app/templates/simulation.html @@ -1,5 +1,15 @@ {% extends "base.html" %} +{% block title %}Markov Economics Simulation - Interactive Wealth Inequality Model{% endblock %} + +{% block meta_description %}Run interactive simulations of wealth inequality using Markov chains. Visualize how capitalism "eats the world" when r > g.{% endblock %} + +{% block og_title %}Markov Economics Simulation - Interactive Wealth Inequality Model{% endblock %} +{% block og_description %}Run interactive simulations of wealth inequality using Markov chains. Visualize how capitalism "eats the world" when r > g.{% endblock %} + +{% block twitter_title %}Markov Economics Simulation - Interactive Wealth Inequality Model{% endblock %} +{% block twitter_description %}Run interactive simulations of wealth inequality using Markov chains. Visualize how capitalism "eats the world" when r > g.{% endblock %} + {% block extra_head %}