Skip to content

Commit

Permalink
Merge pull request #7 from HugoLnx/v1/google-secret-key
Browse files Browse the repository at this point in the history
V1/google secret key
  • Loading branch information
HugoLnx committed Mar 20, 2024
2 parents 38c48b5 + 0a11e52 commit 11e5750
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ jobs:

- name: Build Vike
run: npm run build:prod
env:
VITE_GOOGLE_SITE_VERIFICATION: ${{ secrets.VITE_GOOGLE_SITE_VERIFICATION }}

- name: Deploy
uses: JamesIves/github-pages-deploy-action@v4
Expand Down
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,15 @@ You can fork it and use, but please keep the credits at the footer.
2. Make code changes and watch the browser reload automatically.


### Deploy
1. Configure Github Pages to deploy from the branch `gh-pages`.
![screenshot](docs/github-pages-config.png)

2. Push to `main`.

3. Check if your deploy succeeded in your [Repository's Actions Page](https://github.com/HugoLnx/hugolnx.github.io/actions).
### Tasks
* Emulate final build being served
Expand All @@ -71,6 +80,14 @@ npm run build
The built files will be placed in the `dist` folder. You can deploy the contents of this folder to your web server.
### Google Search Console
You can verify your website on Google Search Console via metatag verification. To test that, put
your metatag token (generated by google) into `.env` file as the env var `VITE_GOOGLE_SITE_VERIFICATION`.
Then, when you run serve the app it should have the metatag there.
To make it work in github pages you just need to register `VITE_GOOGLE_SITE_VERIFICATION` at your github repository
as a secret.
### License
This project is licensed under the GNU General Public License v3.0. You can find the full text of the license [here](https://www.gnu.org/licenses/gpl-3.0.en.html).
Binary file added docs/github-pages-config.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 6 additions & 1 deletion src/components/PageHead.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,18 @@ const {
socialImage,
} = data;
const metatags = {
const rawMetatags = {
viewport: 'width=device-width, initial-scale=1',
'og:title': title,
'og:description': description,
description,
'og:url': pageUrl,
'og:site_name': mainTitle,
'og:image': socialImage,
'google-site-verification': import.meta.env.VITE_GOOGLE_SITE_VERIFICATION,
};
const metatags = Object.fromEntries(
Object.entries(rawMetatags).filter(([, content]) => content),
);
</script>

0 comments on commit 11e5750

Please sign in to comment.