campaign: Update the video of the day to Hernani.
[gnupg-doc.git] / web / share / gpgweb.el
index f7713e9..e350294 100644 (file)
@@ -33,7 +33,7 @@
 
    (aput 'org-publish-project-alist "gpgweb-other"
    `(:base-directory ,gpgweb-root-dir
-     :base-extension "jpg\\|png\\|css\\|txt\\|rss\\|lst\\|sig"
+     :base-extension "jpg\\|png\\|css\\|txt\\|rss\\|lst\\|sig\\|js\\|map\\|eot\\|ttf\\|woff\\|woff2\\|svg"
      :recursive t
      :publishing-directory ,gpgweb-stage-dir
      :publishing-function org-publish-attachment
                                  '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\"
@@ -69,7 +69,8 @@ if not available."
 <html xmlns=\"http://www.w3.org/1999/xhtml\" lang=\"en\" xml:lang=\"en\">
 <head>
 <title>" title "</title>
-<meta http-equiv=\"Content-Type\" content=\"text/html;charset=utf-8\" />\n")
+<meta http-equiv=\"Content-Type\" content=\"text/html;charset=utf-8\" />
+")
   (when (and committed-at (>= (length committed-at) 10))
       (insert "<meta name=\"DC.Date\" content=\""
               (substring committed-at 0 10) "\" />\n"))
@@ -81,23 +82,33 @@ if not available."
 <meta name=\"DC.Publisher\" content=\"The GnuPG Project\" />
 <meta name=\"DC.Identifier\" content=\"https://gnupg.org/\" />
 <meta name=\"DC.Rights\" content=\"https://gnupg.org/copying.html\" />
-<link rel=\"stylesheet\" href=\"/share/site.css\" type=\"text/css\" />
+<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />
+")
+(unless custom
+ (insert "<link rel=\"stylesheet\" href=\"/share/site.css\" type=\"text/css\" />
 </head>
 <body>
-"))
+")))
 
 (defconst gpgweb-gnupg-menu-alist
   '(("/index.html"
      "Home"
      (("/index.html"                       "Home")
-      ("/features.html"                    "Features")
       ("/news.html"                        "News")
       ("/people/index.html"                "People")
+      ("/verein/index.html"                "Verein")
       ("/documentation/sites.html"         "Sites")))
     ("/donate/index.html"
      "Donate"
      (("/donate/index.html"                "Donate")
       ("/donate/kudos.html"                "List of Donors")))
+    ("/software/index.html"
+     "Software"
+     (("/software/index.html"              "GnuPG")
+      ("/software/frontends.html"          "Frontends")
+      ("/software/tools.html"              "Tools")
+      ("/software/libraries.html"          "Libraries")
+      ("/software/swlist.html"             "All")))
     ("/download/index.html"
      "Download"
      (("/download/index.html"              "Download")
@@ -107,7 +118,7 @@ if not available."
       ("/download/mirrors.html"            "Mirrors")
       ("/download/git.html"                "GIT")))
     ("/documentation/index.html"
-     "Support"
+     "Documentation"
      (("/documentation/howtos.html"        "HOWTOs")
       ("/documentation/manuals.html"       "Manuals")
       ("/documentation/guides.html"        "Guides")
@@ -116,12 +127,6 @@ if not available."
       ("/service.html"                     "3rd Party Support")
       ("/documentation/bts.html"           "Bug&nbsp;Tracker")
       ("/documentation/security.html"      "Security")))
-    ("/related_software/index.html"
-     "Related software"
-     (("/related_software/frontends.html"  "Frontends")
-      ("/related_software/tools.html"      "Tools")
-      ("/related_software/libraries.html"  "Libraries")
-      ("/related_software/swlist.html"     "All")))
     ("/blog/index.html"
      "Blog"))
   "The definition of the gnupg.org menu structure.")
@@ -332,7 +337,7 @@ string of the source file or nil if not available."
       (insert "  <div id=\"cpyright\">
     <a rel=\"license\" href=\"https://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>&nbsp;
+            src=\"/share/cc-by-sa_80x15.png\"/></a>&nbsp;
     These web pages are
     Copyright 1998--2017 The GnuPG Project and licensed under a
     <a rel=\"license\" href=\"https://creativecommons.org/licenses/by-sa/3.0/\"
@@ -374,6 +379,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
 
@@ -395,15 +411,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)
-               (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")