Fixed some trivial bugs in the doc generator

This commit is contained in:
Sameer Rahmani 2022-06-29 17:04:11 +01:00
parent d6be7ed7da
commit a77d2ee6c5
7 changed files with 39 additions and 14 deletions

View File

@ -64,8 +64,13 @@ We're not happy with Microsoft buying Github and we don't trust a company like M
their strategies (For more information take a look at [[https://en.wikipedia.org/wiki/Halloween_documents][Halloween documents]].
So we decided to move to Devheroes as an alternative and we are happy here so far.
* License
* Contribute
FG42 made possible by the effort of the community of [[docs/site/pages/contributors.org][Contributors]].
If you're interested in *FG42* and wants to contribute to the project please follow
the [[docs/site/pages/how-to-contribute.org][How to Contribute Guitd]]. Also please read our [[docs/site/pages/code-of-conduct.org][Code of Conduct]] as well.
* License
FG42 is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
@ -83,4 +88,4 @@ with this program; if not, write to the Free Software Foundation, Inc.,
All the documents of FG42 that locate in 'doc' directories release
under the term of GNU FDL.
Copyright (C) 2010-2021 Sameer Rahmani <lxsameer@gnu.org>
Copyright (C) 2010-2022 Sameer Rahmani <lxsameer@gnu.org>

View File

@ -32,7 +32,6 @@
(defvar project-root nil
"Root directory of the website source code.")
(defvar debug-mode nil)

View File

@ -56,7 +56,8 @@
(defun fg42/build-docs-copy-base (build-dir)
"Copy the base structure of the website to the BUILD-DIR."
(copy-directory (from-root "/docs/site/pages") build-dir nil t))
(copy-directory (from-root "/docs/site/pages")
(expand-file-name "site/pages" build-dir) nil t))
(defun fg42/build-prepare-docs (build-dir host)

View File

@ -121,6 +121,7 @@ call `org-html-render-tag-template' otherwise will call ORIG-FN."
("base-url" (plist-get info :base-url))
("preamble" (org-html--build-pre/postamble 'preamble info))
("title" (get-file-global-props (plist-get info :input-file) "TITLE"))
("version" (fg42/version))
("description" (or (get-file-global-props (plist-get info :input-file) "DESC")
""))
("postamble" (org-html--build-pre/postamble 'postamble info)))))

View File

@ -27,6 +27,7 @@
;;; Code:
(require 'org-element)
(require 'fg42/build/core)
(defmacro comment (&rest _)
@ -73,5 +74,16 @@
(mapcar #'car (org-get-buffer-tags))))
(defun fg42/git-branch ()
(cd project-root)
(shell-command-to-string "git branch --show-current"))
(defun fg42/version ()
"Returns the current version of FG42."
(cd project-root)
(shell-command-to-string (format "git describe %s" (fg42/git-branch))))
(provide 'fg42/build/utils)
;;; utils.el ends here

View File

@ -11,15 +11,15 @@
<meta property="og:description" content="{{description}}" />
{{{head}}}
<link rel="stylesheet" href="{{base-url}}/assets/styles/dark.css?1">
<link rel="stylesheet" href="{{base-url}}/assets/styles/main.css?1">
<link rel="stylesheet" href="{{base-url}}/assets/styles/arta.css?1">
<link rel="stylesheet" href="{{base-url}}/assets/styles/dark.css?{{version}}">
<link rel="stylesheet" href="{{base-url}}/assets/styles/main.css?{{version}}">
<link rel="stylesheet" href="{{base-url}}/assets/styles/arta.css?{{version}}">
</head>
<body>
<header>
<nav style="text-align: center;">
<a href="/">HOME</a> | <a href="/manual/">Manual</a> | <a href="/cubes/">Cubes</a> | <a href="https://devheroes.codes/FG42/FG42">Source</a> | <a href="/categories/">Categories</a> | <a href="/tags/">Tags</a>
<a href="/">HOME</a> | <a href="/cubes/">Cubes</a> | <a href="https://devheroes.codes/FG42/FG42">Source</a> | <a href="/categories/">Categories</a> | <a href="/tags/">Tags</a>
</nav>
<hr/>
</header>
@ -33,7 +33,8 @@
</main>
<footer>
<span>© 2010-2021 Sameer Rahmani</span><br/>
<span>© 2010-2022 Sameer Rahmani</span><br/>
<span>Version: {{version}}</span><br/>
<span>Built with <a href="https://www.gnu.org/software/emacs/">Emacs Lisp</a> and <a href="https://orgmode.org/">org-mode</a>.</span><br/>
</footer>
</div>

View File

@ -1,4 +1,3 @@
#+SETUPFILE: ../config.org
#+OPTIONS: toc:nil
#+EXPORT_FILE_NAME: index.html
@ -9,7 +8,14 @@
#+INCLUDE: "../../README.org::*Future Gadgets 42" :only-contents t
* Contribute
FG42 made possible by the effort of the community of [[http:/pages/contributors.html][Contributors]].
If you're interested in *FG42* and wants to contribute to the project please follow
the [[http:/pages/how-to-contribute.html][How to Contribute Guitd]]. Also please read our [[http:/pages/code-of-conduct.html][Code of Conduct]] as well.
* Recent updates:
<<<:links>>>
#+INCLUDE: "../../README.org::*License"