Skip to content
This repository has been archived by the owner on Dec 19, 2023. It is now read-only.

Commit

Permalink
v1.0.2-rc.1
Browse files Browse the repository at this point in the history
fixed error on generate (list.vue)
  • Loading branch information
lovkyndig committed Nov 21, 2023
1 parent 1de4bde commit 35dfdd2
Show file tree
Hide file tree
Showing 26 changed files with 58 additions and 59 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion .playground/public/_pagefind/pagefind-entry.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"version":"1.0.3","languages":{"en":{"hash":"en_1e2131e0f6","wasm":"en","page_count":7}}}
{"version":"1.0.3","languages":{"en":{"hash":"en_80de125470","wasm":"en","page_count":7}}}
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export default defineNuxtConfig({
{
urlPattern: ({ url, sameOrigin }) => sameOrigin && url.pathname.match(/^\/.*(avatar|favicon|privacy|rss|sitemap).*/i),
handler: 'NetworkFirst' as const,
options: { cacheName: 'homepage' }
options: { cacheName: 'frontpage' }
}, // Every article have to be visited before it is cached
{
urlPattern: ({ url, sameOrigin }) => sameOrigin && url.pathname.match(/^\/(api|article)\/.*/i),
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lovkyndig/create-google-app",
"version": "1.0.1",
"version": "1.0.2-rc.1",
"type": "module",
"main": "./nuxt.config.ts",
"description": "⚡Nuxt layer with nuxt-content, full search-functionality, pwa and guide to how to publish to Google Play Store.",
Expand Down
60 changes: 54 additions & 6 deletions pages/list.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
<script setup lang="ts">
import type { ParsedContent } from '@nuxt/content/dist/runtime/types'
import pkg from '../package.json'
const titles = useSearchString()
const searchString = useState('searchString')
const appConfig = useAppConfig()
interface MyCustomParsedContent extends ParsedContent {
tags: string[]
Expand Down Expand Up @@ -188,7 +193,7 @@ onMounted(() => {
const series = route.query?.series as string || 'all'
currentSeries.value = series
echoQueryParam(route.query, route) // lovkyndig coded 2023
echoQueryParam(route.query, route.fullPath) // utils/list-helpers
})
/**
Expand Down Expand Up @@ -277,19 +282,62 @@ const getFileTypeIcon = (type) => {
}
}
/** -------------------------------- utils/search-and-seo-methods.ts --------------------------------- */
const appConfig = useAppConfig()
/** ---------------------------- utils/search-and-seo-methods.ts ------------------------------- */
useServerSeoMeta({
ogDescription: `${appConfig.myLayer.list.description} ${route.fullPath.slice(9)}`
}) // https://nuxt.com/docs/getting-started/seo-meta#useseometa
getAndUseSearchparam(route)
// Her starts list-helpers **************************************************
/**
*
* Publishing the TITLE.
* Using route.path as argument to this function.
* Using this function five times below, from here to the script end.
*
*/
const publishTitle = (value, routeFullpath) => { // using this function 5 times below
const title = ref(value)
titles.value = title
useSeoMeta({
title: title.value,
description: `${appConfig.myLayer.list.description} ${routeFullpath.slice(9)}`,
ogDescription: `${appConfig.myLayer.list.description} ${routeFullpath.slice(9)}`,
ogUrl: `${pkg.homepage}${routeFullpath}`
})
useHead({ link: [{ rel: 'canonical', href: `${pkg.homepage}${routeFullpath}` }] })
}
/**
* Loading echoQueryParam above onMounted
*/
const echoQueryParam = (queryObj, routeFullPath) => {
if (process.client) {
const querystring = window.location.search
if (querystring.substring(1)) { // set searchString.value
searchString.value = querystring.substring(1)
}
}
publishTitle(`${appConfig.myLayer.list.tags} ${searchString.value}`, routeFullPath)
}
function getAndUseSearchparam (routePath, routeFullPath) { // only on load
if (routeFullPath === routePath) {
publishTitle(appConfig.myLayer.list.tags_all, routeFullPath)
} else {
publishTitle(`${appConfig.myLayer.list.tags} ${routeFullPath.slice(9)}`, routeFullPath)
}
}
// Her ends list-helpers *******************************************
getAndUseSearchparam(route.path, route.fullPath) // utils/list-helpers
watch(() => route.fullPath, () => { // only on change after load
if (route.path === route.fullPath) {
publishTitle(appConfig.myLayer.list.tags_all, route)
publishTitle(appConfig.myLayer.list.tags_all, route.fullPath)
} else {
publishTitle(`${appConfig.myLayer.list.tags} ${route.fullPath.slice(9)}`, route)
publishTitle(`${appConfig.myLayer.list.tags} ${route.fullPath.slice(9)}`, route.fullPath)
}
})
Expand Down
Binary file removed public/_pagefind/fragment/en_2cd1656.pf_fragment
Binary file not shown.
Binary file removed public/_pagefind/fragment/en_365b242.pf_fragment
Binary file not shown.
Binary file added public/_pagefind/fragment/en_3938c17.pf_fragment
Binary file not shown.
Binary file added public/_pagefind/fragment/en_49b7cfb.pf_fragment
Binary file not shown.
Binary file added public/_pagefind/fragment/en_97e64cf.pf_fragment
Binary file not shown.
Binary file removed public/_pagefind/fragment/en_a08812d.pf_fragment
Binary file not shown.
Binary file added public/_pagefind/index/en_1760a73.pf_index
Binary file not shown.
Binary file removed public/_pagefind/index/en_cc809e5.pf_index
Binary file not shown.
2 changes: 1 addition & 1 deletion public/_pagefind/pagefind-entry.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"version":"1.0.3","languages":{"en":{"hash":"en_1e2131e0f6","wasm":"en","page_count":7}}}
{"version":"1.0.3","languages":{"en":{"hash":"en_80de125470","wasm":"en","page_count":7}}}
Binary file removed public/_pagefind/pagefind.en_1e2131e0f6.pf_meta
Binary file not shown.
Binary file added public/_pagefind/pagefind.en_80de125470.pf_meta
Binary file not shown.
49 changes: 0 additions & 49 deletions utils/search-and-seo-methods.ts

This file was deleted.

0 comments on commit 35dfdd2

Please sign in to comment.