broken at this moment! Trying to get articles into order. The problem is that I only put date into article_dictionary but need the time also to sort articles by creation.
This commit is contained in:
parent
64da3357c1
commit
f3169226c2
|
@ -35,58 +35,17 @@
|
|||
<h1>Artikel</h1>
|
||||
<article>
|
||||
<header>
|
||||
<h1>Ein zweiter Test!</h1>
|
||||
<h1>This is the first article</h1>
|
||||
<dl>
|
||||
<dt>Autor</dt><dd>homer77</dd>
|
||||
<dt>Erstellt am</dt><dd>02/15/15</dd>
|
||||
<dt>Zuletzt geändert</dt><dd>02/15/15</dd>
|
||||
<dt>Erstellt am</dt><dd>03/01/15</dd>
|
||||
<dt>Zuletzt geändert</dt><dd>03/01/15</dd>
|
||||
</dl>
|
||||
</header>
|
||||
<h1>Das ist ein weiter Testartikel</h1>
|
||||
<h2>Ich muss das abschließen für heute</h2>
|
||||
<p><a href="https://example.org">Klick mich</a></p>
|
||||
<p>This is the <em>first article</em> in this blog. <strong>picoblogger</strong> supports basic features of markdown as tested on another instance.</p>
|
||||
<p>Unfortunately it does not seem to work with list - neither ordererd nor unordered. But <a href="http://localhost">links</a> actually do work fine.</p>
|
||||
<footer>
|
||||
<p> </p>
|
||||
</footer>
|
||||
</article>
|
||||
<article>
|
||||
<header>
|
||||
<h1>Das ist der zweite Artikel</h1>
|
||||
<dl>
|
||||
<dt>Autor</dt><dd>homer77</dd>
|
||||
<dt>Erstellt am</dt><dd>02/24/15</dd>
|
||||
<dt>Zuletzt geändert</dt><dd>02/24/15</dd>
|
||||
</dl>
|
||||
</header>
|
||||
<p>Dies ist der zweite Test.
|
||||
Ich schreibe verschiedene Zeilen Text und teste damit <strong>Markdown</strong></p>
|
||||
<p>Ist das jetzt ein neuer <em>Absatz</em>?</p>
|
||||
<p>Und wie kann ich Code-Blöcke wie <code>apt-get install</code> einfügen? Funktioniert das mit 3 oder 4 Backticks?</p>
|
||||
<p><code>Gehen auch
|
||||
mehrere
|
||||
Code-zeilen?</code></p>
|
||||
<p>Und was ist mit Listen?
|
||||
- Erster Eintrag
|
||||
- Zweiter Eintrag
|
||||
- Erster Untereintrag
|
||||
- Dritter Eintrag</p>
|
||||
<footer>
|
||||
<p>lustig,langweilig,blabla</p>
|
||||
</footer>
|
||||
</article>
|
||||
<article>
|
||||
<header>
|
||||
<h1>Dies ist ein Test</h1>
|
||||
<dl>
|
||||
<dt>Autor</dt><dd>homer77</dd>
|
||||
<dt>Erstellt am</dt><dd>02/15/15</dd>
|
||||
<dt>Zuletzt geändert</dt><dd>02/15/15</dd>
|
||||
</dl>
|
||||
</header>
|
||||
<h1>Type your article <em>right here</em>.</h1>
|
||||
<p>You may use <em>Markdown</em> to format.</p>
|
||||
<footer>
|
||||
<p>test,picoblogger,coden</p>
|
||||
<p>notags</p>
|
||||
</footer>
|
||||
</article>
|
||||
|
||||
|
|
|
@ -173,9 +173,15 @@ def article_to_html(article_dict):
|
|||
def join_articles():
|
||||
artDir = os.path.join(blog_dir,"articles")
|
||||
joined_html = ""
|
||||
|
||||
articles_dict = {}
|
||||
for name in [os.path.splitext(item)[0] for item in os.listdir(draftDir) if not "\~" in item]:
|
||||
joined_html += article_to_html(parse_article(os.path.join(artDir, name + ".txt")))
|
||||
article = (parse_article(os.path.join(artDir, name + ".txt")))
|
||||
time = time.strptime(article['DATE'] + " " + article['time']
|
||||
articles_dict[] = article
|
||||
dates_of_creation = [value for value in articles_dict.keys()]
|
||||
print(dates_of_creation)
|
||||
for date in dates_of_creation:
|
||||
joined_html += article_to_html(articles_dict[date])
|
||||
|
||||
return joined_html
|
||||
|
||||
|
|
Loading…
Reference in New Issue