emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Publishing a project and selecting files (possibly with tags)
@ 2022-07-18 11:11 Benoit Bidoggia
  2022-07-20 20:38 ` Munyoki Kilyungi
  2022-07-22 19:32 ` Hanno Perrey
  0 siblings, 2 replies; 3+ messages in thread
From: Benoit Bidoggia @ 2022-07-18 11:11 UTC (permalink / raw)
  To: emacs-orgmode

Dear list,

This is my problem: I have a large set of org files (created with
org-roam), which contains all my thoughts on different topics (for
example "work1", "work2", "personal1"...)

I would like to create different projects (for example "work1",
"work2", "personal1") to be able to publish these files under
different folders (for example "./pub_work1", "./pub_work2",
"./pub_personal1") for which I could define some filters to decide
what goes where.

The rules should be something likes this:
- nothing is exported, except that
- files with tag "WORK1" are exported in "./pub_work1"
- files with tag "WORK2" are exported in "./pub_work2"
- files with tag "PERSONAL1" are exported in "./pub_personal1"

I cannot use the file name to filter the files, which seems to exclude
the possibility of using the options ":exclude" and ":include" of
org-publish-project-alist.

Ideally I would like to use tags (or some descriptors I can include
directly in the org file), but I did not have much success using the
options ":with-tags" or ":select-tags".

Can this be done? If so, how?

Thank you very much, best regards.
Benoît


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

* Re: Publishing a project and selecting files (possibly with tags)
  2022-07-18 11:11 Publishing a project and selecting files (possibly with tags) Benoit Bidoggia
@ 2022-07-20 20:38 ` Munyoki Kilyungi
  2022-07-22 19:32 ` Hanno Perrey
  1 sibling, 0 replies; 3+ messages in thread
From: Munyoki Kilyungi @ 2022-07-20 20:38 UTC (permalink / raw)
  To: Benoit Bidoggia; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1897 bytes --]


Hi Benoit!

Benoit Bidoggia <benoit.bidoggia@gmail.com>
anaandika:

> Dear list,
>
> This is my problem: I have a large set of org files (created with
> org-roam), which contains all my thoughts on different topics (for
> example "work1", "work2", "personal1"...)
>
> I would like to create different projects (for example "work1",
> "work2", "personal1") to be able to publish these files under
> different folders (for example "./pub_work1", "./pub_work2",
> "./pub_personal1") for which I could define some filters to decide
> what goes where.
>
> The rules should be something likes this:
> - nothing is exported, except that
> - files with tag "WORK1" are exported in "./pub_work1"
> - files with tag "WORK2" are exported in "./pub_work2"
> - files with tag "PERSONAL1" are exported in "./pub_personal1"
>
> I cannot use the file name to filter the files, which seems to exclude
> the possibility of using the options ":exclude" and ":include" of
> org-publish-project-alist.
>
> Ideally I would like to use tags (or some descriptors I can include
> directly in the org file), but I did not have much success using the
> options ":with-tags" or ":select-tags".
>
> Can this be done? If so, how?
>

Have you looked at ox-hugo?  In ox-hugo, you would
do something like:

--8<---------------cut here---------------start------------->8---
* Blog
:PROPERTIES:
:ARCHIVE:  ~/Self/org/archive/2022_blog.org_archive::
:END:
#+HUGO_BASE_DIR: ~/projects/blog/
#+HUGO_SECTION: post
#+CATEGORY: blog
#+options: author:nil
--8<---------------cut here---------------end--------------->8---

Perhaps inspecting that source may provide useful
pointers in what you want to do.

-- 
(Life is like a pencil that will surely run out,
    but will leave the beautiful writing of life.)
(D4F09EB110177E03C28E2FE1F5BBAE1E0392253F
    (hkp://keys.gnupg.net))

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 865 bytes --]

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

* Re: Publishing a project and selecting files (possibly with tags)
  2022-07-18 11:11 Publishing a project and selecting files (possibly with tags) Benoit Bidoggia
  2022-07-20 20:38 ` Munyoki Kilyungi
@ 2022-07-22 19:32 ` Hanno Perrey
  1 sibling, 0 replies; 3+ messages in thread
From: Hanno Perrey @ 2022-07-22 19:32 UTC (permalink / raw)
  To: Benoit Bidoggia; +Cc: emacs-orgmode


Dear Benoit,

this does sound like what I have done for my blog: I write all blog
posts as org files in a single directory called "posts" and publish them
through org-publish. In each file, I define tags via the =FILETAGS=
keyword.

Upon publishing, I set =:sitemap-format-entry= in
=org-publish-project-alist= to a custom function which creates new org
files corresponding to the tags being used in the posts. These org files
are then published as well, giving me a sitemap with all posts and a
sitemap for each individual tag (with short teaser text).

This is not exactly what you asked for and maybe not as straightforward
as what you envisioned, but I think that you could customize this
approach to fit your use case.

The code for my blog is available here: https://gitlab.com/hperrey/hoowl_blog

(Please note that I copied it together from various sources back when
without always understanding every detail and I am afraid that it shows.)

The resulting html you can find here: https://www.hoowl.se

Let me know should you have questions concerning the code!


Best wishes,

Hanno

Benoit Bidoggia <benoit.bidoggia@gmail.com> writes:

> Dear list,
>
> This is my problem: I have a large set of org files (created with
> org-roam), which contains all my thoughts on different topics (for
> example "work1", "work2", "personal1"...)
>
> I would like to create different projects (for example "work1",
> "work2", "personal1") to be able to publish these files under
> different folders (for example "./pub_work1", "./pub_work2",
> "./pub_personal1") for which I could define some filters to decide
> what goes where.
>
> The rules should be something likes this:
> - nothing is exported, except that
> - files with tag "WORK1" are exported in "./pub_work1"
> - files with tag "WORK2" are exported in "./pub_work2"
> - files with tag "PERSONAL1" are exported in "./pub_personal1"
>
> I cannot use the file name to filter the files, which seems to exclude
> the possibility of using the options ":exclude" and ":include" of
> org-publish-project-alist.
>
> Ideally I would like to use tags (or some descriptors I can include
> directly in the org file), but I did not have much success using the
> options ":with-tags" or ":select-tags".
>
> Can this be done? If so, how?
>
> Thank you very much, best regards.
> Benoît


--
Hanno Perrey
https://hoowl.se


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

end of thread, other threads:[~2022-07-22 19:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-18 11:11 Publishing a project and selecting files (possibly with tags) Benoit Bidoggia
2022-07-20 20:38 ` Munyoki Kilyungi
2022-07-22 19:32 ` Hanno Perrey

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).