emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Org-mode publish: Some questions when use it for a blog
@ 2023-04-29 21:35 Sébastien Gendre
  2023-04-30 14:37 ` Ihor Radchenko
  0 siblings, 1 reply; 5+ messages in thread
From: Sébastien Gendre @ 2023-04-29 21:35 UTC (permalink / raw)
  To: emacs-orgmode

Hello,

I try do generate a blog with Org-mode publish. 

I'm very impressed by the publishing tool. But as it's nice to do a
simple website, I have some difficulties to use it for a blog.

First, I try to customize the site map:

* Is it possible to customize the entry without writing a function ?
  Something like the preamble with escaped chars (ex %t, %d) ?

* How can I set a postamble in the sitemap different from my blog
  posts ?


Secondly, how can I put the author name and publication date just at the
bottom of the document title ? I tried with preamble, but the preamble
is inserted before the document that I cannot disable.


Finally, how can I generate the RSS feed ? I tried with ox-rss, but I
got an error about my version of Org:
Error (use-package): ox-rss/:catch: Invalid function: org-assert-version

Best regards


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Org-mode publish: Some questions when use it for a blog
  2023-04-29 21:35 Org-mode publish: Some questions when use it for a blog Sébastien Gendre
@ 2023-04-30 14:37 ` Ihor Radchenko
  2023-05-09  0:27   ` Sébastien Gendre
  0 siblings, 1 reply; 5+ messages in thread
From: Ihor Radchenko @ 2023-04-30 14:37 UTC (permalink / raw)
  To: Sébastien Gendre; +Cc: emacs-orgmode

Sébastien Gendre <seb@k-7.ch> writes:

> I try do generate a blog with Org-mode publish. 
>
> I'm very impressed by the publishing tool. But as it's nice to do a
> simple website, I have some difficulties to use it for a blog.

Note that ox-publish is very basic. There is a number of third-party
packages that simplify blog export. For example, ox-hugo. See
https://orgmode.org/worg/org-blog-wiki.html

> First, I try to customize the site map:
>
> * Is it possible to customize the entry without writing a function ?
>   Something like the preamble with escaped chars (ex %t, %d) ?

It must be a function. If someone comes up with a patch for this, it
would also be welcome.

> * How can I set a postamble in the sitemap different from my blog
>   posts ?

Sitemap is exported just as an ordinary .org file within the project.
So, you can, for example, modify sitemap generator function to add
postamble manually and set #+OPTIONS: html-postamble:nil on top to
disable default postamble.

> Secondly, how can I put the author name and publication date just at the
> bottom of the document title ? I tried with preamble, but the preamble
> is inserted before the document that I cannot disable.

May you please elaborate?

> Finally, how can I generate the RSS feed ? I tried with ox-rss, but I
> got an error about my version of Org:
> Error (use-package): ox-rss/:catch: Invalid function: org-assert-version

This indicates an issue with your Org installation. Consider
re-installing Org mode and making sure that you do not put
(require 'org) before setting `load-path'. This issue appear in several
scenarios, depending on the kind of installation method you are using.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Org-mode publish: Some questions when use it for a blog
  2023-04-30 14:37 ` Ihor Radchenko
@ 2023-05-09  0:27   ` Sébastien Gendre
  2023-05-09 12:53     ` Ihor Radchenko
  0 siblings, 1 reply; 5+ messages in thread
From: Sébastien Gendre @ 2023-05-09  0:27 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: emacs-orgmode

Thank you for your reply Ihor.

Ihor Radchenko <yantar92@posteo.net> writes:



Ihor Radchenko <yantar92@posteo.net> writes:
>
> May you please elaborate?

When a webpage is generated by `org-html-publish-to-html`, it put the
title of the document at top of the HTML content as an <h1>.

I wanted to modify it to put Author and date below this title but before
the rest of the content.


> This indicates an issue with your Org installation. Consider
> re-installing Org mode and making sure that you do not put
> (require 'org) before setting `load-path'. This issue appear in several
> scenarios, depending on the kind of installation method you are using.

I Found the origin of the problem: My publication script is launch with
an `emacs -q` command. And I had updated Org-mode for my installation of
Emacs.




But, generate a RSS feed with ox-rss [1] give me some problems. The
README is not really clear on what the Org-mode file should look. And it
seems to be done to generate RSS when all blog posts are a headline in
the same document. But on my blog, each blog post is on a different
document.

I guess, until I found a better way, I'm gonna write my RSS feed
manually with help of Yasnippet.


[1] https://github.com/BenedictHW/ox-rss



> Sébastien Gendre <seb@k-7.ch> writes:
>
>> I try do generate a blog with Org-mode publish. 
>>
>> I'm very impressed by the publishing tool. But as it's nice to do a
>> simple website, I have some difficulties to use it for a blog.
>
> Note that ox-publish is very basic. There is a number of third-party
> packages that simplify blog export. For example, ox-hugo. See
> https://orgmode.org/worg/org-blog-wiki.html
>
>> First, I try to customize the site map:
>>
>> * Is it possible to customize the entry without writing a function ?
>>   Something like the preamble with escaped chars (ex %t, %d) ?
>
> It must be a function. If someone comes up with a patch for this, it
> would also be welcome.
>
>> * How can I set a postamble in the sitemap different from my blog
>>   posts ?
>
> Sitemap is exported just as an ordinary .org file within the project.
> So, you can, for example, modify sitemap generator function to add
> postamble manually and set #+OPTIONS: html-postamble:nil on top to
> disable default postamble.
>
>> Secondly, how can I put the author name and publication date just at the
>> bottom of the document title ? I tried with preamble, but the preamble
>> is inserted before the document that I cannot disable.
>
> May you please elaborate?
>
>> Finally, how can I generate the RSS feed ? I tried with ox-rss, but I
>> got an error about my version of Org:
>> Error (use-package): ox-rss/:catch: Invalid function: org-assert-version
>
> This indicates an issue with your Org installation. Consider
> re-installing Org mode and making sure that you do not put
> (require 'org) before setting `load-path'. This issue appear in several
> scenarios, depending on the kind of installation method you are using.



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Org-mode publish: Some questions when use it for a blog
  2023-05-09  0:27   ` Sébastien Gendre
@ 2023-05-09 12:53     ` Ihor Radchenko
  2023-05-10  7:41       ` Christian Moe
  0 siblings, 1 reply; 5+ messages in thread
From: Ihor Radchenko @ 2023-05-09 12:53 UTC (permalink / raw)
  To: Sébastien Gendre; +Cc: emacs-orgmode

Sébastien Gendre <seb@k-7.ch> writes:

>> May you please elaborate?
>
> When a webpage is generated by `org-html-publish-to-html`, it put the
> title of the document at top of the HTML content as an <h1>.
>
> I wanted to modify it to put Author and date below this title but before
> the rest of the content.

For example, you can simply put Author and data into #+SUBTITLE
Or you can add a function to `org-export-filter-parse-tree-functions'.
That function will be called with INFO communication channel (plist) as
an argument. You can override :title property in that plist by side
effect to your liking.

> But, generate a RSS feed with ox-rss [1] give me some problems. The
> README is not really clear on what the Org-mode file should look. And it
> seems to be done to generate RSS when all blog posts are a headline in
> the same document. But on my blog, each blog post is on a different
> document.

Well. You can define a derived dackend for ox-rss. It will require some
Elisp though. Check out `org-export-define-derived-backend' call in
ox-rss.el.

Alternatively, I am pretty sure that a number of rss generators already
exist for static blogs. They are more likely to work using multiple
individual html pages as input.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Org-mode publish: Some questions when use it for a blog
  2023-05-09 12:53     ` Ihor Radchenko
@ 2023-05-10  7:41       ` Christian Moe
  0 siblings, 0 replies; 5+ messages in thread
From: Christian Moe @ 2023-05-10  7:41 UTC (permalink / raw)
  To: emacs-orgmode; +Cc: Sébastien Gendre



>> But, generate a RSS feed with ox-rss [1] give me some problems. The
>> README is not really clear on what the Org-mode file should look. And it
>> seems to be done to generate RSS when all blog posts are a headline in
>> the same document. But on my blog, each blog post is on a different
>> document.
>
> Well. You can define a derived dackend for ox-rss. It will require some
> Elisp though. Check out `org-export-define-derived-backend' call in
> ox-rss.el.
>
> Alternatively, I am pretty sure that a number of rss generators already
> exist for static blogs. They are more likely to work using multiple
> individual html pages as input.

I've seen several people solving this by adapting the sitemap
functionality in org-publish, since the sitemap already pulls together
information about different pages. You can configure org-publish to use
a bespoke sitemap-function that formats the sitemap as an Org file
suitable for RSS export with ox-rss. This looks like a clear explainer:

  https://writepermission.com/org-blogging-rss-feed.html

Yours,
Christian


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-05-10  7:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-29 21:35 Org-mode publish: Some questions when use it for a blog Sébastien Gendre
2023-04-30 14:37 ` Ihor Radchenko
2023-05-09  0:27   ` Sébastien Gendre
2023-05-09 12:53     ` Ihor Radchenko
2023-05-10  7:41       ` Christian Moe

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).