2024-08-11 Sunday

今日のhugoさん 本日の作業 月別アーカイブ表示できるようにした。手順は以下の通り。基本ググって写経…。 あとでまとめるかも。 hugo.toml taxnomy に archives 追加 [taxonomies] tag = "tags" category = "categories" archive = "archives" easy-hugo の new post のfront matter に '#+archives: 2024/08' が入るように設定 (leaf easy-hugo :ensure t :init (setq easy-hugo-basedir "~/blog/") (setq easy-hugo-url "https://xxxxxx.netlify.app") (setq easy-hugo-sshdomain "xxxxxt.org") (setq easy-hugo-root "/") (setq easy-hugo-previewtime "300") (setq easy-hugo-postdir "content/posts") (setq easy-hugo-org-header t) (setq easy-hugo-default-ext ".org") ;; Sort-publishday on startup (setq easy-hugo--sort-publishday-flg 1) (setq easy-hugo--sort-char-flg nil) (setq easy-hugo--sort-time-flg nil) (defun my/easy-hugo-newpost (post-file) "easy-hugo-newpost customized version." (interactive (list (read-from-minibuffer "Filename: " `(,easy-hugo-default-ext . 1) nil nil nil))) (let* ((slug (format-time-string "%Y%m%d%H%M")) (new-post-file (concat slug "." post-file))) (easy-hugo-with-env (let ((filename (expand-file-name new-post-file easy-hugo-postdir))) (when (file-exists-p (file-truename filename)) (error "%s already exists!" filename)) (find-file filename) (insert (my/easy-hugo--org-headers (file-name-base post-file) slug)) (goto-char (point-max)) (save-buffer))))) (advice-add 'easy-hugo-newpost :override 'my/easy-hugo-newpost) (defun my/easy-hugo--org-headers (file slug) "Return a draft org mode header string for a new article as FILE." (let ((datetimezone (concat (format-time-string "%Y-%m-%dT%T") (easy-hugo--orgtime-format (format-time-string "%z")))) (year_month (format-time-string "%Y/%m")) ) (concat "#+title: " file "\n#+subtitle: hogemoge diary" "\n#+date: " datetimezone "\n#+publishdate: " datetimezone "\n#+lastmod: " "\n#+slug: " slug "\n#+categories[]: journal" "\n#+tags[]: memo" "\n#+archives: " year_month "\n#+author: @tsut" "\n#+draft: nil" ;; "\n#+toc: false" "\n\n"))) (advice-add 'easy-hugo--org-headers :override 'my/easy-hugo--org-headers) ) 今までのコンテンツに '#+archives: 2024/08' とかを差し込む サイドバーにアーカイブ表示用のhtmlを作成。~/blog/layouts/partials/widgets/archives ...

8月 11, 2024 · @tsut

2024-07-29 Monday

今日のあれこれ シン・ムサシ vs コメリ。材木の品揃え勝負はムサシの売り場面積勝ち。 強風で遮光ネットが保たない問題。経年と日に晒されて弱まってる。とりあえずビニ紐で補強したけど、見た目も大事だし悩。 今日のhugoさん [news]タグ止めた。毎日ちっとはなにかのnews、だったら付ける意味ないんじゃね?そういう意味では[memo]も要らないが、こっちは自動設定になってる。[news]って手動で付けるのが面倒になった…が本当のところ。 今日のごはん 朝: 人参シリシリとハッシュドポテトとハムエッグ パン インスタントポタージュスープ アイスミルクコーヒー 昼: 人参シリシリ きんぴら さやえんどう胡麻和え れんこん揚 梅昆布大葉の混ぜご飯 (お弁当) 晩: 餃子 揚春巻き 胡瓜とトマトの中華風 焼きそば 今日もとりあえず飲まない 故あってしばらく飲まない…(つもり) 141日目

7月 29, 2024 · @tsut

2024-07-27 Saturday

今日のあれこれ 雨雲レーダーに翻弄されて出かけそびれた。オリンピックの開会式観たり、録画番組観たり。 今日のでっち上げ chromebookで、なんでかeasy-hugo.elが動かない。M-x easy-hugo-newpostできないのは面倒なので、やっつけ仕事った。 # ruby easyHugoNew.rb # filename myfilename = "journal.org" # entryを置く場所 mypath = "~/blog/content/posts" # 時刻取得 time = Time.now # タイトル用日付 mytitle = time.strftime("%Y-%m-%d %A") # ISO8601拡張形式 JST 2024-07-28T22:00:00+09:00 mydate = time.strftime("%Y-%m-%dT%R:%S+09:00") # format time to slug myslug = time.strftime( "%Y%m%d%H%M" ) # path+filename mypost = "#{mypath}/#{myslug}.#{myfilename}" # fileを作る file = File.open(File.expand_path(mypost), "w") # front matter myheader = <<EOF ,#+title: #{mytitle} ,#+subtitle: hogemoge diary ,#+date: #{mydate} ,#+publishdate: #{mydate} ,#+lastmod: ,#+categories[]: journal ,#+draft: true ,#+tags[]: memo ,#+author: @tsut ,#+slug: #{myslug} EOF # front matter を書き込む file.puts myheader file.close どうでしょう? ...

7月 27, 2024 · @tsut

netlify.toml

Production: main@xxxxxxx Failed netlifyでhugoのbuildがこけるようになった。apt upgradeで入った手元のhugo v0.128.2とかでエラーや警告がでないよう設定してるうちにnetlyfy上の新しくないhugoではbuildできない設定になってしまった模様。 対策 手元のhugoをダウンバージョンする netlify上のhugoを手元に合わせる netlifyをなんとかする方向でググる。netlyfi.tomlでhugoのversionなどの環境を設定できるらしい。 netlify.toml 書き方が分からないので丸写し。config.tomlと同じ場所に置く。 # https://bioscryptome.t-ohashi.info/hugo/hugo-netlify-build/#netlifytoml%E3%82%92%E8%BF%BD%E5%8A%A0%E3%81%99%E3%82%8B [build] publish = "public" command = "hugo" [context.production.environment] # HUGO_VERSION = "0.70.0" HUGO_VERSION = "0.128.2" HUGO_ENV = "production" HUGO_ENABLEGITINFO = "true" 結果 blog.sorakote.net: Production: main@xxxxxxx Completed できた。

7月 20, 2024 · @tsut

2024-06-25 Tuesday

今日のあれこれ 昼休みに本読んでると昼寝できない問題 KeePassXC 2.7.9 released – KeePassXC note は update した。 今日のhugoさん フォントの設定変えてみた(つもり)。変わってない気もする。 ぐちゃぐちゃになったけど変わった気がする。(どっちじゃねん!) もうちょっと整理したらまとめる。 今日のごはん 朝: ホットサンド コーヒー 昼: ハンバーグ弁当 晩: ビビンバ わかめスープ 今日もとりあえず飲まない 故あってしばらく飲まない…(つもり) 107日目

6月 25, 2024 · @tsut