[git] gnupg-doc - branch, preview, updated. 8f5607a7768f76cddf8bf66056b35e582601d52a

by Werner Koch cvs at cvs.gnupg.org
Wed May 3 15:54:52 CEST 2017


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The GnuPG website and other docs".

The branch, preview has been updated
       via  8f5607a7768f76cddf8bf66056b35e582601d52a (commit)
      from  99318e6ea1fa5c07c4f8829cd71ae92344d1c144 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 8f5607a7768f76cddf8bf66056b35e582601d52a
Author: Werner Koch <wk at gnupg.org>
Date:   Wed May 3 15:51:49 2017 +0200

    web: Fix hack and insert even less boiler plate

diff --git a/web/donate/index.org b/web/donate/index.org
index de59bf1..0dfc064 100644
--- a/web/donate/index.org
+++ b/web/donate/index.org
@@ -5,21 +5,14 @@
 # Note: Do not use relative links because this page is also used as a
 #       template from cgi-bin/.  Using https://www.gnupg.org/... is
 #       fine as it is stripped before publishing.
-# Note: These special comments are used
-#       custom-head-section - Neither a meta tag for a stylesheet is
-#                             inserted nor the </head> and <body>.
-#       disable-menu - No menu is generated.
 
 #+BEGIN_HTML
-<!--custom-head-section->
+<!--custom-page-->  <!-- this disables all standard processing. -->
 <link rel="stylesheet" href="/share/site.css" type="text/css" />
 </head>
 <body>
-<!--disable-menu-->
 
 
-<!-- Write whatever HTML code you like -->
-
   <!--ERRORPANEL-->
 
   <form action="/cgi-bin/procdonate.cgi" method="post" class="inputpanel">
@@ -143,11 +136,8 @@
   </form>
 
 
-#+END_HTML
-
-** Recent donors
+<p>Recent donors</p>
 
-#+BEGIN_HTML
 <div id="tagcloudlist"><ul>
 <!--BEGIN-SOME-DONATIONS-->
 <!--END-SOME-DONATIONS-->
@@ -158,6 +148,10 @@
 : 
 <!--INSERT-YEAR-EURO-->
 </p>
+
+
+</body>
+</html>
 #+END_HTML
 
 # eof #
diff --git a/web/share/gpgweb.el b/web/share/gpgweb.el
index 46bbcdd..892eab5 100644
--- a/web/share/gpgweb.el
+++ b/web/share/gpgweb.el
@@ -57,11 +57,11 @@
                                  'noerror)))))
 
 
-(defun gpgweb-insert-header (title committed-at)
+(defun gpgweb-insert-header (title committed-at custom)
   "Insert the header.
 
 COMMITTED-AT is the commit date string of the source file or nil
-if not available."
+if not available.  If CUSTOM is true only a minimal header is set."
   (goto-char (point-min))
   (insert "<?xml version=\"1.0\" encoding=\"utf-8\"?>
 <!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"
@@ -82,9 +82,7 @@ if not available."
 <meta name=\"DC.Identifier\" content=\"https://gnupg.org/\" />
 <meta name=\"DC.Rights\" content=\"https://gnupg.org/copying.html\" />
 ")
-(goto-char (point-min))
-(unless (search-forward "<!--custom-head-section-->" nil t)
- (goto point-max)
+(unless custom
  (insert "<link rel=\"stylesheet\" href=\"/share/site.css\" type=\"text/css\" />
 </head>
 <body>
@@ -379,6 +377,17 @@ buffer into read-write mode so that it works with read-only files."
 	 title)))))
 
 
+(defun gpgweb-want-custom-page-p ()
+  "Return true if the current buffer indicated that it wants to
+be a custom page."
+  (let ((savepoint (point))
+        (result))
+    (goto-char (point-min))
+    (setq result (not (not (search-forward "<!--custom-page-->" nil t))))
+    (goto-char savepoint)
+    result))
+
+
 (defun gpgweb-postprocess-html (plist orgfile htmlfile blogmode)
   "Post-process the generated HTML file
 
@@ -400,17 +409,19 @@ to create the previous and Next links for an entry."
                    (fname-2 (replace-regexp-in-string
                              ".*/gnupg-doc-stage/web/\\(.*\\)$" "\\1"
                              htmlfile t))
-                   (title (gpgweb-publish-find-title orgfile)))
+                   (title (gpgweb-publish-find-title orgfile))
+                   (custom (gpgweb-want-custom-page-p)))
                ;; Insert header, menu, and footer.
-               (gpgweb-insert-header title committed-at)
-               (goto-char (point-min))
-               (unless (search-forward "<!--disable-menu-->" nil t)
-                 (gpgweb-insert-menu fname-2))
-               (if blogmode
-                   (gpgweb-fixup-blog plist
-                                      (file-name-nondirectory orgfile)
-                                      blogmode))
-               (gpgweb-insert-footer fname-2 committed-at blogmode)
+               (gpgweb-insert-header title committed-at custom)
+               (unless custom
+                 (goto-char (point-min))
+                 (unless (search-forward "<!--disable-menu-->" nil t)
+                   (gpgweb-insert-menu fname-2))
+                 (if blogmode
+                     (gpgweb-fixup-blog plist
+                                        (file-name-nondirectory orgfile)
+                                        blogmode))
+                 (gpgweb-insert-footer fname-2 committed-at blogmode))
 
                ; Fixup the sitemap
                (when (string-equal fname "sitemap.html")

-----------------------------------------------------------------------

Summary of changes:
 web/donate/index.org | 18 ++++++------------
 web/share/gpgweb.el  | 41 ++++++++++++++++++++++++++---------------
 2 files changed, 32 insertions(+), 27 deletions(-)


hooks/post-receive
-- 
The GnuPG website and other docs
http://git.gnupg.org




More information about the Gnupg-commits mailing list