masasam / emacs-easy-hugo

Emacs major mode for managing hugo

Home Page:https://gohugo.io/tools/editors/#emacs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to handle page bundles?

c-alpha opened this issue · comments

Subject pretty much says it all. I like keeping images and stuff together with the post itself, instead of inflating the static directory.

Page bundles do not show up on the list of posts, however. It seems I can sort of switch around using the + and - keys, but I guess that is not the intended use of those functions? Also, that way I see either the flat posts, or the page bundles, but never both (i.e. it is hard to keep an overview of all posts).

Any hints appreciated.

(defconst easy-hugo--formats `(,easy-hugo-markdown-extension
"org"
,easy-hugo-asciidoc-extension
"rst"
"mmark"
,easy-hugo-html-extension))

If you change easy-hugo--formats, you will be able to display jpg and png.

Apologies for not having been clear enough. By "page bundles do not show up on the list of posts" I mean that the post itself is not shown in the list of posts.

With the following directory structure under content/posts:

[...]
├── 2021-05-05-our-new-email-setup.md
├── 2022-06-04-bye-bye-to-wordpress
│   ├── gopher-hero.svg
│   ├── index.org
│   └── logo-1.png
└── 2022-06-15-forward-messages-in-notmuch-with-style.org

I get the following post list with M-x easy-hugo:

Easy-hugo  https://condition-alpha.com/blog/posts

n .. New blog post    R .. Rename file   G .. Deploy GitHub    D .. Draft list
p .. Preview          g .. Refresh       A .. Deploy AWS S3    u .. Sort publishday
v .. Open view-mode   s .. Sort time     T .. Publish timer    N .. No help-mode
d .. Delete post      c .. Open config   W .. AWS S3 timer     f .. Select filename
P .. Publish clever   C .. Deploy GCS    a .. Search with ag   H .. GitHub timer
< .. Previous blog    > .. Next blog     , .. Pre postdir      . .. Next postdir
F .. Full help [tab]  ; .. Select blog   / .. Select postdir   q .. Quit easy-hugo

2022-06-16 23:17:52 2022-06-15-forward-messages-in-notmuch-with-style.org
2022-06-02 17:58:31 2021-05-05-our-new-email-setup.md
[...]

I would have expected a "bye bye to wordpress" entry to appear as the second entry (that is, the between the two posts that are shown).

When I now hit the + key, I get this:

Easy-hugo  https://condition-alpha.com/blog/posts/2022-06-04-bye-bye-to-wordpress

n .. New blog post    R .. Rename file   G .. Deploy GitHub    D .. Draft list
p .. Preview          g .. Refresh       A .. Deploy AWS S3    u .. Sort publishday
v .. Open view-mode   s .. Sort time     T .. Publish timer    N .. No help-mode
d .. Delete post      c .. Open config   W .. AWS S3 timer     f .. Select filename
P .. Publish clever   C .. Deploy GCS    a .. Search with ag   H .. GitHub timer
< .. Previous blog    > .. Next blog     , .. Pre postdir      . .. Next postdir
F .. Full help [tab]  ; .. Select blog   / .. Select postdir   q .. Quit easy-hugo

2022-06-05 02:26:40 index.org

What I woudl have wished would have been shown with M-x easy-hugo:

Easy-hugo  https://condition-alpha.com/blog/posts

n .. New blog post    R .. Rename file   G .. Deploy GitHub    D .. Draft list
p .. Preview          g .. Refresh       A .. Deploy AWS S3    u .. Sort publishday
v .. Open view-mode   s .. Sort time     T .. Publish timer    N .. No help-mode
d .. Delete post      c .. Open config   W .. AWS S3 timer     f .. Select filename
P .. Publish clever   C .. Deploy GCS    a .. Search with ag   H .. GitHub timer
< .. Previous blog    > .. Next blog     , .. Pre postdir      . .. Next postdir
F .. Full help [tab]  ; .. Select blog   / .. Select postdir   q .. Quit easy-hugo

2022-06-16 23:17:52 2022-06-15-forward-messages-in-notmuch-with-style.org
2022-06-05 02:26:40 2022-06-04-bye-bye-to-wordpress/index.org
2022-06-02 17:58:31 2021-05-05-our-new-email-setup.md
[...]

Note the new entry on the second line in the post list.

Thank you for the detailed explanation.
Since the implementation of easy-hugo is premised on separating files and directories,
I think that it is necessary to rewrite almost all of easy-hugo in order to achieve this idea.
I don't recommend it because it will be very difficult and not simple.