Skip to content

Commit

Permalink
Local assets
Browse files Browse the repository at this point in the history
  • Loading branch information
spraddles committed Apr 27, 2021
1 parent 34f696e commit f712189
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 4 deletions.
Binary file added assets/fonts/stacylia.otf
Binary file not shown.
Binary file added assets/images/book.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 3 additions & 2 deletions components/navbar.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div>
<b-navbar toggleable="lg" type="light" variant="">
<b-navbar-brand href="#">
<b-navbar-brand href="/">
<img src="https://getbootstrap.com/docs/4.6/assets/brand/bootstrap-solid.svg" width="30" height="30" class="d-inline-block align-top" alt="">
</b-navbar-brand>
<b-navbar-toggle target="nav-collapse"></b-navbar-toggle>
Expand All @@ -12,6 +12,7 @@
<NuxtLink to="/local-head">Local_head</NuxtLink>
<NuxtLink to="/parent">Parent_child</NuxtLink>
<a href="/page-that-doesnt-exist">Redirect</a>
<NuxtLink to="/local-assets">Local_assets</NuxtLink>
</b-navbar-nav>
</b-collapse>
</b-navbar>
Expand All @@ -22,7 +23,7 @@
export default {}
</script>

<style>
<style scoped>
.navbar {
background-color:#e9ecef;
margin-bottom: 20px;
Expand Down
4 changes: 2 additions & 2 deletions nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ export default {

// from 'redirect-module': https://www.npmjs.com/package/@nuxtjs/redirect-module
redirect: [
// Redirect options here
// Redirect options here (only server side! not static)
{ from: '^/page-that-doesnt-exist', to: '/secret-page', statusCode: 301 }
],

// Middleware: https://nuxtjs.org/docs/2.x/components-glossary/pages-middleware
// 2 types of middleware: serverMiddleware + middleware (client side)
router: [
//middleware: 'custom-redirect'
// middleware: 'custom-redirect'
],

serverMiddleware: [
Expand Down
36 changes: 36 additions & 0 deletions pages/local-assets.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<template>
<div class="container">
<Navbar />
Here are some Local assets:<br><br><br>

Font:<br>
Here is a <span class="custom-font">cool font</span><br><br><br>

Image:<br>
<img src="~/assets/images/book.png" />

</div>
</template>

<script>
export default {}
</script>



<style scoped>
img {
width: 200px;
}
@font-face {
font-family: 'stacylia';
font-style: normal;
font-weight: 400;
font-display: swap;
src: url('~assets/fonts/stacylia.otf') format('truetype');
}
.custom-font {
font-family: stacylia;
font-size: 55px;
}
</style>

0 comments on commit f712189

Please sign in to comment.