Browse Source

added the missing line (loop through pages) that makes the stream plugin work

master
mb @ ts 2 years ago
parent
commit
5364009530
1 changed files with 7 additions and 6 deletions
  1. 7
    6
      stream/stream.py

+ 7
- 6
stream/stream.py View File

@@ -4,13 +4,14 @@
4 4
 from pelican import signals
5 5
 from os import listdir
6 6
 from os.path import isfile, join
7
+# import os
7 8
 
8
-def getStream(page):
9
-	dir = 'content/stream'
10
-	images = [f for f in listdir(dir) if isfile(join(dir, f))]
11
-	print('>>> The stream is streaming!', images)
12
-	page.stream = 'jaja'
9
+def getStream(generator):
10
+	for page in generator.pages:
11
+		dir = "/var/www/stream"
12
+		images = [f for f in listdir(dir) if isfile(join(dir, f))]
13
+		print('>>> The stream is streaming!', images)
14
+		page.stream = images
13 15
 
14 16
 def register():
15 17
 	signals.page_generator_finalized.connect(getStream)
16
-	# signals.article_generator_finalized.connect(getStream)

Loading…
Cancel
Save