<?xml version="1.0" encoding="utf-8" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>あやじんノート</title>
<link>https://ameblo.jp/a-ya-jin/</link>
<atom:link href="https://rssblog.ameba.jp/a-ya-jin/rss20.xml" rel="self" type="application/rss+xml" />
<atom:link rel="hub" href="http://pubsubhubbub.appspot.com" />
<description>普通の大学生です。</description>
<language>ja</language>
<item>
<title>1.　ブログの基本レイアウト設定</title>
<description>
<![CDATA[ <p>こんにちは。</p><p>今日はhtmlとcssを使ったブログの基本レイアウトの設定です。</p><p>とは言え、ディザインはシンプルです。</p><p>まずはコードです。</p><p><a href="https://stat.ameba.jp/user_images/20200107/21/a-ya-jin/b4/f1/p/o0832021814692361776.png"><img alt="" height="110" src="https://stat.ameba.jp/user_images/20200107/21/a-ya-jin/b4/f1/p/o0832021814692361776.png" width="420"></a></p><p>app.jsです。</p><p>先日問題になった$portは、とりあえず消してみました。</p><p>他はほぼ同じですが、404エラーの処理ができるようになりました。</p><p><a href="https://stat.ameba.jp/user_images/20200107/21/a-ya-jin/9a/0a/p/o0561053714692361700.png" style="background-color: inherit; color: rgb(0, 102, 204); font-family: &amp;quot;ヒラギノ角ゴ pro w3&amp;quot;,&amp;quot;hiragino kaku gothic pro&amp;quot;,&amp;quot;ｍｓ ｐゴシック&amp;quot;,&amp;quot;ms pgothic&amp;quot;,sans-serif,&amp;quot;メイリオ&amp;quot;,meiryo; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: underline; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"><img alt="" contenteditable="inherit" height="402" src="https://stat.ameba.jp/user_images/20200107/21/a-ya-jin/9a/0a/p/o0561053714692361700.png" style="background-color: inherit; border-bottom-color: currentColor; border-bottom-style: none; border-bottom-width: medium; border-image-outset: 0; border-image-repeat: stretch; border-image-slice: 100%; border-image-source: none; border-image-width: 1; border-left-color: currentColor; border-left-style: none; border-left-width: medium; border-right-color: currentColor; border-right-style: none; border-right-width: medium; border-top-color: currentColor; border-top-style: none; border-top-width: medium; cursor: default; height: auto; max-width: 99%; opacity: 0.8; outline-color: rgb(51, 51, 51); outline-style: solid; outline-width: 1px;" width="420"></a></p><p>ｃｓｓのファイルです。</p><p>それぞれの場合によるidどおりに使います。</p><p>基本的な機能だけで作りましたが、ミスっちゃって時間の表示が大きすぎです。<a href="https://stat.ameba.jp/user_images/20200107/21/a-ya-jin/c7/68/p/o0886030114692364978.png"><img alt="" height="143" src="https://stat.ameba.jp/user_images/20200107/21/a-ya-jin/c7/68/p/o0886030114692364978.png" width="420"></a></p><p>一番最初に見えるページです。</p><p>簡単です。</p><p><a href="https://stat.ameba.jp/user_images/20200107/21/a-ya-jin/a6/7d/p/o0926070214692361718.png" style="background-color: inherit; color: rgb(0, 102, 204); font-family: &amp;quot;ヒラギノ角ゴ pro w3&amp;quot;,&amp;quot;hiragino kaku gothic pro&amp;quot;,&amp;quot;ｍｓ ｐゴシック&amp;quot;,&amp;quot;ms pgothic&amp;quot;,sans-serif,&amp;quot;メイリオ&amp;quot;,meiryo; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: underline; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"><img alt="" contenteditable="inherit" height="318" src="https://stat.ameba.jp/user_images/20200107/21/a-ya-jin/a6/7d/p/o0926070214692361718.png" style="background-color: inherit; border-bottom-color: currentColor; border-bottom-style: none; border-bottom-width: medium; border-image-outset: 0; border-image-repeat: stretch; border-image-slice: 100%; border-image-source: none; border-image-width: 1; border-left-color: currentColor; border-left-style: none; border-left-width: medium; border-right-color: currentColor; border-right-style: none; border-right-width: medium; border-top-color: currentColor; border-top-style: none; border-top-width: medium; cursor: default; height: auto; max-width: 99%;" width="420"></a></p><p>自己紹介のページです。</p><p><a href="https://stat.ameba.jp/user_images/20200107/21/a-ya-jin/52/0e/p/o0903044214692361769.png" style="background-color: inherit; color: rgb(0, 102, 204); font-family: &amp;quot;ヒラギノ角ゴ pro w3&amp;quot;,&amp;quot;hiragino kaku gothic pro&amp;quot;,&amp;quot;ｍｓ ｐゴシック&amp;quot;,&amp;quot;ms pgothic&amp;quot;,sans-serif,&amp;quot;メイリオ&amp;quot;,meiryo; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: underline; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"><img alt="" contenteditable="inherit" height="206" src="https://stat.ameba.jp/user_images/20200107/21/a-ya-jin/52/0e/p/o0903044214692361769.png" style="background-color: inherit; border-bottom-color: currentColor; border-bottom-style: none; border-bottom-width: medium; border-image-outset: 0; border-image-repeat: stretch; border-image-slice: 100%; border-image-source: none; border-image-width: 1; border-left-color: currentColor; border-left-style: none; border-left-width: medium; border-right-color: currentColor; border-right-style: none; border-right-width: medium; border-top-color: currentColor; border-top-style: none; border-top-width: medium; cursor: default; height: auto; max-width: 99%;" width="420"></a></p><p>ブログのリストページです。</p><p>すべてのポストはblogフォルダーに入れて管理します。</p><p>一番関心を持ってるページです。</p><p>いろいろやってみる事が多いです。</p><p>機能の追加などはこのブログページを中心にする予定です。</p><p><a href="https://stat.ameba.jp/user_images/20200107/21/a-ya-jin/b4/69/p/o0886063014692361773.png"><img alt="" height="299" src="https://stat.ameba.jp/user_images/20200107/21/a-ya-jin/b4/69/p/o0886063014692361773.png" width="420"></a></p><p>ブログの初ポストです。</p><p>内容は単純しすぎるけど、個人的には気に入ります。</p><p>単純に見えるが、これ作るのも結構時間かかりました。。。</p><p>&nbsp;</p><p>実行すると、こうなります。</p><p><a href="https://stat.ameba.jp/user_images/20200107/22/a-ya-jin/66/45/p/o1365076214692370012.png"><img alt="" height="234" src="https://stat.ameba.jp/user_images/20200107/22/a-ya-jin/66/45/p/o1365076214692370012.png" width="420"></a></p><p><a href="https://stat.ameba.jp/user_images/20200107/22/a-ya-jin/2a/95/p/o1387063814692370265.png"><img alt="" height="193" src="https://stat.ameba.jp/user_images/20200107/22/a-ya-jin/2a/95/p/o1387063814692370265.png" width="420"></a></p><p><a href="https://stat.ameba.jp/user_images/20200107/22/a-ya-jin/f5/bb/p/o1363069014692370369.png"><img alt="" height="213" src="https://stat.ameba.jp/user_images/20200107/22/a-ya-jin/f5/bb/p/o1363069014692370369.png" width="420"></a></p><p><a href="https://stat.ameba.jp/user_images/20200107/22/a-ya-jin/e5/2f/p/o1460090614692370500.png"><img alt="" height="261" src="https://stat.ameba.jp/user_images/20200107/22/a-ya-jin/e5/2f/p/o1460090614692370500.png" width="420"></a></p><p>時間の表記が大きすぎること以外は、おもった通りです。</p><p>これからはずっと、javascriptの練習をしたいところです。</p><p>では、また。</p>
]]>
</description>
<link>https://ameblo.jp/a-ya-jin/entry-12565366557.html</link>
<pubDate>Tue, 07 Jan 2020 22:04:56 +0900</pubDate>
</item>
<item>
<title>0.基本ページを作ってみよう</title>
<description>
<![CDATA[ <p>初めまして。</p><p>今日から少しずつ、しっかりとホームページを作ってみようと思っています。</p><p>初心者の自己記録の為の投稿なので、まだまだ足りない所が多いです。</p><p>&nbsp;</p><p>まずはサーバーの決定。</p><p>私はVultr（<a href="https://www.vultr.com/" target="_blank">https://www.vultr.com/</a>）という会社で決定しました。</p><p>料金も安く（一か月に500円くらい）、サーバーが東京にあるので速度も早いです。</p><p><a href="https://stat.ameba.jp/user_images/20200104/22/a-ya-jin/f9/c6/p/o1279077314690685394.png"><img alt="" height="254" src="https://stat.ameba.jp/user_images/20200104/22/a-ya-jin/f9/c6/p/o1279077314690685394.png" width="420"></a></p><p>決済すると、こういうページが出ます。</p><p>右上のボタンを押すと、サーバーのコンソルのを見ることが可能。</p><p>ユーザーネームと暗証番号は左下に書いているどおりに。</p><p>リナックスを使ってみるのは初めてなので、CLIにはまだ慣れていません。</p><p>yumでnode.js（<a href="https://nodejs.org/ja/" target="_blank">https://nodejs.org/ja/</a>）をインストールした後、npmでexpress（<a href="http://expressjs.com/ja/" target="_blank">http://expressjs.com/ja/</a>）をインストール。</p><p>その次はexpressのホームページの説明を参考にして初期のコードを作成。</p><p>ファイルの作成はVIMというテキストエディターを利用します。</p><p><a href="https://stat.ameba.jp/user_images/20200104/22/a-ya-jin/77/da/p/o0629016714690685423.png"><img alt="" height="112" src="https://stat.ameba.jp/user_images/20200104/22/a-ya-jin/77/da/p/o0629016714690685423.png" width="420"></a></p><p>極めて単純なコードです。</p><p>htmlファイルは全部viewsというフォルダに入れて管理します。</p><p>&nbsp;</p><p>Line 6は、最初に接続するページをindex.htmlにする為のコード。</p><p>ただ、経路の指定は相対経路ではなく、絶対経路で指定しなければなりません。</p><p>その為に、相対経路の前に__dirnameを付けます。</p><p>そしたら、index.htmlでviewsフォルダにある他のhtmlファイル(例えば、blog.htmlを開けられない問題ができました。</p><p>それを解決する為のコードが、Line 5です（<a href="http://expressjs.com/en/starter/static-files.html" target="_blank">http://expressjs.com/ja/starter/static-files.html</a>参考）。</p><p>つまり、http://(サーバーのip)/blog.htmlに入ると、viewsフォルダにあるblog.htmlというファイルを開くことができるという話です。</p><p>&nbsp;</p><p>Line 7は、expressのホームページに提供された例のどおりに書いたのですが、何故か80が出力されずに、${port}がそのまま出力されます。</p><p>これに対してはもっと探してみる必要があります。</p><p>&nbsp;</p><p>この状態でhttp://(サーバーのip)/に入ったとしても、ホームページに入ることはできません。</p><p>とりあえずはサーバーのファイアウォールの設定で、ポートを開ける必要があります。</p><p>次をroot権限で入力します。</p><p>iptables -I INPUT -p tcp --dport 80 -j ACCEPT</p><p>&nbsp;</p><p>基本ページであるindex.htmlのコード下記の様に。</p><p><a href="https://stat.ameba.jp/user_images/20200104/22/a-ya-jin/f8/53/p/o0494029814690685433.png"><img alt="" height="253" src="https://stat.ameba.jp/user_images/20200104/22/a-ya-jin/f8/53/p/o0494029814690685433.png" width="420"></a></p><p>とりあえずは簡単に、htmlだけで作ってみました。</p><p>基本的な技術の習得が目的である為、派手な効果などは最小限にして、できるだけ単純に作成するつもりです。</p><p>Line 9と10が問題になった為、上記のコードで静的ファイルに関する関数を使う様になりました。</p><p>&nbsp;</p><p>メインページはこの様です。</p><p><a href="https://stat.ameba.jp/user_images/20200104/22/a-ya-jin/35/ff/p/o0595040814690685409.png"><img alt="" height="288" src="https://stat.ameba.jp/user_images/20200104/22/a-ya-jin/35/ff/p/o0595040814690685409.png" width="420"></a></p><p>ちなみにabout.hmtlとblog.htmlはまだ作成していません。</p><p>これからもどんどん成長していきたいな、と思います。</p>
]]>
</description>
<link>https://ameblo.jp/a-ya-jin/entry-12564638256.html</link>
<pubDate>Sat, 04 Jan 2020 22:50:42 +0900</pubDate>
</item>
</channel>
</rss>
