Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change the heading of articles ## 🔖 Articles #106

Closed
sywhb opened this issue May 17, 2023 · 4 comments · Fixed by #144
Closed

Change the heading of articles ## 🔖 Articles #106

sywhb opened this issue May 17, 2023 · 4 comments · Fixed by #144
Assignees
Labels
enhancement New feature or request

Comments

@sywhb
Copy link
Collaborator

sywhb commented May 17, 2023

No description provided.

@sywhb sywhb added the enhancement New feature or request label May 17, 2023
@luismcv
Copy link

luismcv commented May 20, 2023

It'd be good as well if it could be optionally disabled all together. If you save each article on a separate page you don't need this top block on it.

@sywhb sywhb self-assigned this Jun 7, 2023
@yitsushi
Copy link

When isSinglePage is false, it's 100% an unnecessary clutter.

@yitsushi
Copy link

yitsushi commented Oct 20, 2023

I'm far from being competent with TS and how Logseq works, so I'll not open a PR about it as I know I'll not be able to address deeper issues about it, but I think that should a good starting point:
(both changes are inside a if (!isSinglePage) { check, noted because it's not clear from the diff)

❯ git diff src
diff --git a/src/index.ts b/src/index.ts
index 50c9737..2643725 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -239,7 +239,8 @@ const fetchOmnivore = async (inBackground = false) => {
           pageName = replaceIllegalChars(
             renderPageName(article, pageNameTemplate, preferredDateFormat)
           )
-          targetBlockId = (await getOmnivoreBlock(pageName, blockTitle)).uuid
+          const page = await getOmnivorePage(pageName)
+          targetBlockId = page.uuid
         }
         const articleBatch = articleBatchMap.get(targetBlockId) || []
         // render article content
@@ -415,7 +416,8 @@ const fetchOmnivore = async (inBackground = false) => {
             pageNameTemplate,
             preferredDateFormat
           )
-          targetBlockId = (await getOmnivoreBlock(pageName, blockTitle)).uuid
+          const page = await getOmnivorePage(pageName)
+          targetBlockId = page.uuid

           // delete page if article is synced to a separate page and page is not a journal
           const existingPage = await logseq.Editor.getPage(pageName)

I'm sure I'm missing things that has to be updated to achieve this.

@sywhb
Copy link
Collaborator Author

sywhb commented Oct 25, 2023

Hey @yitsushi, thanks for inspiration and I have made some changes based on your code.

A new version of the plugin v1.14.0 is just released and I have added a setting for people to customize the heading.

Screenshot 2023-10-25 at 11 00 47 AM

@sywhb sywhb closed this as completed Nov 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
3 participants