logseq / logseq

A privacy-first, open-source platform for knowledge management and collaboration. Download link: http://github.com/logseq/logseq/releases. roadmap: http://trello.com/b/8txSM12G/roadmap
https://logseq.com
GNU Affero General Public License v3.0
30.26k stars 1.77k forks source link

Journal Template not getting applied #4519

Closed kerim closed 1 year ago

kerim commented 2 years ago

What happened?

When opening Logseq for the first time on a new day it should open a new journal page for that day with the journal template specified in config.edn. This is not happening, at least not reliably. I have to apply the journal template manually.

Reproduce the Bug

Define journal template in config.edn Wait for new day to start

Expected Behavior

New journal should automatically apply the template that has been defined

Screenshots

No response

Desktop Platform Information

MacOS

Mobile Platform Information

No response

Additional Context

Not sure if it is related to this bug report or not?

florianjehn commented 2 years ago

I have the same problem. I have defined a daily template and changed the config.edn. However, it does not show up on the journals page ever.

mishrasidhant commented 2 years ago

Just created a template for my journal page and struggled to find a way for it to show up on future and past journal dates. I was trying to create pages by:

Turns out that the template will apply only on the current page see this comment. Verified to be the case for me, followed the steps outlined in this blog post. Will wait to see if the template applies automagically on future journal entries when the date changes.

kerim commented 2 years ago

That is correct, it is only supposed to work on the current day's page when opening for the first time. When I reported it was not doing this. It seems to be better after the last update, but I'm not sure if the problem is really completely gone or not...

meldarionqeusse commented 2 years ago

I followed https://thinkstack.club/how-to-set-up-an-automated-daily-template-in-logseq/ and the template is still not being applied to the journal for the current day

mishrasidhant commented 2 years ago

I followed https://thinkstack.club/how-to-set-up-an-automated-daily-template-in-logseq/ and the template is still not being applied to the journal for the current day

Can you post a screenshot of the template and the config where you applied it. Seems to work for me on the Desktop and Android app (0.6.5)

I had to empty the current days journal and refresh logseq for the changes to take affect for the current day journal.

meldarionqeusse commented 2 years ago

image image image

I am also running v 0.6.5

EDIT: here is my config.edn

{:meta/version 1

 ;; Currently, we support either "Markdown" or "Org".
 ;; This can overwrite your global preference so that
 ;; maybe your personal preferred format is Org but you'd
 ;; need to use Markdown for some projects.
 ;; :preferred-format ""

 ;; Preferred workflow style.
 ;; Value is either ":now" for NOW/LATER style,
 ;; or ":todo" for TODO/DOING style.
 :preferred-workflow :todo

 ;; The app will ignore those directories or files.
 ;; E.g. "/archived" "/test.md"
 :hidden []

 ;; When creating the new journal page, the app will use your template if there is one.
 ;; You only need to input your template name here.
 :default-templates
 {:journals "daily"}

 ;; Whether to enable hover on tooltip preview feature
 ;; Default is true, you can also toggle this via setting page
 :ui/enable-tooltip? true

 :feature/enable-block-timestamps? false

 ;; Specify a custom CSS import
 ;; This option take precedence over your local `logseq/custom.css` file
 ;; You may find a list of awesome logseq themes here:
 ;; https://github.com/logseq/awesome-logseq#css-themes
 ;; Example:
 ;; :custom-css-url "@import url('https://cdn.jsdelivr.net/gh/dracula/logseq@master/custom.css');"

 ;; When :all-pages-public? true, export repo would export all pages within that repo.
 ;; Regardless of whether you've set any page to public or not.
 ;; Example:
 ;; :publishing/all-pages-public? true

 ;; Specify default home page and sidebar status for Logseq
 ;; If not specified, Logseq default opens journals page on startup
 ;; value for `:page` is name of page
 ;; Possible options for `:sidebar` are
 ;; 1. `"Contents"` to open up `Contents` in sidebar by default
 ;; 2. `page name` to open up some page in sidebar
 ;; 3. Or multiple pages in an array ["Contents" "Page A" "Page B"]
 ;; If `:sidebar` is not set, sidebar will be hidden
 ;; Example:
 ;; 1. Setup page "Changelog" as home page and "Contents" in sidebar
 ;; :default-home {:page "Changelog", :sidebar "Contents"}
 ;; 2. Setup page "Jun 3rd, 2021" as home page without sidebar
 ;; :default-home {:page "Jun 3rd, 2021"}
 ;; 3. Setup page "home" as home page with multiple pages in sidebar
 ;; :default-home {:page "home" :sidebar ["page a" "page b"]}

 ;; Tell logseq to use a specific folder in the repo as a default location for notes
 ;; if not specified, notes are stored in `pages` directory
 ;; :pages-directory "your-directory"

 ;; Tell logseq to use a specific folder in the repo as a default location for journals
 ;; if not specified, journals are stored in `journals` directory
 ;; :journals-directory "your-directory"

 ;; Set this to true will convert
 ;; `[[Grant Ideas]]` to `[[file:./grant_ideas.org][Grant Ideas]]` for org-mode
 ;; For more, see https://github.com/logseq/logseq/issues/672
 ;; :org-mode/insert-file-link? true

 ;; If you prefer to use the file name as the page title
 ;; instead of the first heading's title
 ;; the only option for now is `file`
 ;; :page-name-order "file"

 ;; Setup custom shortcuts under `:shortcuts` key
 ;; Syntax:
 ;; 1. `+` means keys pressing simultaneously. eg: `ctrl+shift+a`
 ;; 2. ` ` empty space between keys represents key chords. eg: `t s` means press `s` follow by `t`
 ;; 3. `mod` means `Ctrl` for Windows/Linux  and `Command` for Mac
 ;; 4. use `false` to disable particular shortcut
 ;; 4. you can define multiple bindings for one action, eg `["ctrl+j" "down"]`
 ;; full list of configurable shortcuts are available below:
 ;; https://github.com/logseq/logseq/blob/master/src/main/frontend/modules/shortcut/config.cljs
 ;; Example:
 ;; :shortcuts
 ;; {:editor/new-block       "enter"
 ;;  :editor/new-line        "shift+enter"
 ;;  :editor/insert-link     "mod+shift+k"
 ;;  :editor/hightlight       false
 ;;  :ui/toggle-settings     "t s"
 ;;  :editor/up              ["ctrl+k" "up"]
 ;;  :editor/down            ["ctrl+j" "down"]
 ;;  :editor/left            ["ctrl+h" "left"]
 ;;  :editor/right           ["ctrl+l" "right"]}
 :shortcuts {}

 ;; By default, pressing `Enter` in the document mode will create a new line.
 ;; Set this to `true` so that it's the same behaviour as the usual outliner mode.
 :shortcut/doc-mode-enter-for-new-block? false

 ;; Whether to show command doc on hover
 :ui/show-command-doc? true

 ;; Whether to show empty bullets for non-document mode (the default mode)
 :ui/show-empty-bullets? false

 ;; The app will show those queries in today's journal page,
 ;; the "NOW" query asks the tasks which need to be finished "now",
 ;; the "NEXT" query asks the future tasks.
 :default-queries
 {:journals
  [
 {:title "Reminders"
  :query [:find (pull ?b [*])
  :where
   [?b :block/content ?c]
   [(clojure.string/includes? ?c "#reminder")]
   ]}
 {:title "Next Steps"
  :query [:find (pull ?b [*])
  :where
   [?b :block/content ?c]
   [(clojure.string/includes? ?c "#[[Next Steps]]")]
   ]}
]}

 ;; Add your own commands to speedup.
 ;; E.g. [["js" "Javascript"]]
 :commands
 []

 ;; Macros replace texts and will make you more productive.
 ;; For example:
 ;; Add this to the macros below:
 ;; {"poem" "Rose is $1, violet's $2. Life's ordered: Org assists you."}
 ;; input "{{{poem red,blue}}}"
 ;; becomes
 ;; Rose is red, violet's blue. Life's ordered: Org assists you.
 :macros {}

 ;; The default level to be opened for the linked references.
 ;; For example, if we have some example blocks like this:
 ;; - a [[page]] (level 1)
 ;;   - b        (level 2)
 ;;     - c      (level 3)
 ;;       - d    (level 4)
 ;;
 ;; With the default value of level 2, `b` will be collapsed.
 ;; If we set the level's value to 3, `b` will be opened and `c` will be collapsed.
 :ref/default-open-blocks-level 3

 :ref/linked-references-collapsed-threshold 50
 :favorites ["⚠ problem" "Next Steps" "TODOs in the next 7 Days" "ROW Eastman Phase 2" "ROW Eastman Phase 1 - Pump testing" "Borla TEs"]
 :graph/settings {:builtin-pages? false, :journal? false, :orphan-pages? false}
 :ui/show-brackets? false

 ;; any number between 0 and 1 (the greater it is the faster the changes of the next-interval of card reviews) (default 0.5)
 ;; :srs/learning-fraction 0.5

 ;; the initial interval after the first successful review of a card (default 4)
 ;; :srs/initial-interval 4

 ;; hide specific properties for blocks
 ;; E.g. #{:created-at :updated-at}
 ;; :block-hidden-properties #{}

 ;; logbook setup
 ;; :logbook/settings
 ;; {:with-second-support? false ;limit logbook to minutes, seconds will be eliminated
 ;;  :enabled-in-all-blocks true ;display logbook in all blocks after timetracking
 ;;  :enabled-in-timestamped-blocks false ;don't display logbook at all
 ;; }

 ;; Mobile photo uploading setup
 ;; :mobile/photo
 ;; {:allow-editing? true}

 ;; Extra CodeMirror options
 ;; :editor/extra-codemirror-options {:keyMap "emacs" :lineWrapping true}
 }
mishrasidhant commented 2 years ago

image image image

I am also running v 0.6.5

EDIT: here is my config.edn

{:meta/version 1

 ;; Currently, we support either "Markdown" or "Org".
 ;; This can overwrite your global preference so that
 ;; maybe your personal preferred format is Org but you'd
 ;; need to use Markdown for some projects.
 ;; :preferred-format ""

 ;; Preferred workflow style.
 ;; Value is either ":now" for NOW/LATER style,
 ;; or ":todo" for TODO/DOING style.
 :preferred-workflow :todo

 ;; The app will ignore those directories or files.
 ;; E.g. "/archived" "/test.md"
 :hidden []

 ;; When creating the new journal page, the app will use your template if there is one.
 ;; You only need to input your template name here.
 :default-templates
 {:journals "daily"}

 ;; Whether to enable hover on tooltip preview feature
 ;; Default is true, you can also toggle this via setting page
 :ui/enable-tooltip? true

 :feature/enable-block-timestamps? false

 ;; Specify a custom CSS import
 ;; This option take precedence over your local `logseq/custom.css` file
 ;; You may find a list of awesome logseq themes here:
 ;; https://github.com/logseq/awesome-logseq#css-themes
 ;; Example:
 ;; :custom-css-url "@import url('https://cdn.jsdelivr.net/gh/dracula/logseq@master/custom.css');"

 ;; When :all-pages-public? true, export repo would export all pages within that repo.
 ;; Regardless of whether you've set any page to public or not.
 ;; Example:
 ;; :publishing/all-pages-public? true

 ;; Specify default home page and sidebar status for Logseq
 ;; If not specified, Logseq default opens journals page on startup
 ;; value for `:page` is name of page
 ;; Possible options for `:sidebar` are
 ;; 1. `"Contents"` to open up `Contents` in sidebar by default
 ;; 2. `page name` to open up some page in sidebar
 ;; 3. Or multiple pages in an array ["Contents" "Page A" "Page B"]
 ;; If `:sidebar` is not set, sidebar will be hidden
 ;; Example:
 ;; 1. Setup page "Changelog" as home page and "Contents" in sidebar
 ;; :default-home {:page "Changelog", :sidebar "Contents"}
 ;; 2. Setup page "Jun 3rd, 2021" as home page without sidebar
 ;; :default-home {:page "Jun 3rd, 2021"}
 ;; 3. Setup page "home" as home page with multiple pages in sidebar
 ;; :default-home {:page "home" :sidebar ["page a" "page b"]}

 ;; Tell logseq to use a specific folder in the repo as a default location for notes
 ;; if not specified, notes are stored in `pages` directory
 ;; :pages-directory "your-directory"

 ;; Tell logseq to use a specific folder in the repo as a default location for journals
 ;; if not specified, journals are stored in `journals` directory
 ;; :journals-directory "your-directory"

 ;; Set this to true will convert
 ;; `[[Grant Ideas]]` to `[[file:./grant_ideas.org][Grant Ideas]]` for org-mode
 ;; For more, see https://github.com/logseq/logseq/issues/672
 ;; :org-mode/insert-file-link? true

 ;; If you prefer to use the file name as the page title
 ;; instead of the first heading's title
 ;; the only option for now is `file`
 ;; :page-name-order "file"

 ;; Setup custom shortcuts under `:shortcuts` key
 ;; Syntax:
 ;; 1. `+` means keys pressing simultaneously. eg: `ctrl+shift+a`
 ;; 2. ` ` empty space between keys represents key chords. eg: `t s` means press `s` follow by `t`
 ;; 3. `mod` means `Ctrl` for Windows/Linux  and `Command` for Mac
 ;; 4. use `false` to disable particular shortcut
 ;; 4. you can define multiple bindings for one action, eg `["ctrl+j" "down"]`
 ;; full list of configurable shortcuts are available below:
 ;; https://github.com/logseq/logseq/blob/master/src/main/frontend/modules/shortcut/config.cljs
 ;; Example:
 ;; :shortcuts
 ;; {:editor/new-block       "enter"
 ;;  :editor/new-line        "shift+enter"
 ;;  :editor/insert-link     "mod+shift+k"
 ;;  :editor/hightlight       false
 ;;  :ui/toggle-settings     "t s"
 ;;  :editor/up              ["ctrl+k" "up"]
 ;;  :editor/down            ["ctrl+j" "down"]
 ;;  :editor/left            ["ctrl+h" "left"]
 ;;  :editor/right           ["ctrl+l" "right"]}
 :shortcuts {}

 ;; By default, pressing `Enter` in the document mode will create a new line.
 ;; Set this to `true` so that it's the same behaviour as the usual outliner mode.
 :shortcut/doc-mode-enter-for-new-block? false

 ;; Whether to show command doc on hover
 :ui/show-command-doc? true

 ;; Whether to show empty bullets for non-document mode (the default mode)
 :ui/show-empty-bullets? false

 ;; The app will show those queries in today's journal page,
 ;; the "NOW" query asks the tasks which need to be finished "now",
 ;; the "NEXT" query asks the future tasks.
 :default-queries
 {:journals
  [
 {:title "Reminders"
  :query [:find (pull ?b [*])
  :where
   [?b :block/content ?c]
   [(clojure.string/includes? ?c "#reminder")]
   ]}
 {:title "Next Steps"
  :query [:find (pull ?b [*])
  :where
   [?b :block/content ?c]
   [(clojure.string/includes? ?c "#[[Next Steps]]")]
   ]}
]}

 ;; Add your own commands to speedup.
 ;; E.g. [["js" "Javascript"]]
 :commands
 []

 ;; Macros replace texts and will make you more productive.
 ;; For example:
 ;; Add this to the macros below:
 ;; {"poem" "Rose is $1, violet's $2. Life's ordered: Org assists you."}
 ;; input "{{{poem red,blue}}}"
 ;; becomes
 ;; Rose is red, violet's blue. Life's ordered: Org assists you.
 :macros {}

 ;; The default level to be opened for the linked references.
 ;; For example, if we have some example blocks like this:
 ;; - a [[page]] (level 1)
 ;;   - b        (level 2)
 ;;     - c      (level 3)
 ;;       - d    (level 4)
 ;;
 ;; With the default value of level 2, `b` will be collapsed.
 ;; If we set the level's value to 3, `b` will be opened and `c` will be collapsed.
 :ref/default-open-blocks-level 3

 :ref/linked-references-collapsed-threshold 50
 :favorites ["⚠ problem" "Next Steps" "TODOs in the next 7 Days" "ROW Eastman Phase 2" "ROW Eastman Phase 1 - Pump testing" "Borla TEs"]
 :graph/settings {:builtin-pages? false, :journal? false, :orphan-pages? false}
 :ui/show-brackets? false

 ;; any number between 0 and 1 (the greater it is the faster the changes of the next-interval of card reviews) (default 0.5)
 ;; :srs/learning-fraction 0.5

 ;; the initial interval after the first successful review of a card (default 4)
 ;; :srs/initial-interval 4

 ;; hide specific properties for blocks
 ;; E.g. #{:created-at :updated-at}
 ;; :block-hidden-properties #{}

 ;; logbook setup
 ;; :logbook/settings
 ;; {:with-second-support? false ;limit logbook to minutes, seconds will be eliminated
 ;;  :enabled-in-all-blocks true ;display logbook in all blocks after timetracking
 ;;  :enabled-in-timestamped-blocks false ;don't display logbook at all
 ;; }

 ;; Mobile photo uploading setup
 ;; :mobile/photo
 ;; {:allow-editing? true}

 ;; Extra CodeMirror options
 ;; :editor/extra-codemirror-options {:keyMap "emacs" :lineWrapping true}
 }

I don't see any issues there..

Artafinde commented 2 years ago

+1 having this issue.

My template image

My config.edn image

The template works when I bring it up by typing /Template. But it does not get applied to the daily journal automatically.

Version 0.6.1

stefantaubert commented 2 years ago

I encounted the same problem. There is no way to set a journal template.

groliks commented 2 years ago

I'm having the exact same issue. Tried all the above suggestions. Logseq 0.6.6 desktop on Windows.

h-b commented 2 years ago

I'm having the same issue. Logseq 0.6.6 on Linux. My template is named daily and is configured in the config.edn as follows:

:default-templates
 {:journals "daily"}

This template works when inserting it manually via /template, but I never saw it applied automatically, whatever I do.

Endle commented 2 years ago

https://github.com/logseq/logseq/issues/4519#issuecomment-1106956354

This template works when inserting it manually via /template, but I never saw it applied automatically, whatever I do.

The journal template worked well for me in the past. However, since I upgraded to 0.6.7 Windows, it would never apply the template automatically.

Nationalgeographic commented 2 years ago

I'm having same issue. Journal template stopped working since last upgrade to latest, AppImage (Linux)

myjeshurun commented 2 years ago

Me too. Since I upgrade to 0.6.7, journal template stop working :-( I am on OSX 12.

kerim commented 2 years ago

Even weirder, sometimes the journal template is being applied to non-journal pages, if I happen to have been working on one of them the day before and open the app to that page - it will insert the template right in the middle of the page!

ghost commented 2 years ago

I'm experiencing the same problem. Journal templates which were applied in previous versions of Logseq are not applied. I'm on 0.6.7 via Flatpak. I have not edited the config between versions.

szaffarano commented 2 years ago

I think it's fixed in #5190

kerim commented 2 years ago

It is still broken in 0.6.8 is #5190 incorporated into 0.6.8?

h-b commented 2 years ago

In my case, version 0.6.8 seems to have fixed the problem, at least in the Linux app. However, it still does not work with the Android app (also version 0.6.8).

I synchronise the graph, on both OS I have the corresponding entry in config.edn under :default-templates. The entry in the journal only appears after I have opened the Linux app.

kerim commented 2 years ago

Today is the first day in a long time that my template was applied to a new journal entry. I'm now on 0.6.9. Let's see if this continues....

meldarionqeusse commented 2 years ago

same here template are working in 0.6.9

kerim commented 2 years ago

OK. Seems to be fixed. Closing.

groliks commented 2 years ago

Not fixed for me!

h-b commented 2 years ago

This issue is only about MacOS. But I assume, we are really talking about all platforms. As I mentioned, for me it works on Linux since 0.6.8, but it does not on Android. This did not change with 0.6.9.

kerim commented 2 years ago

@groliks seems to be using WIndows.

It is definitely fixed for me on MacOS right now.

groliks commented 2 years ago

Yes, I am on Windowws 10, logseq version 0.6.9

ghost commented 2 years ago

It does not seem fixed for me. I'm on Linux with version 0.6.9 installed via Flatpak.

h-b commented 2 years ago

It does not seem fixed for me. I'm on Linux with version 0.6.9 installed via Flatpak.

I am using AppImage on Linux and it works since 0.6.8. However it does not work on Android (0.6.9).

oriofdarkforest commented 2 years ago

0.6.9 Win10 Not working for me, so sad

kerim commented 2 years ago

@oriofdarkforest Is there a reason you haven't upgraded to 0.7.0?

oriofdarkforest commented 2 years ago

date inputs issue in advanced query all my quries not working in 0.7.0 https://github.com/logseq/logseq/issues/5424 ---update I rolled back to 0.6.5 now everything is fine

groliks commented 1 year ago

Finally, the daily tempalte started showing up for me, after installing 0.7.1 :)

kerim commented 1 year ago

Great. I am going to close this again. If anyone continues to have problems, please open a new ticket.