-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: 🤖 abbreviatization, and resume section
- New /resume section reading from source resume.yaml - Made resume in both YAML/JSON w/ source-code highlighted - abreviatization for title, tags, alert-box
- Loading branch information
Showing
51 changed files
with
1,201 additions
and
315 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/** | ||
* @TODO Fix TailwindCSS’s layer nested syntax? | ||
* | ||
@layer components { | ||
*/ | ||
.app-alert-box { | ||
@apply px-4 py-3 rounded-lg; | ||
& a { | ||
@apply underline; | ||
} | ||
& a:hover { | ||
@apply text-yellow-900; | ||
} | ||
& header { | ||
@apply font-bold mb-2; | ||
} | ||
& .disposition-item { | ||
@apply py-1; | ||
} | ||
& .addemdum { | ||
@apply py-2; | ||
} | ||
} | ||
/* } */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<template> | ||
<div class="nuxt-content-highlight"> | ||
<!-- eslint-disable vue/no-v-html --> | ||
<pre :class="classNames"><slot><code v-html="code" /></slot> | ||
<!-- code v-html="$prism(code, language)"></code --> | ||
</pre> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import Vue from 'vue' | ||
import { isPrismSupportedLanguage } from '~/lib' | ||
export interface Data {} | ||
export interface Methods {} | ||
export interface Computed { | ||
classNames: Record<string, boolean> | ||
} | ||
export interface Props { | ||
language: string | ||
code: string | ||
} | ||
export default Vue.extend<Data, Methods, Computed, Props>({ | ||
name: 'AppCodeHighlighter' /* app-code-highlighter */, | ||
props: { | ||
language: { | ||
type: String, | ||
default: 'javascript', | ||
validator: isPrismSupportedLanguage, | ||
}, | ||
code: { | ||
type: String, | ||
default: '', | ||
}, | ||
}, | ||
computed: { | ||
classNames() { | ||
const languageClassName = `language-${this.language}` | ||
return { | ||
[languageClassName]: true, | ||
} | ||
}, | ||
}, | ||
/** | ||
* @TODO Either make this work or remove. | ||
* Intent is to have HTML already colorized for | ||
* static HTML. | ||
* Or keep using asyncData and server-side (i.e. at generate) do | ||
* any code colorization to HTML from there. | ||
async mounted() { | ||
const code = this.code | ||
const language = this.language | ||
let maybe = code | ||
const highlighting = () => { | ||
maybe = highlight(code, language) | ||
} | ||
await this.$nextTick(highlighting) | ||
console.log('async mounted', { code, maybe }) // eslint-disable-line | ||
// this.$refs.code.innerHTML = code | ||
}, | ||
*/ | ||
}) | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
<template> | ||
<div | ||
:class="styleMap.outer" | ||
:data-alert-type="alertType" | ||
class="disposition-parent app-alert-box" | ||
role="alert" | ||
> | ||
<!-- | ||
@TODO Figure out a way NOT to do such tag-soup ^ | ||
styleMap was supposed to be doing this, but PurgeCSS | ||
removes them. Gotta fix this before re-using styleMap. | ||
--> | ||
<!-- eslint-disable vue/no-v-html --> | ||
<header | ||
v-if="titleTextContent !== ''" | ||
class="disposition-item" | ||
v-html="abbreviatize(titleTextContent)" | ||
/> | ||
<!-- eslint-disable vue/no-v-html --> | ||
<div | ||
v-if="messageTextContent !== ''" | ||
class="disposition-item" | ||
v-html="abbreviatize(messageTextContent)" | ||
/> | ||
<slot /> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import Vue, { PropOptions } from 'vue' | ||
import { | ||
abbreviatize, | ||
IAbbreviatize, | ||
IAlertType, | ||
IStyleMapAlert, | ||
styleMapAlert, | ||
} from '~/lib' | ||
export interface Data { | ||
messageTextContent: string | ||
titleTextContent: string | ||
} | ||
export interface Methods { | ||
abbreviatize: IAbbreviatize | ||
} | ||
export interface Computed { | ||
styleMap: IStyleMapAlert | ||
} | ||
export interface Props { | ||
title: string | ||
message: string | ||
alertType: IAlertType | ||
} | ||
export default Vue.extend<Data, Methods, Computed, Props>({ | ||
name: 'AppAlertBox' /* app-alert-box */, | ||
props: { | ||
title: { | ||
type: String, | ||
required: false, | ||
default: '', | ||
}, | ||
message: { | ||
type: String, | ||
required: false, | ||
default: '', | ||
}, | ||
alertType: { | ||
type: String, | ||
required: false, | ||
default: 'info', | ||
} as PropOptions<IAlertType>, | ||
}, | ||
data() { | ||
const messageTextContent = this.message || '' | ||
const titleTextContent = this.title || '' | ||
return { | ||
messageTextContent, | ||
titleTextContent, | ||
} | ||
}, | ||
computed: { | ||
styleMap(): IStyleMapAlert { | ||
const alertType: IAlertType = this.alertType | ||
const map = styleMapAlert(alertType) | ||
return map | ||
}, | ||
}, | ||
methods: { | ||
abbreviatize, | ||
}, | ||
}) | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.