mirror of
https://gitlab.com/octtspacc/staticoso
synced 2025-06-05 22:09:23 +02:00
Fix ActivityPub mistake; Change style of HTML feed
This commit is contained in:
@ -8,9 +8,9 @@
|
|||||||
| ================================= """
|
| ================================= """
|
||||||
|
|
||||||
import time
|
import time
|
||||||
from Libs.bs4 import BeautifulSoup
|
|
||||||
from Libs.dateutil.parser import parse as date_parse
|
from Libs.dateutil.parser import parse as date_parse
|
||||||
from Libs.mastodon import Mastodon
|
from Libs.mastodon import Mastodon
|
||||||
|
from Modules.HTML import *
|
||||||
from Modules.Utils import *
|
from Modules.Utils import *
|
||||||
|
|
||||||
def MastodonGetSession(InstanceURL, Token):
|
def MastodonGetSession(InstanceURL, Token):
|
||||||
@ -34,7 +34,7 @@ def MastodonDoPost(Session, Text, Lang=None, Visibility='public'):
|
|||||||
visibility=Visibility)
|
visibility=Visibility)
|
||||||
|
|
||||||
def MastodonGetLinkFromPost(Post, Domain=None):
|
def MastodonGetLinkFromPost(Post, Domain=None):
|
||||||
Parse = BeautifulSoup(Post['content'], 'html.parser')
|
Parse = MkSoup(Post['content'])
|
||||||
if Parse.a:
|
if Parse.a:
|
||||||
Link = Parse.find_all('a')[-1]['href']
|
Link = Parse.find_all('a')[-1]['href']
|
||||||
if not Domain or (Domain and Link.startswith(Domain)):
|
if not Domain or (Domain and Link.startswith(Domain)):
|
||||||
|
@ -18,8 +18,8 @@ from Modules.Markdown import *
|
|||||||
from Modules.Pug import *
|
from Modules.Pug import *
|
||||||
from Modules.Utils import *
|
from Modules.Utils import *
|
||||||
|
|
||||||
def GetHTMLPagesList(Pages, BlogName, SiteRoot, PathPrefix, CallbackFile=None, Unite=[], Type=None, Limit=None, PathFilter='', Category=None, For='Menu', MarkdownExts=(), MenuStyle='Default'):
|
def GetHTMLPagesList(Pages, BlogName, SiteRoot, PathPrefix, CallbackFile=None, Unite=[], Type=None, Limit=None, PathFilter='', Category=None, For='Menu', MarkdownExts=(), MenuStyle='Default', ShowPaths=True):
|
||||||
ShowPaths, Flatten, SingleLine, DoneCount = True, False, False, 0
|
Flatten, SingleLine, DoneCount = False, False, 0
|
||||||
if MenuStyle == 'Flat':
|
if MenuStyle == 'Flat':
|
||||||
Flatten = True
|
Flatten = True
|
||||||
elif MenuStyle == 'Line':
|
elif MenuStyle == 'Line':
|
||||||
@ -450,7 +450,8 @@ def HandlePage(Flags, Page, Pages, Categories, LimitFiles, Snippets, ConfMenu, L
|
|||||||
PathPrefix=GetPathLevels(File),
|
PathPrefix=GetPathLevels(File),
|
||||||
For='Categories',
|
For='Categories',
|
||||||
MarkdownExts=MarkdownExts,
|
MarkdownExts=MarkdownExts,
|
||||||
MenuStyle='Flat'))
|
MenuStyle='Flat',
|
||||||
|
ShowPaths=False))
|
||||||
if 'staticoso:DirectoryList:' in HTML: # Reduce risk of unnecessary cycles
|
if 'staticoso:DirectoryList:' in HTML: # Reduce risk of unnecessary cycles
|
||||||
for Line in HTML.splitlines():
|
for Line in HTML.splitlines():
|
||||||
Line = Line.lstrip().rstrip()
|
Line = Line.lstrip().rstrip()
|
||||||
|
Reference in New Issue
Block a user