Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Portfolio sample #2

Merged
merged 13 commits into from Nov 22, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 13 additions & 0 deletions portfolio-sample/.editorconfig
@@ -0,0 +1,13 @@
# editorconfig.org
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
23 changes: 23 additions & 0 deletions portfolio-sample/.eslintrc.js
@@ -0,0 +1,23 @@
module.exports = {
root: true,
env: {
browser: true,
node: true
},
parser: 'vue-eslint-parser',
parserOptions: {
parser: 'typescript-eslint-parser'
},
extends: [
'eslint:recommended',
'plugin:vue/recommended',
'plugin:prettier/recommended',
'typescript'
],
// add your custom rules here
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'semi': ['error', 'never']
}
}
81 changes: 81 additions & 0 deletions portfolio-sample/.gitignore
@@ -0,0 +1,81 @@
# Created by .ignore support plugin (hsz.mobi)
### Node template
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

# parcel-bundler cache (https://parceljs.org/)
.cache

# next.js build output
.next

# nuxt.js build output
.nuxt

# Nuxt generate
dist

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless

# IDE
.idea
4 changes: 4 additions & 0 deletions portfolio-sample/.prettierrc
@@ -0,0 +1,4 @@
{
"semi": false,
"singleQuote": true
}
22 changes: 22 additions & 0 deletions portfolio-sample/README.md
@@ -0,0 +1,22 @@
# portfolio-sample

> My cat's pajamas Nuxt.js project

## Build Setup

``` bash
# install dependencies
$ yarn install

# serve with hot reload at localhost:3000
$ yarn run dev

# build for production and launch server
$ yarn run build
$ yarn start

# generate static project
$ yarn run generate
```

For detailed explanation on how things work, checkout [Nuxt.js docs](https://nuxtjs.org).
7 changes: 7 additions & 0 deletions portfolio-sample/assets/README.md
@@ -0,0 +1,7 @@
# ASSETS

**This directory is not required, you can delete it if you don't want to use it.**

This directory contains your un-compiled assets such as LESS, SASS, or JavaScript.

More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/assets#webpacked).
35 changes: 35 additions & 0 deletions portfolio-sample/components/MyAbout.vue
@@ -0,0 +1,35 @@
<template>
<div class="about-container">
<h1 class="title">About</h1>

<div class="text">
<p class="name">yinm</p>
<p class="description">I'm a Web Application Engineer.</p>
</div>
</div>
</template>

<script lang="ts">
import { Component, Vue } from 'nuxt-property-decorator'

@Component({})
export default class MyAbout extends Vue {}
</script>

<style scoped>
.title {
font-size: 2rem;
}

.text {
margin-top: 40px;
}

.text p {
margin-top: 10px;
}

.name {
font-weight: bold;
}
</style>
49 changes: 49 additions & 0 deletions portfolio-sample/components/MyNavigationBar.vue
@@ -0,0 +1,49 @@
<template>
<header>
<nav class="nav-container">
<h1>My Portfolio site</h1>
<ul>
<li>
<nuxt-link to="/">Home</nuxt-link>
</li>
<li>
<nuxt-link to="/repos">Repos</nuxt-link>
</li>
</ul>
</nav>
</header>
</template>

<script lang="ts">
import { Component, Vue } from 'nuxt-property-decorator'

@Component({})
export default class MyNavigationBar extends Vue {}
</script>

<style scoped>
header {
border-bottom: solid 1px #ddd;
padding-top: 20px;
padding-bottom: 20px;
}

.nav-container {
display: flex;
max-width: 1000px;
margin: 0 auto;
justify-content: space-between;
align-items: center;
}

ul {
display: flex;
margin: 0;
padding: 0;
list-style: none;
}

li:not(:last-child) {
margin-right: 20px;
}
</style>
54 changes: 54 additions & 0 deletions portfolio-sample/components/MyRepository.vue
@@ -0,0 +1,54 @@
<template>
<a
:href="repo.html_url"
class="card"
>
<div class="text">
<p class="name">{{ repo.name }}</p>
<p>{{ repo.description }}</p>
</div>

<div class="icons">
<div v-if="repo.language">
<span class="language">{{ repo.language }}</span>
</div>
<div class="star">
<span>star: {{ repo.stargazers_count }}</span>
</div>
</div>
</a>
</template>

<script lang="ts">
import { Component, Prop, Vue } from 'nuxt-property-decorator'

@Component({})
export default class MyRepository extends Vue {
@Prop()
repo: any
}
</script>

<style scoped>
.card {
margin: 10px;
border: solid 1px #ddd;
padding: 20px;
}

a {
text-decoration: none;
color: #333;
}

.name {
font-size: 1.3rem;
}

.language {
display: inline-block;
padding: 5px;
background-color: #008bff;
color: #fff;
}
</style>
7 changes: 7 additions & 0 deletions portfolio-sample/components/README.md
@@ -0,0 +1,7 @@
# COMPONENTS

**This directory is not required, you can delete it if you don't want to use it.**

The components directory contains your Vue.js Components.

_Nuxt.js doesn't supercharge these components._
4 changes: 4 additions & 0 deletions portfolio-sample/index.d.ts
@@ -0,0 +1,4 @@
declare module '*.vue' {
import Vue from 'vue'
export default Vue
}
7 changes: 7 additions & 0 deletions portfolio-sample/layouts/README.md
@@ -0,0 +1,7 @@
# LAYOUTS

**This directory is not required, you can delete it if you don't want to use it.**

This directory contains your Application Layouts.

More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/views#layouts).
43 changes: 43 additions & 0 deletions portfolio-sample/layouts/default.vue
@@ -0,0 +1,43 @@
<template>
<div class="default-container">
<my-navigation-bar class="default-header" />
<nuxt/>
</div>
</template>

<script lang="ts">
import { Component, Vue } from 'nuxt-property-decorator'
import MyNavigationBar from '~/components/MyNavigationBar.vue'

@Component({
components: {
MyNavigationBar
}
})
export default class extends Vue {}
</script>

<style>
html {
font-family: 'Source Sans Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI',
Roboto, 'Helvetica Neue', Arial, sans-serif;
font-size: 16px;
word-spacing: 1px;
-ms-text-size-adjust: 100%;
-webkit-text-size-adjust: 100%;
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased;
box-sizing: border-box;
}

*,
*:before,
*:after {
box-sizing: border-box;
margin: 0;
}

.default-header {
margin-bottom: 50px;
}
</style>
8 changes: 8 additions & 0 deletions portfolio-sample/middleware/README.md
@@ -0,0 +1,8 @@
# MIDDLEWARE

**This directory is not required, you can delete it if you don't want to use it.**

This directory contains your application middleware.
The middleware lets you define custom function to be ran before rendering a page or a group of pages (layouts).

More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/routing#middleware).
19 changes: 19 additions & 0 deletions portfolio-sample/modules/typescript.js
@@ -0,0 +1,19 @@
module.exports = function() {
// Add .ts extension to Nuxt
this.nuxt.options.extensions.push('ts')

// Extend webpack build
this.extendBuild(config => {
// Add TypeScript
config.module.rules.push({
test: /\.ts/,
loader: 'ts-loader',
options: { appendTsSuffixTo: [/\.vue$/] }
})

// Add .ts extension in webpack resolve
if (!config.resolve.extensions.includes('.ts')) {
config.resolve.extensions.push('.ts')
}
})
}