add proper title to generated html
This commit is contained in:
@@ -2,6 +2,8 @@
|
|||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
|
|
||||||
|
<title>{title}</title>
|
||||||
|
|
||||||
<meta name="generator" content="Minecraft-Overviewer {version}" />
|
<meta name="generator" content="Minecraft-Overviewer {version}" />
|
||||||
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
|
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
|
||||||
|
|
||||||
|
|||||||
@@ -154,6 +154,7 @@ class MapGen(object):
|
|||||||
indexpath = os.path.join(self.destdir, "index.html")
|
indexpath = os.path.join(self.destdir, "index.html")
|
||||||
|
|
||||||
index = open(indexpath, 'r').read()
|
index = open(indexpath, 'r').read()
|
||||||
|
index = index.replace("{title}", "Minecraft Overviewer: %s" % self.world.name)
|
||||||
index = index.replace("{time}", str(strftime("%a, %d %b %Y %H:%M:%S %Z", localtime())))
|
index = index.replace("{time}", str(strftime("%a, %d %b %Y %H:%M:%S %Z", localtime())))
|
||||||
versionstr = "%s (%s)" % (overviewer_version.VERSION, overviewer_version.HASH[:7])
|
versionstr = "%s (%s)" % (overviewer_version.VERSION, overviewer_version.HASH[:7])
|
||||||
index = index.replace("{version}", versionstr)
|
index = index.replace("{version}", versionstr)
|
||||||
|
|||||||
@@ -81,6 +81,12 @@ class World(object):
|
|||||||
if not ('version' in data and data['version'] == 19132):
|
if not ('version' in data and data['version'] == 19132):
|
||||||
logging.error("Sorry, This version of Minecraft-Overviewer only works with the new McRegion chunk format")
|
logging.error("Sorry, This version of Minecraft-Overviewer only works with the new McRegion chunk format")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
if 'LevelName' in data:
|
||||||
|
# level.dat should have the LevelName attribute so we'll use that
|
||||||
|
self.name = data['LevelName']
|
||||||
|
else:
|
||||||
|
# but very old ones might not? so we'll just go with the world dir name if they don't
|
||||||
|
self.name = os.path.basename(os.path.realpath(self.worlddir))
|
||||||
|
|
||||||
# stores Points Of Interest to be mapped with markers
|
# stores Points Of Interest to be mapped with markers
|
||||||
# a list of dictionaries, see below for an example
|
# a list of dictionaries, see below for an example
|
||||||
|
|||||||
Reference in New Issue
Block a user