🔧 site url
This commit is contained in:
3
app.py
3
app.py
@@ -2,7 +2,7 @@ import os
|
|||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from flask import Flask, render_template, abort, jsonify, request
|
from flask import Flask, render_template, abort, jsonify, request
|
||||||
from comics_data import (
|
from comics_data import (
|
||||||
COMICS, COMIC_NAME, FULL_WIDTH_DEFAULT, PLAIN_DEFAULT, HEADER_IMAGE, FOOTER_IMAGE,
|
COMICS, COMIC_NAME, SITE_URL, FULL_WIDTH_DEFAULT, PLAIN_DEFAULT, HEADER_IMAGE, FOOTER_IMAGE,
|
||||||
COMPACT_FOOTER, ARCHIVE_FULL_WIDTH, USE_COMIC_NAV_ICONS, USE_HEADER_NAV_ICONS,
|
COMPACT_FOOTER, ARCHIVE_FULL_WIDTH, USE_COMIC_NAV_ICONS, USE_HEADER_NAV_ICONS,
|
||||||
USE_FOOTER_SOCIAL_ICONS, SOCIAL_INSTAGRAM, SOCIAL_YOUTUBE, SOCIAL_EMAIL,
|
USE_FOOTER_SOCIAL_ICONS, SOCIAL_INSTAGRAM, SOCIAL_YOUTUBE, SOCIAL_EMAIL,
|
||||||
API_SPEC_LINK
|
API_SPEC_LINK
|
||||||
@@ -20,6 +20,7 @@ def inject_global_settings():
|
|||||||
"""Make global settings available to all templates"""
|
"""Make global settings available to all templates"""
|
||||||
return {
|
return {
|
||||||
'comic_name': COMIC_NAME,
|
'comic_name': COMIC_NAME,
|
||||||
|
'site_url': SITE_URL,
|
||||||
'header_image': HEADER_IMAGE,
|
'header_image': HEADER_IMAGE,
|
||||||
'footer_image': FOOTER_IMAGE,
|
'footer_image': FOOTER_IMAGE,
|
||||||
'compact_footer': COMPACT_FOOTER,
|
'compact_footer': COMPACT_FOOTER,
|
||||||
|
|||||||
@@ -4,6 +4,10 @@
|
|||||||
# Global setting: The name of your comic/website
|
# Global setting: The name of your comic/website
|
||||||
COMIC_NAME = 'Sunday Comics'
|
COMIC_NAME = 'Sunday Comics'
|
||||||
|
|
||||||
|
# Global setting: Your website's domain (used for RSS feed, Open Graph tags, etc.)
|
||||||
|
# Update this to your production domain when deploying
|
||||||
|
SITE_URL = 'http://localhost:3000'
|
||||||
|
|
||||||
# Global setting: Set to True to make all comics full-width by default
|
# Global setting: Set to True to make all comics full-width by default
|
||||||
# Individual comics can override this with 'full_width': False
|
# Individual comics can override this with 'full_width': False
|
||||||
FULL_WIDTH_DEFAULT = False
|
FULL_WIDTH_DEFAULT = False
|
||||||
|
|||||||
@@ -10,10 +10,9 @@ from xml.dom import minidom
|
|||||||
|
|
||||||
# Add parent directory to path so we can import comics_data
|
# Add parent directory to path so we can import comics_data
|
||||||
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||||
from comics_data import COMICS, COMIC_NAME
|
from comics_data import COMICS, COMIC_NAME, SITE_URL
|
||||||
|
|
||||||
# Configuration - update these for your site
|
# Configuration
|
||||||
SITE_URL = "http://localhost:3000" # Change to your actual domain
|
|
||||||
SITE_TITLE = COMIC_NAME
|
SITE_TITLE = COMIC_NAME
|
||||||
SITE_DESCRIPTION = "A webcomic about life, the universe, and everything"
|
SITE_DESCRIPTION = "A webcomic about life, the universe, and everything"
|
||||||
SITE_LANGUAGE = "en-us"
|
SITE_LANGUAGE = "en-us"
|
||||||
|
|||||||
@@ -10,10 +10,10 @@
|
|||||||
|
|
||||||
<!-- Open Graph / Facebook -->
|
<!-- Open Graph / Facebook -->
|
||||||
<meta property="og:type" content="website">
|
<meta property="og:type" content="website">
|
||||||
<meta property="og:url" content="{% block meta_url %}{{ request.url }}{% endblock %}">
|
<meta property="og:url" content="{% block meta_url %}{{ site_url }}{{ request.path }}{% endblock %}">
|
||||||
<meta property="og:title" content="{% block og_title %}{{ self.title() }} - {{ comic_name }}{% endblock %}">
|
<meta property="og:title" content="{% block og_title %}{{ self.title() }} - {{ comic_name }}{% endblock %}">
|
||||||
<meta property="og:description" content="{% block og_description %}{{ self.meta_description() }}{% endblock %}">
|
<meta property="og:description" content="{% block og_description %}{{ self.meta_description() }}{% endblock %}">
|
||||||
<meta property="og:image" content="{% block og_image %}{{ request.url_root }}static/images/default-preview.png{% endblock %}">
|
<meta property="og:image" content="{% block og_image %}{{ site_url }}/static/images/default-preview.png{% endblock %}">
|
||||||
|
|
||||||
<!-- Twitter -->
|
<!-- Twitter -->
|
||||||
<meta property="twitter:card" content="summary_large_image">
|
<meta property="twitter:card" content="summary_large_image">
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
{% block meta_description %}{{ comic.alt_text }}{% if comic.author_note %} - {{ comic.author_note }}{% endif %}{% endblock %}
|
{% block meta_description %}{{ comic.alt_text }}{% if comic.author_note %} - {{ comic.author_note }}{% endif %}{% endblock %}
|
||||||
|
|
||||||
{% block og_image %}{{ request.url_root }}static/images/thumbs/{{ comic.filename }}{% endblock %}
|
{% block og_image %}{{ site_url }}/static/images/thumbs/{{ comic.filename }}{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<div class="comic-container{% if comic.full_width %} comic-container-fullwidth{% endif %}{% if comic.plain %} comic-container-plain{% endif %}" data-comic-number="{{ comic.number }}" data-total-comics="{{ total_comics }}">
|
<div class="comic-container{% if comic.full_width %} comic-container-fullwidth{% endif %}{% if comic.plain %} comic-container-plain{% endif %}" data-comic-number="{{ comic.number }}" data-total-comics="{{ total_comics }}">
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
{% if comic %}
|
{% if comic %}
|
||||||
{% block meta_description %}{{ comic.alt_text }}{% if comic.author_note %} - {{ comic.author_note }}{% endif %}{% endblock %}
|
{% block meta_description %}{{ comic.alt_text }}{% if comic.author_note %} - {{ comic.author_note }}{% endif %}{% endblock %}
|
||||||
|
|
||||||
{% block og_image %}{{ request.url_root }}static/images/thumbs/{{ comic.filename }}{% endblock %}
|
{% block og_image %}{{ site_url }}/static/images/thumbs/{{ comic.filename }}{% endblock %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|||||||
Reference in New Issue
Block a user