Total Pageviews

Showing posts with label orgmode. Show all posts
Showing posts with label orgmode. Show all posts

Monday, 11 November 2024

基于OrgMode的静态站点生成器orgpress

 modern emacs static blog generator https://ghcr.io/jcouyang/orgpress

jcouyang/orgpress status

fork this repo and clone:

./compile

Or Publish to Gh-pages using Actions

https://github.com/jcouyang/orgpress/blob/master/.github/workflows/publish.yml

Prerequisite

Configuration

variables in config.el

(?D . ,(format-time-string "<%Y-%m-%d %a>" (org-publish-find-date entry project)))
(?c . ,(org-publish-find-property entry :description project 'html))
(?l . ,(concat "file:" entry))
(?L . ,(replace-regexp-in-string "\.org" "\.html" entry))

header and footer html template

  • html/preamble.html: header
  • html/postamble.html: footer
  • html/header.html: custom content inside <head/>

fromhttps://github.com/jcouyang/orgpress

(https://github.com/jcouyang/blog)

Monday, 28 October 2024

Firn:基于OrgMode的静态站点生成器

 

项目介绍

Firn 是一款专为 Org Mode 设计的静态站点生成器。与其他静态站点生成器不同,Firn 旨在成为从现有 Org 文件夹创建站点的即插即用解决方案。由于 Org Mode 具有强大的数据收集和展示能力(如链接、日志、抽屉、任务关键词、标签等),Firn 能够在将 Org 内容解析为数据结构时保留这些数据。

目前,Firn 的主要功能包括:

  • 递归读取目录中的所有 .org 文件。
  • 使用 Orgize 将 Org 文件解析为数据结构。
  • 收集所有文件中的链接、标签和日志。
  • 通过 Tera 模板系统渲染为 HTML。

项目技术分析

Firn 的核心技术栈包括:

  • Orgize:一个高效的 Org Mode 解析库,能够将 Org 文件解析为易于操作的数据结构。
  • Tera:一个强大的模板引擎,支持复杂的模板逻辑和数据绑定,适用于生成静态站点。
  • Rust:Firn 使用 Rust 语言开发,保证了高性能和安全性。

项目及技术应用场景

Firn 适用于以下场景:

  • 个人博客:如果你使用 Org Mode 记录笔记和文章,Firn 可以帮助你快速生成一个静态博客。
  • 项目文档:使用 Org Mode 编写项目文档,并通过 Firn 生成静态站点,方便团队成员查阅。
  • 知识库:将 Org Mode 中的知识库内容生成静态站点,便于分享和检索。

项目特点

  • 即插即用:Firn 可以直接处理现有的 Org 文件夹,无需复杂的配置。
  • 数据保留:保留 Org Mode 中的所有数据(如链接、标签、日志等),确保生成的站点内容完整。
  • 模板灵活:支持 Tera 模板引擎,允许用户自定义站点样式和布局。
  • 高性能:使用 Rust 开发,确保生成过程高效且稳定。

使用指南

  1. 下载:从 Github Releases 页面下载最新版本的 Firn 二进制文件。
  2. 安装:将二进制文件添加到系统路径,或使用 -d 标志传递目录给 Firn。
  3. 生成站点:
    1. # 导航到一个包含 Org 文件的目录,然后生成站点
    2. firn new
    3. # 查看生成的文件
    4. ls -la _firn
    5. # 启动服务器并查看生成的文件
    6. firn serve
    7. # 准备构建输出
    8. firn build

更多详细的使用文档请参考 这里。

开发与贡献

  • Rust 版本:需要 Rust 1.58.0 或更高版本。
  • Makefile:查看 Makefile 中的命令。
  • 测试:需要一个包含 Org 文件的文件夹进行测试。

Firn 的开发路线图可以在 这里 找到。

局限性

  • 开发服务器:开发服务器较为简单,没有缓存或差异替换功能。
  • 脚注:由于解析器的原因,脚注必须按照特定格式编写。

Firn 是一个正在快速发展的项目,欢迎开发者贡献代码和反馈问题。通过 Firn,你可以轻松地将 Org Mode 内容转化为精美的静态站点.

 项目地址:https://github.com/teesloane/firn

----------

相关帖子:

在linux vps上安装基于orgmode的静态博客程序- misaki-orgmode

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

https://github.com/renard/o-blog
https://renard.github.io/o-blog/
https://renard.github.io/o-blog-v2/

Wednesday, 2 March 2022

org-page

A static site generator based on Emacs and org mode.

Introduction

Org-page is a static site generator based on org-mode.

Org-page provides the following features:

  1. Org sources and html files managed by git
  2. Incremental publication (according to git diff command)
  3. Category support
  4. Tags support (auto generated)
  5. RSS support (auto generated)
  6. Search engine support (auto generated)
  7. A beautiful theme
  8. Theme customization support
  9. Commenting (implemented using disqus/duoshuo/hashover)
  10. Website traffic analytics (implemented using google analytics)
  11. Index/about page support (auto generated if no default is provided)
  12. Site preview
  13. Highly customizable

Here is my personal site generated by org-page. The html files and org source files are located at https://github.com/kelvinh/kelvinh.github.com. If you want to give org-page a try, you could take them as an example.

Workflow

  1. Specify a git repo where the org source files will be on the “source” branch and the generated html files will be on the “master” branch (the branch names can be customized). Repos may be created manually or by org-page’s op/new-repository command.
  2. Specify a “base commit” (the most recent prior commit will be used if omitted). org-page will read changes between the latest commit and the specified base commit on branch “source”. The changes will then be marked for publication.
  3. Org-page does preparation jobs.
  4. Publish the changes read in step 2. A change can be an addition, a modification, or a deletion. org-page is designed to handle all of these kinds of changes but since deletion does not happen often, org-page has not implemented it yet
  5. Update the index page for each category and tag.
  6. Publication finished.

Usage

Here is a general introduction about how to use org-page, for more detailed introduction and configuration, please see “quick-guide.org” in the “doc” folder.

Installation

Org-page is now available from the famous emacs package repo melpa so the recommended way is to install it through emacs’ package management system. For more info about installation, please see quick-guide.org in the “doc” folder.

Configuration

Add the following lines to your .emacs file:

;;; the following is only needed if you install org-page manually
(add-to-list 'load-path "path/to/org-page")
(require 'org-page)
(setq op/repository-directory "path/to/your/org/repository")
(setq op/site-domain "http://your.personal.site.com/")
;;; for commenting, you can choose either disqus, duoshuo or hashover
(setq op/personal-disqus-shortname "your_disqus_shortname")
(setq op/personal-duoshuo-shortname "your_duoshuo_shortname")
(setq op/hashover-comments t)
;;; the configuration below are optional
(setq op/personal-google-analytics-id "your_google_analytics_id")

Publication

Evaluate the following code to publish your changes:

(op/do-publication nil "HEAD^1" "~/org-pub/" nil)

or just

(op/do-publication)

You can also run it interactively: M-x op/do-publication <Enter>

NOTE: Org-page does NOT commit your org files to git, so you have to commit them manually before you run this command.

Site preview in browser

Just run M-x op/do-publication-and-preview-site <Enter>, the site will be published in ~/.op-tmp, then it will be previewed in browser automatically.

Dependencies

  1. emacs: this is an “of-course” dependency
  2. org mode: v8.0 is required, please use M-x org-version <RET> to make sure you org mode version is not less than 8.0
  3. git: a free and open source version control system
  4. mustache.el: a mustache templating library for Emacs
  5. htmlize.el: a library for syntax highlighting (usually this library is shipped with emacs)
  6. dash.el: a modern list library for Emacs
  7. ht.el: a modern hash-table library for Emacs
  8. simple-httpd: A simple Emacs web server is required for site preview
  9. git.el: An Elisp API for programmatically using Git

Known issues

  • Currently the deletion change handler has not been implemented so if you deleted some org sources, you may have to manually delete corresponding generated html files.
  • URI path change detection is not available. That is, if you make a post with the URI “/blog/2013/03/25/the-old-post-name” and then change this value in your org source, org-page would be unable to detect that this has happened. it will only publish a new html file for you so you need to delete the old html file related to the old URI manually.

from https://github.com/emacsorphanage/org-page

demo site: https://sillykelvin.github.io/blog/

Monday, 22 August 2016