Skip to content

Commit

Permalink
add meta tags to homepage & calculators (svelte)
Browse files Browse the repository at this point in the history
update home page links

sitemap.xml in robots.txt
  • Loading branch information
gamesguru committed May 25, 2023
1 parent d531fa1 commit dbe3f5b
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nutra-web",
"version": "0.3.12",
"version": "0.3.13",
"private": true,
"scripts": {
"dev": "vite dev",
Expand Down
16 changes: 12 additions & 4 deletions src/routes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,35 @@
import Footer from './Footer.svelte';
import { page } from '$app/stores';
var apiUrl = 'api.' + $page.url.hostname;
apiUrl == 'api.localhost' ? (apiUrl = `http://127.0.0.1:20000`) : (apiUrl = `https://${apiUrl}`);
import { STORE_URL } from './constants.ts';
let apiUrl = 'api.' + $page.url.hostname;
apiUrl === 'api.localhost' ? (apiUrl = `http://127.0.0.1:20000`) : (apiUrl = `https://${apiUrl}`);
console.info(apiUrl);
</script>

<!-- Head -->
<title>Home Page | NutraTech</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="description" content="Nutritional information, store, blog." />
<head />

<!-- Body -->
<Header />

<main class="container">
<h1>Home page</h1>
<p>Welcome!</p>
<p>Check out the blog, calculators, and other resources.</p>
<p>Check out the calculators, blog, and store.</p>

<p>(This is a work in progress.)</p>
<p>
You can find download instructions for the <code>nutra CLI</code> on the
<a href="/calculators/">/calculators</a> page.
</p>

<h2>Links</h2>
<p>Visit <a rel="external" href="/blog">/blog</a> for the blog</p>
<p>Visit <a rel="external" href={STORE_URL}>{STORE_URL}</a> for the store</p>
<p>Visit <a href={apiUrl}>{apiUrl}</a> for API documentation</p>

<Footer />
Expand Down
6 changes: 5 additions & 1 deletion src/routes/Header.svelte
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<script>
import { STORE_URL } from './constants.ts';
</script>

<main>
<nav class="container-fluid">
<ul>
Expand All @@ -14,7 +18,7 @@
<ul>
<li><a href="/calculators/" class="secondary">Calculators</a></li>
<li><a rel="external" href="/blog/" class="secondary">Blog</a></li>
<li><a rel="external" href="https://store.nutra.tk/store" class="secondary">Store</a></li>
<li><a rel="external" href={STORE_URL} class="secondary">Store</a></li>
<li>
<a
href="https://github.com/nutratech/web"
Expand Down
4 changes: 4 additions & 0 deletions src/routes/calculators/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,10 @@
<!-- Head -->
<title>Calculators | NutraTech</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta
name="description"
content="Calculate 1 rep max (1RM), BMR, body fat (bodyfat), and muscle potential."
/>

<!-- Body -->
<Header />
Expand Down
1 change: 1 addition & 0 deletions src/routes/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const STORE_URL = 'https://store.nutra.tk/store';
4 changes: 2 additions & 2 deletions static/robots.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ Host: http://nutra.tk
User-agent: *
Allow: /

# TODO: generate sitemap
# Sitemap: https://nutra.tk/sitemap.xml
# Sitemap
Sitemap: https://nutra.tk/sitemap.xml
18 changes: 18 additions & 0 deletions static/sitemap.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<!-- Internal links -->
<url>
<loc>https://nutra.tk/calculators/</loc>
<lastmod>2022-06-04</lastmod>
</url>
<!-- External apps -->
<url>
<loc>https://nutra.tk/blog/</loc>
<lastmod>2022-06-04</lastmod>
</url>
<!-- External apps with sub-domain -->
<url>
<loc>https://store.nutra.tk/store</loc>
<lastmod>2022-06-04</lastmod>
</url>
</urlset>

0 comments on commit dbe3f5b

Please sign in to comment.