WordPressのお問い合わせフォーム、Contactform7
送信ボタンを押しても、ページが再読み込みされるだけで何も起こらない
という謎のバグを引き起こし、そして解決した。
path に fill を指定してあげるだけ
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="#666666" d="〜〜〜〜〜〜"/></svg>
まぁ、こちらに書いてある通りなのですが…
ここまでは Hosting の時と同じ
( ) Database: Deploy Firebase Realtime Database Rules ( ) Firestore: Deploy rules and create indexes for Firestore (*) Functions: Configure and deploy Cloud Functions (*) Hosting: Configure and deploy Firebase Hosting sites ( ) Storage: Deploy Cloud Storage security rules
これの時に、Hostingに加えてFunctionsも選択する
$ cd public $ rm *
functions/static を作り、適当な index.html を置いておく
const functions = require('firebase-functions') const express = require('express') const basicAuth = require('basic-auth-connect') const app = express() app.all('/*', basicAuth(function(user, password) { return user === 'アイディ〜' && password === 'パスワ〜ド'; })); app.use(express.static(__dirname + '/static/')) exports.app = functions.https.onRequest(app)
{ "hosting": { "public": "public", "rewrites": [ { "source": "**", "function": "app" } ], "ignore": [ "firebase.json", "**/.*", "**/node_modules/**" ] } }
$ cd functions $ npm install --save express $ npm install --save basic-auth-connect $ cd ..
できた〜〜〜〜