Project

General

Profile

Wordpress » History » Version 3

Denis 'GNUtoo' Carikli, 02/26/2024 02:55 PM
Add tutorial to import pages generated with haunt

1 1 Denis 'GNUtoo' Carikli
h1. Wordpress
2
3
h2. Plugins
4
5
| Plugin                             | License | Free software directory review page                                                    |
6
| Akismet Anti-spam: Spam Protection |         |                                                                                        |
7
| Companion Auto Update              |         |                                                                                        |
8
| Post Notification by Email         | GPLv2+  | "Post_Notification_by_Email":https://directory.fsf.org/wiki/Post_Notification_by_Email |
9
10
Replicant also has a modified Post Notification by Email modified by Paul Kocialkowski from version Version 4.1.2 of Post Notification by Email.
11 3 Denis 'GNUtoo' Carikli
12
h2. Research on markdown with Wordpress.
13
14
h2. Using markdown with haunt.
15
16
There is work in progress to migrate the Wordpress blog to a static website that uses markdown. 
17
18
Haunt is a good candidate for that and there was some work to try it out in the "contrib/GNUtoo/haunt-blog":https://git.replicant.us/contrib/GNUtoo/infrastructure/haunt-blog/ repository.
19
20
So until this work is finished, we can still use that work to work on blog posts with a markdown format and then convert that markdown to html suitable for Wordpress.
21
22
To do that, once the HTML page has been created, you can use beautifulsoup to prettify by copy-pasting the html content in a script and running it:
23
<pre>
24
#!/usr/bin/env python3
25
from bs4 import BeautifulSoup
26
html = """<!DOCTYPE html><head><meta charset="utf-8" /><link rel="stylesheet" href="static/twentyeleven-style-20231107.css" /><title>Replicant status and report of the 37C3 and FOSDEM 2024 conferences. โ€” Replicant</title></head><body><header><nav id="access"><ul><li><a href="https://www.replicant.us">Home</a></li><li><a href="https://blog.replicant.us">Blog</a></li><li><a href="https://redmine.replicant.us/projects/replicant/wiki">Wiki</a></li><li><a href="https://redmine.replicant.us/projects/replicant/issues">Tracker</a></li><li><a href="https://redmine.replicant.us/projects/replicant/boards">Forums</a></li></ul></nav></header><h2>Replicant status and report of the 37C3 and FOSDEM 2024 conferences.</h2><div><h1>Replicant current status:</h1><p>The last Replicant release is still based on Android 6.0.</p><p>In the previous years, a lot of work was done to make the Galaxy SIII
27
(GT-I9300) usable with an upstream kernel, both on graphics and on the
28
modem.</p><p>While working on this report we also found that the removal of 3G
29
[...]
30
RAM. And so the fix would be to port / reimplement that feature to
31
make this model usable.</p></li></ul></div></body>"""
32
33
soup = BeautifulSoup(html, 'html.parser')
34
print(soup.prettify())
35
</pre>
36
37
This produces something like that:
38
<pre>
39
<!DOCTYPE html>
40
<head>
41
 <meta charset="utf-8"/>
42
 <link href="static/twentyeleven-style-20231107.css" rel="stylesheet"/>
43
 <title>
44
  Replicant status and report of the 37C3 and FOSDEM 2024 conferences. โ€” Replicant
45
 </title>
46
</head>
47
<body>
48
 <header>
49
  <nav id="access">
50
   <ul>
51
    <li>
52
     <a href="https://www.replicant.us">
53
      Home
54
     </a>
55
    </li>
56
    <li>
57
     <a href="https://blog.replicant.us">
58
      Blog
59
     </a>
60
    </li>
61
    <li>
62
     <a href="https://redmine.replicant.us/projects/replicant/wiki">
63
      Wiki
64
     </a>
65
    </li>
66
    <li>
67
     <a href="https://redmine.replicant.us/projects/replicant/issues">
68
      Tracker
69
     </a>
70
    </li>
71
    <li>
72
     <a href="https://redmine.replicant.us/projects/replicant/boards">
73
      Forums
74
     </a>
75
    </li>
76
   </ul>
77
  </nav>
78
 </header>
79
 <h2>
80
  Replicant status and report of the 37C3 and FOSDEM 2024 conferences.
81
 </h2>
82
 <div>
83
  <h1>
84
   Replicant current status:
85
  </h1>
86
  <p>
87
   The last Replicant release is still based on Android 6.0.
88
  </p>
89
[...]
90
     for
91
the Pinephone only did simple things like setting up udev rules and
92
had simple hacks to make the modem work fine, and he thought that
93
all stability issues were to be handled by Modem Manager
94
instead. But the EC 25 Manager is might also be monitoring the modem
95
and restarting it when it crashed. This could explain modem
96
stability issues with Android / GloDroid on PinePhones with 3GiB of
97
RAM. And so the fix would be to port / reimplement that feature to
98
make this model usable.
99
    </p>
100
   </li>
101
  </ul>
102
 </div>
103
</body>
104
</pre>
105
106
So first add the article title in wordpress, and then you can start switch to the code editor and paste the article starting right after the header and first top level title:
107
<pre>
108
<!DOCTYPE html>
109
<head>
110
 <meta charset="utf-8"/>
111
 <link href="static/twentyeleven-style-20231107.css" rel="stylesheet"/>
112
 <title>
113
  Replicant status and report of the 37C3 and FOSDEM 2024 conferences. โ€” Replicant
114
 </title>
115
</head>
116
<body>
117
 <header>
118
  <nav id="access">
119
   <ul>
120
    <li>
121
     <a href="https://www.replicant.us">
122
      Home
123
     </a>
124
    </li>
125
    <li>
126
     <a href="https://blog.replicant.us">
127
      Blog
128
     </a>
129
    </li>
130
    <li>
131
     <a href="https://redmine.replicant.us/projects/replicant/wiki">
132
      Wiki
133
     </a>
134
    </li>
135
    <li>
136
     <a href="https://redmine.replicant.us/projects/replicant/issues">
137
      Tracker
138
     </a>
139
    </li>
140
    <li>
141
     <a href="https://redmine.replicant.us/projects/replicant/boards">
142
      Forums
143
     </a>
144
    </li>
145
   </ul>
146
  </nav>
147
 </header>
148
 <h2>
149
  Replicant status and report of the 37C3 and FOSDEM 2024 conferences.
150
 </h2>
151
 <div>
152
</pre>
153
154
Also ommit the end:
155
<pre>
156
 </div>
157
</body>
158
</pre>