An assortment of scripts and programs that pulls in info from our repositories and puts out a website.
您最多能選擇 25 個主題 主題必須以字母或數字為開頭,可包含連接號「-」且最長為 35 個字元。
 
 
 
 

55 行
2.0 KiB

#! /usr/bin/env python3
# -*- coding: utf-8 -*-
"""
This file is called by generate.bash and will put out part of our website.
It pulls the info directly from the projects metada dict. Therefore we need this to be a python
script.
The projects themselves are oblivious to any html website format and style. We can change the website
at any time as long as the data structures stay the same.
Output is to stdout, we rely on bash piping in generate.bash to write a file.
We expect a directory "temp" on our level with each project as lowercase name:
temp/fluajho
temp/patroneo
etc.
The image file is a static file. At this point in time manually copied into the static/ dir
"""
import sys
project = sys.argv[1]
config = __import__(f"temp.{project}.engine.config", fromlist=["METADATA"])
META = config.METADATA
assert META["shortName"] == project, (META["shortName"], project)
htmlDescription = META["description"].replace("\n\n", "</p>\n\n<p>")
template = f"""<div id="main">
<div class="header">
<h1><img class="pure-img-responsive" src="/images/{META["shortName"]}.png" alt="{META["name"]}"></h1>
</div> <!-- header -->
<div class="content">
<p><img class="pure-img" src="/screenshots/{META["shortName"]}.apng"></p>
<p>{htmlDescription}</p>
<ul>
<li>Current Version: {META["version"]} ({META["year"]})</li>
<li>Multi-Language <a href="/documentation/{META["shortName"]}/">Manual</a></li> <!-- The trailing slash is very important. Otherwise it won't find the images-->
<li>Download: <a href="/downloads/{META["shortName"]}-{META["version"]}.tar.gz">Sourcecode</a> or <a href="/downloads">All Downloads</a></li>
<li>Update Feed <a href="/{META["shortName"]}/feed.atom">ATOM / RSS</a></li>
<li>Git and Developers README: <a href="http://git.laborejo.org/lss/{META["shortName"]}.git">https://git.laborejo.org/lss/{META["shortName"]}.git</a></li>
</ul>
</div> <!-- content -->
</div> <!-- main -->
"""
print (template) #stdout. our job is done