summaryrefslogtreecommitdiff
path: root/mms-ox-publish.org
blob: 70b942b7b4a134a03c49575e052700452708ffcd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
#+TITLE: mms Emacs Config - Publishing
#+AUTHOR: MichaƂ Sapka (https://michal.sapka.me)
#+STARTUP: showall indent logdone

#+HUGO_BASE_DIR: ~/ghq/vcs.sapka.me/michal-sapka-me/
#+HUGO_WEIGHT: 400 
#+HUGO_SECTION: emacs/config
#+HUGO_CATEGORIES: emacs emacs-config
#+HUGO_MENU :menu "emacs-config" :name "Publishing"
#+HUGO_CUSTOM_FRONT_MATTER: :abstract "My emacs config - publishing to Hugo"
#+HUGO_CUSTOM_FRONT_MATTER: :menu-abstract "how the sausage... this site is made"
#+EXPORT_FILE_NAME: publishing
* Introduction

I have a website under https://michal.sapka.me.
It based on Hugo, but I want to /write/ in Org mode - and not in Markdown.

* OX-Hugo

Luckily, there is ready package called [[https://ox-hugo.scripter.co/][ox-hugo]].

#+begin_src emacs-lisp
  (use-package ox-hugo
    :ensure t
    :after ox)
#+end_src

* Local and remote writing

I write in subpage-per-file, so I have a dedicated =blog.org=, =bsd.org=, =star-trek.org=, or =emacs.org=.
All those files are stored in a single location on my computer.

#+begin_src emacs-lisp
  (setq mms-homepage-local-dir "/home/mms/ghq/vcs.sapka.me/michal-sapka-me/content-org/")
#+end_src

Sometimes however I want to edit them on a remote machine via =Tramp=.

#+begin_src emacs-lisp
  (setq mms-homepage-remote-dir (concat "/sshx:voy:" mms-homepage-local-dir))
#+end_src


I have a ready =ssh_config= for the =voy= (short for =voyager=) connection:

#+begin_src conf :tangle yes
Host voy
  HostName 10.0.135
  User mms
#+end_src

(don't worry, the device is not available outside my local network).

I open the folder via:

#+begin_src emacs-lisp
  (defun mms-open-homepage-org-files ()
    (interactive)
    (dired (if mms-is-voyager
               mms-homepage-local-dir
             mms-homepage-remote-dir)))

#+end_src

Finally, I want to have quick access

* Thesarus

#+begin_src emacs-lisp
  (use-package popup)

  (use-package synosaurus
    :after popup
    :config
    (setq synosaurus-backend 'synosaurus-backend-wordnet
          synosaurus-choose-method 'popup))
#+end_src

* Grammarly

#+begin_src emacs-lisp
(use-package flycheck)
  (use-package flycheck-grammarly
:after flycheck
    :config
    (setq flymake-grammarly-check-time 0.8)
    )
#+end_src

* Language tool

#+begin_src emacs-lisp
  (use-package languagetool
    :ensure t
    :commands (languagetool-check
               languagetool-clear-suggestions
               languagetool-correct-at-point
               languagetool-correct-buffer
               languagetool-set-language
               languagetool-server-mode
               languagetool-server-start
               languagetool-server-stop)
    :config
    (setq languagetool-server-host "https://api.languagetool.org"
      languagetool-server-port 443))

#+end_src

#+RESULTS:
: [nil 26264 12533 127221 nil elpaca-process-queues nil nil 0 nil]