Skip to content

Commit

Permalink
fix: added meta data to generated HTML
Browse files Browse the repository at this point in the history
  • Loading branch information
deltork committed Jun 5, 2024
1 parent bd6635e commit c4cac88
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions readalongs/text/make_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

from lxml import etree

from readalongs._version import __version__
from readalongs.log import LOGGER

JS_BUNDLE_URL = "https://unpkg.com/@readalongs/web-component@^1.4.0/dist/bundle.js"
Expand All @@ -33,6 +34,9 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0">
<meta name="application-name" content="read along">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0">
<meta name="generator" content="@readalongs/studio-cli {studio_version}">
<title>{title}</title>
<script>{js}</script>
<style attribution="See https://fonts.google.com/attribution for copyrights and font attribution">{fonts}</style>
Expand Down Expand Up @@ -164,4 +168,5 @@ def create_web_component_html(
header=header,
subheader=subheader,
theme=theme,
studio_version=__version__,
)
6 changes: 6 additions & 0 deletions readalongs/text/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@

from lxml import etree

from readalongs._version import __version__

# removed "try: unicode() except" block (was for Python 2), but this file uses unicode()
# too many times, so define it anyway.
unicode = str
Expand Down Expand Up @@ -207,6 +209,9 @@ def copy_file_to_zip(zip_path, origin_path, destination_path):
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="application-name" content="read along">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0">
<meta name="generator" content="@readalongs/studio-cli {studio_version}">
<title>{title}</title>
<!-- Import fonts. Material Icons are needed by the web component -->
<link href="https://fonts.googleapis.com/css?family=Lato%7CMaterial+Icons%7CMaterial+Icons+Outlined" rel="stylesheet">
Expand Down Expand Up @@ -245,6 +250,7 @@ def save_minimal_index_html(
header=header,
subheader=subheader,
version=CURRENT_WEB_APP_VERSION,
studio_version=__version__,
)
)

Expand Down

0 comments on commit c4cac88

Please sign in to comment.