Upgrade to Pro — share decks privately, control downloads, hide ads and more …

スライドファイルをセルフホスト(Pelican利用)

Sponsored · SiteGround - Reliable hosting with speed, security, and support you can count on.

 スライドファイルをセルフホスト(Pelican利用)

Avatar for Kenichiro MATOHARA

Kenichiro MATOHARA

June 11, 2022
Tweet

More Decks by Kenichiro MATOHARA

Other Decks in Technology

Transcript

  1. 探す 探す [1] 導入が楽(Debian pkgがあったりシングルバイナリだったり), Asciidocで書きたい……殆どない? 1. 更新止まってる? awesome-selfhosted/awesome-selfhosted: A

    list of Free Software network services and web applications which can be hosted on your own servers Static Site Generators Static Site Generators - Top Open Source SSGs | Jamstack 10 / 29
  2. package version package version [ [1 1] ] 1. $

    rmadison -u debian,ubuntu pelican debian: pelican | 3.4.0-2 | oldoldoldstable | source pelican | 3.7.1-1 | oldoldstable | source, all pelican | 4.0.1+dfsg-1 | oldstable | source, all pelican | 4.0.1+dfsg-1.1 | stable | source, all pelican | 4.7.1+dfsg-2 | testing | source, all pelican | 4.7.1+dfsg-2 | unstable | source, all ubuntu: pelican | 3.3-1 | trusty/universe | source pelican | 3.6.3-1 | xenial/universe | source, all pelican | 3.7.1+dfsg-1 | bionic/universe | source, all pelican | 4.0.1+dfsg-1 | focal/universe | source, all pelican | 4.0.1+dfsg-1.1 | impish/universe | source, all pelican | 4.7.1+dfsg-2build1 | jammy/universe | source, all pelican | 4.7.1+dfsg-2build1 | kinetic/universe | source, all Pelican 最新は 4.7.2 13 / 29
  3. pelican-quickstartで初期設定 pelican-quickstartで初期設定 pelican-quickstart のいくつかの質問に答えてテンプレートが作ら れる,後でファイルを修正して変更できる. $ mkdir pelican_blog && cd

    pelican_blog $ pelican-quickstart : > Where do you want to create your new web site? [.] > What will be the title of this web site? slide > Who will be the author of this web site? matoken > What will be the default language of this web site? [ja] > Do you want to specify a URL prefix? e.g., https://example.com (Y/n) n > Do you want to enable article pagination? (Y/n) > How many articles per page do you want? [10] 9 > What is your time zone? [Asia/Tokyo] > Do you want to generate a tasks.py/Makefile to automate generation and publishing? (Y/n) > Do you want to upload your website using FTP? (y/N) > Do you want to upload your website using SSH? (y/N) > Do you want to upload your website using Dropbox? (y/N) > Do you want to upload your website using S3? (y/N) > Do you want to upload your website using Rackspace Cloud Files? (y/N) > Do you want to upload your website using GitHub Pages? (y/N) Done. Your new project is available at /tmp/pelican_blog $ ls -Ap Makefile content/ output/ pelicanconf.py publishconf.py tasks.py 15 / 29
  4. Asciidocの導入(option) Asciidocの導入(option) or  後者の場合 pelicanconf.py に ASCIIDOC_CMD = "asciidoctor"

    を追記 $ sudo apt install asciidoc vim-asciidoc $ sudo apt install asciidoctor vim-asciidoc 17 / 29
  5. 記事を書いてみる(Asciidoc) 記事を書いてみる(Asciidoc) content/ 以下のファイルが記事として扱われる content/test.adoc = My super title :date:

    2022-06-09 17:46 :modified: 2022-06-09 17:46 :tags: thats, awesome :category: yeah :slug: my-super-post :authors: matoken :summary: Short version for index and feeds == title level 2 and so on... 18 / 29
  6. イベント情報とかコピペするの イベント情報とかコピペするの 面倒 面倒 タイトル,スライドpdfファイル,connpass IDを指定して実行すると雛形を作ってくれる テンプレートscriptを用意 $ bash ./connpass.sh

    Usage: ./connpass.sh TITLE SLIDEFILE [CONNPASSID] $ bash ./connpass.sh "Raspberry Pi Zeroをストレージ無しで活用" content/images/koedolug-2022.05.pdf = Raspberry Pi Zeroをストレージ無しで活用 :date: 2022-05-14 14:00 :modified: 2022-05-14 14:00 :tags: slide, koedolug :category: slide :slug: :authors: matoken :summary: :thumbnail: koedolug-2022.05.jpg image:images/koedolug-2022.05.jpg[] link:images/koedolug-2022.05.pdf[pdf] == 小江戸らぐ 5月のオフな集まり(第238回) 日時:: 2022-05-14 14:00 ~ 2022-05-14 20:00 場所:: オンライン 23 / 29
  7. 後は適当な場所にUploadすれば 後は適当な場所にUploadすれば OK OK output 以下を upload 1GB以下なら / /

    等 $ rsync -avcP output/ remore:~/public_html/slide GitHub Pages GitLab Pages Neocities $ du -hs . 1.8G . 26 / 29