[git] gnupg-doc - branch, master, updated. 3f1715f771cd1b21b032846d7f1ea1666a14b1c7

by Werner Koch cvs at cvs.gnupg.org
Wed Jan 21 18:19:17 CET 2015


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, master has been updated
       via  3f1715f771cd1b21b032846d7f1ea1666a14b1c7 (commit)
      from  fe1d06f56ce9d637ed66594541d273236f07c941 (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 3f1715f771cd1b21b032846d7f1ea1666a14b1c7
Author: Werner Koch <wk at gnupg.org>
Date:   Wed Jan 21 17:49:26 2015 +0100

    web: Add link to source and change date to all pages.

diff --git a/web/share/gpgweb.el b/web/share/gpgweb.el
index 06c43a0..036cf52 100644
--- a/web/share/gpgweb.el
+++ b/web/share/gpgweb.el
@@ -43,7 +43,7 @@
 (defun gpgweb-insert-header (title committed-at)
   "Insert the header.
 
-COMMITED-AT is the commit date string of the source file or nil
+COMMITTED-AT is the commit date string of the source file or nil
 if not available."
   (goto-char (point-min))
   (insert "<?xml version=\"1.0\" encoding=\"utf-8\"?>
@@ -269,36 +269,48 @@ org filenames."
                     "</p>\n")))))
 
 
-(defun gpgweb-insert-footer ()
-  (goto-char (point-max))
-  (insert "</div><!-- end content -->
+(defun gpgweb-insert-footer (htmlfile committed-at blogmode)
+  "Insert the footer.
+
+HTMLFILE is HTML file name and COMMITTED-AT is the commit date
+string of the source file or nil if not available."
+  (let ((srcfile (concat "https://git.gnupg.org/cgi-bin/gitweb.cgi?"
+                         "p=gnupg-doc.git;a=blob;f="
+                         (if blogmode "misc/blog.gnupg.org" "web")
+                         (file-name-sans-extension htmlfile) ".org"))
+        (changed (if (and committed-at (>= (length committed-at) 10))
+                     (substring committed-at 0 10)
+                     "[unknown]")))
+    (goto-char (point-max))
+    (insert "</div><!-- end content -->
 </main>
 <div id=\"footer\">
   <div id=\"nav_bottom\">
   <ul>
 ")
-  (gpgweb--insert-menu gpgweb-gnupg-bottom-menu-alist 0 nil)
-  (insert "  </ul>
+    (gpgweb--insert-menu gpgweb-gnupg-bottom-menu-alist 0 nil)
+    (insert "  </ul>
   </div>
 ")
-  (goto-char (point-min))
-  (unless (search-forward "<!--disable-copyright-footer-->" nil t)
-    (goto-char (point-max))
-    (insert "  <div id=\"cpyright\">
+    (goto-char (point-min))
+    (unless (search-forward "<!--disable-copyright-footer-->" nil t)
+      (goto-char (point-max))
+      (insert "  <div id=\"cpyright\">
     <a rel=\"license\" href=\"http://creativecommons.org/licenses/by-sa/3.0/\"
       ><img alt=\"CC-BY-SA 3.0\" style=\"border: 0\"
             src=\"/share/cc-by-sa-3.0_80x15.png\"/></a> 
     These web pages are
-    Copyright 1998--2014 The GnuPG Project and licensed under a
+    Copyright 1998--2015 The GnuPG Project and licensed under a
     <a rel=\"license\" href=\"http://creativecommons.org/licenses/by-sa/3.0/\"
     >Creative Commons Attribution-ShareAlike 3.0 Unported License</a>.  See
     <a href=\"/copying.html\">copying</a> for details.
+    Page <a href=\"" srcfile "\">source</a> last changed on " changed ".
   </div>\n"))
   (goto-char (point-max))
   (insert "</div>
 </div><!-- end wrapper -->
 </body>
-</html>"))
+</html>")))
 
 
 ;;; Post-process the generated HTML file:
@@ -318,8 +330,13 @@ org filenames."
                         (concat "git log -1 --format='%ci' -- " orgfile))))
     (prog1 (with-current-buffer work-buffer
              (let ((fname (file-name-nondirectory htmlfile))
+                   ;; The first replace below is a hack to cope with
+                   ;; blog mode where HTMLFILE is like "./foo.html".
                    (fname-2 (replace-regexp-in-string
-                             ".*/stage\\(/.*\\)$" "\\1" htmlfile t))
+                             "^\\./" "/"
+                             (replace-regexp-in-string
+                              ".*/stage\\(/.*\\)$" "\\1" htmlfile t)
+                             t))
                    (title (org-publish-find-title orgfile)))
                ;; Insert header, menu, and footer.
                (gpgweb-insert-header title committed-at)
@@ -328,7 +345,7 @@ org filenames."
                    (gpgweb-fixup-blog plist
                                       (file-name-nondirectory orgfile)
                                       blogmode))
-               (gpgweb-insert-footer)
+               (gpgweb-insert-footer fname-2 committed-at blogmode)
 
                ; Fixup the sitemap
                (when (string-equal fname "sitemap.html")

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

Summary of changes:
 web/share/gpgweb.el | 45 +++++++++++++++++++++++++++++++--------------
 1 file changed, 31 insertions(+), 14 deletions(-)


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




More information about the Gnupg-commits mailing list