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