Skip to content

Still can't get a simple example to work #63

Description

@sangwon-hyun

Hi,

I'm someone who really, really likes the idea of weblorg and who doesn't really know that much Lisp.

I just can't get even a simple example to work. I have simplified my publish.el file as much as possible, so that it's just one main.org file (and perhaps one css file).

I have a simple request! There still isn't a super simple example that you could just run emacs --script publish.el on, and see a website to come out of it. I'm sure once I see something like this, I'll be able to figure out incrementally how to customize, but I haven't even gotten one example to work.

(For the sake of completeness, here is the publish.el I'm using.)

(add-to-list 'load-path "~/emacs")

;; Setup package management
(require 'package)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
(package-initialize)
(unless (package-installed-p 'use-package)
  (package-refresh-contents)
  (package-install 'use-package))

;; Install and configure dependencies
(use-package templatel :ensure t)
(use-package htmlize
  :ensure t
  :config
  (setq org-html-htmlize-output-type 'css))

(require 'weblorg)

(weblorg-site
 :template-vars '(("site_author" . "Justin")
		  ("site_name" . "Justin's website")
		  ("project_description" . "Justin")))

;; Set theme
(weblorg-site
 :theme #'weblorg-theme-autodoc)



;; Route for rendering each post
(weblorg-route
 :input-pattern "*.org"
 :template "post.html"
 :output "output/posts/{{ slug }}.html"
 :url "/{{ slug }}.html")


;; fire the engine and export all the files declared in the routes above
(weblorg-export)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions