Add file favicon.ico.

This commit is contained in:
Schimon Jehudah, Adv. 2024-07-09 18:17:18 +03:00
parent d8c114277a
commit 12a0628767
5 changed files with 36 additions and 4 deletions

View file

@ -108,6 +108,6 @@ Special thanks to "d3x" and "cchianel" from IRC channel #python on irc.libera.ch
## Similar Projects ## Similar Projects
* [AtomEntry](https://github.com/tigase/sureim/blob/master/site/src/main/java/tigase/sure/web/site/client/pubsub/AtomEntry.java) and [PubSubPublishViewImpl](https://github.com/tigase/sureim/blob/master/site/src/main/java/tigase/sure/web/site/client/pubsub/PubSubPublishViewImpl.java)- Convert XMPP Pubsub Nodes to Atom Syndication Format and convey them over HTTP. * [AtomEntry](https://github.com/tigase/sureim/blob/master/site/src/main/java/tigase/sure/web/site/client/pubsub/AtomEntry.java) and [PubSubPublishViewImpl](https://github.com/tigase/sureim/blob/master/site/src/main/java/tigase/sure/web/site/client/pubsub/PubSubPublishViewImpl.java) - Convert XMPP Pubsub Nodes to Atom Syndication Format and convey them over HTTP.
* [AtomToPubsub](https://github.com/edhelas/atomtopubsub) - A little client that parses Atom + RSS feeds and send them on XMPP Pubsub Nodes. * [AtomToPubsub](https://github.com/edhelas/atomtopubsub) - A little client that parses Atom + RSS feeds and send them on XMPP Pubsub Nodes.

BIN
favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

26
graphic/xmpp.svg Normal file
View file

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Generator: Adobe Illustrator 13.0.2, SVG Export Plug-In . SVG Version: 6.00 Build 14948) -->
<!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" xml:space="preserve" viewBox="0 0 200 200" width="200px" height="200px" x="0px" y="0px" enable-background="new 0 0 200 200">
<linearGradient id="SVGID_right_" y2="1.279e-13" gradientUnits="userSpaceOnUse" x2="-1073.2" gradientTransform="translate(1196.604,37.368977)" y1="126.85" x1="-1073.2">
<stop stop-color="#1b3967" offset=".011" />
<stop stop-color="#13b5ea" offset=".467" />
<stop stop-color="#002b5c" offset=".9945" />
</linearGradient>
<linearGradient id="SVGID_left_" y2="1.279e-13" gradientUnits="userSpaceOnUse" x2="-1073.2" gradientTransform="matrix(-1,0,0,1,-994.78801,37.367977)" y1="126.85" x1="-1073.2">
<stop stop-color="#1b3967" offset=".011" />
<stop stop-color="#13b5ea" offset=".467" />
<stop stop-color="#002b5c" offset=".9945" />
</linearGradient>
<path d="m 151.80512,51.557978 c 0.077,1.313 -1.787,0.968 -1.787,2.293 0,38.551002 -46.558,97.366012 -91.687985,108.730012 v 1.639 C 118.28313,158.69999 186.89012,96.41998 188.40012,37.369977 l -36.599,14.189001 z" style="fill:url(#SVGID_right_)" />
<path d="m 133.67312,56.300978 c 0.076,1.313 0.12,2.63 0.12,3.957 0,38.551002 -30.69898,90.497012 -75.826985,101.860012 v 1.639 c 59.044005,-2.79 105.809995,-63.02401 105.809995,-109.200012 0,-2.375 -0.128,-4.729 -0.371,-7.056 l -29.73,8.798 z" style="fill:#e96d1f" />
<path d="m 163.69112,46.951978 -7.61699,2.722 c 0.041,0.962 0.066,2.254 0.066,3.225 0,41.219002 -37.271,98.204012 -87.271995,107.120012 -3.24501,1.088 -7.53801,2.077 -10.932,2.931 v 1.638 C 123.19013,159.02799 169.03613,92.72198 163.69612,46.947978 Z" style="fill:#d9541e" />
<path d="m 50.011,51.556978 c -0.077,1.313 1.787,0.968 1.787,2.293 0,38.551002 46.558007,97.366012 91.68799,108.730012 v 1.639 C 83.533,158.69899 14.926,96.41898 13.416,37.368977 l 36.599,14.189001 z" style="fill:url(#SVGID_left_)" />
<path d="m 68.143,56.299978 c -0.076,1.313 -0.12,2.63 -0.12,3.957 0,38.551002 30.698995,90.497012 75.82699,101.860012 v 1.639 C 84.806,160.96599 38.04,100.73198 38.04,54.555978 c 0,-2.375 0.128,-4.729 0.371,-7.056 l 29.73,8.798 z" style="fill:#a0ce67" />
<path d="m 38.125,46.950978 7.617,2.722 c -0.041,0.962 -0.066,2.254 -0.066,3.225 0,41.219002 37.271,98.204012 87.27199,107.120012 3.245,1.088 7.538,2.077 10.932,2.931 v 1.638 C 78.626,159.02699 32.78,92.72098 38.12,46.946978 Z" style="fill:#439639" />
</svg>

After

Width:  |  Height:  |  Size: 2.6 KiB

View file

@ -3,6 +3,7 @@
#import datetime #import datetime
from fastapi import FastAPI, Request, Response from fastapi import FastAPI, Request, Response
from fastapi.responses import FileResponse
from fastapi.staticfiles import StaticFiles from fastapi.staticfiles import StaticFiles
import feedgenerator import feedgenerator
from slixmpp import ClientXMPP from slixmpp import ClientXMPP
@ -25,11 +26,15 @@ class XmppInstance(ClientXMPP):
xmpp = None xmpp = None
# Mount static scripts and stylesheet directories # Mount static graphic, script and stylesheet directories
app.mount("/css", StaticFiles(directory="css"), name="css") app.mount("/css", StaticFiles(directory="css"), name="css")
app.mount("/graphic", StaticFiles(directory="graphic"), name="graphic")
app.mount("/script", StaticFiles(directory="script"), name="script") app.mount("/script", StaticFiles(directory="script"), name="script")
app.mount("/xsl", StaticFiles(directory="xsl"), name="xsl") app.mount("/xsl", StaticFiles(directory="xsl"), name="xsl")
@app.get('/favicon.ico', include_in_schema=False)
async def favicon():
return FileResponse('favicon.ico')
@app.get('/atom') @app.get('/atom')
async def view_pubsub(request: Request): async def view_pubsub(request: Request):
@ -65,7 +70,7 @@ async def view_pubsub(request: Request):
'optional parameter Node are missing.') 'optional parameter Node are missing.')
return Response(content=result, media_type="application/xml") return Response(content=result, media_type="application/xml")
def pubsub_to_atom(iq,link): def pubsub_to_atom(iq, link):
"""Convert XEP-0060: Publish-Subscribe to RFC 4287: The Atom Syndication Format.""" """Convert XEP-0060: Publish-Subscribe to RFC 4287: The Atom Syndication Format."""
feed = feedgenerator.Atom1Feed( feed = feedgenerator.Atom1Feed(
description = ('This is a syndication feed generated with PubSub to ' description = ('This is a syndication feed generated with PubSub to '
@ -82,7 +87,7 @@ def pubsub_to_atom(iq,link):
namespace = '{http://www.w3.org/2005/Atom}' namespace = '{http://www.w3.org/2005/Atom}'
title = item.find(namespace + 'title') title = item.find(namespace + 'title')
title = None if title == None else title.text title = None if title == None else title.text
feed_url = 'sch' feed_url = 'gemini://schimon.i2p/'
updated = item.find(namespace + 'updated') updated = item.find(namespace + 'updated')
updated = None if updated == None else updated.text updated = None if updated == None else updated.text
# if updated: updated = datetime.datetime.fromisoformat(updated) # if updated: updated = datetime.datetime.fromisoformat(updated)

View file

@ -54,6 +54,7 @@ xmlns:atom='http://www.w3.org/2005/Atom'>
</title> </title>
<!-- TODO media='print' --> <!-- TODO media='print' -->
<link href='/css/stylesheet.css' rel='stylesheet' type='text/css' media='screen'/> <link href='/css/stylesheet.css' rel='stylesheet' type='text/css' media='screen'/>
<link rel='icon' type='image/svg+xml' href='/graphic/xmpp.svg'/>
<!-- whether language code is of direction right-to-left --> <!-- whether language code is of direction right-to-left -->
<xsl:if test='$rtl'> <xsl:if test='$rtl'>
<link id='semitic' href='/css/stylesheet-rtl.css' rel='stylesheet' type='text/css' /> <link id='semitic' href='/css/stylesheet-rtl.css' rel='stylesheet' type='text/css' />