diff --git a/jsconfig.json b/jsconfig.json new file mode 100644 index 0000000..e8b3494 --- /dev/null +++ b/jsconfig.json @@ -0,0 +1,7 @@ +{ + "compilerOptions": { + "paths": { + "@/*": ["./src/*"] + } + } +} \ No newline at end of file diff --git a/src/App.vue b/src/App.vue index 8f9a924..8cbcbe8 100644 --- a/src/App.vue +++ b/src/App.vue @@ -31,11 +31,10 @@ import Footer from './features/footer/components/Footer.vue'; \ No newline at end of file diff --git a/src/features/nav/components/Navbar.vue b/src/features/nav/components/Navbar.vue index d15a230..8ecdd2a 100644 --- a/src/features/nav/components/Navbar.vue +++ b/src/features/nav/components/Navbar.vue @@ -16,7 +16,9 @@ limitations under the License. \ No newline at end of file diff --git a/src/router/index.js b/src/router/index.js index 74cc205..5ba9189 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -14,21 +14,47 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { createRouter, createWebHistory } from 'vue-router' +import { createRouter, createWebHistory } from 'vue-router'; -import SearchView from '../views/SearchView.vue' +import SearchView from '../views/SearchView.vue'; +import SearchResultsView from '@/features/search/views/SearchResultsView.vue'; const routes = [ { path: '/', - name: 'search', + name: 'startPage', component: SearchView + }, + { + path: '/search', + name: 'searchResults', + component: SearchResultsView, + props: route => ({ + searchQuery: route.query.q + }), + meta: { + title: (route) => route.query.q + } } -] +]; const router = createRouter({ history: createWebHistory(), routes -}) +}); -export default router \ No newline at end of file +// set page title +router.afterEach(to => { + const title = + typeof to.meta.title === 'function' + ? to.meta.title(to) + : to.meta.title; + + if (title) { + document.title = `${title} - Seekra`; + } else { + document.title = 'Seekra'; + }; +}); + +export default router; \ No newline at end of file diff --git a/src/styles/common.css b/src/styles/common.css index d01c4f1..9adf663 100644 --- a/src/styles/common.css +++ b/src/styles/common.css @@ -23,4 +23,12 @@ body { min-height: 100vh; display: flex; flex-direction: column; +} + +.link { + text-decoration: none; +} + +.link:hover:not(.button-link) { + text-decoration: underline; } \ No newline at end of file diff --git a/src/views/SearchView.vue b/src/views/SearchView.vue index 0ec7c61..4ac2462 100644 --- a/src/views/SearchView.vue +++ b/src/views/SearchView.vue @@ -15,23 +15,43 @@ limitations under the License. --> \ No newline at end of file